-
Notifications
You must be signed in to change notification settings - Fork 186
ORA-12838: cannot read/modify an object after modifying it in parallel on PaaS ATP #1134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The error is gone if I add below before executing ut.run: ALTER SESSION DISABLE PARALLEL DML; begin ut.run(); end; Session altered. Between string function Finished in .005676 seconds |
Hi @satyendra33 |
Also, is the your database using automatic degree of parallelism as per this document? |
This issue was produced on utPLSQL v3.1.10 . Also because it's an ATP database we did not set any parameters explicitly, all are controlled and defaulted by Oracle. I do see that parallel degree policy is set to AUTO. SHOW PARAMETER PARALLEL; awr_pdb_max_parallel_slaves integer 10 |
@jgebal you can reproduce the issue in the current develop version when connecting as alter session enable parallel dml;
begin
ut.run('UT3$USER#:utplsql.test_user.expectations.binary.test_equal.success_on_equal_data');
end;
/ The error stack is:
Here's a simple variant to reproduce the error in any session: alter session enable parallel dml;
create table t (c1 integer);
insert into t values(1);
insert into t values(2);
commit;
-- uses configured DOP
update t set c1 = c1+1;
-- throws ORA-1238
select * from t; The last You can solve the issue by modifying the update as follows:
So the fixed script looks as follows: alter session enable parallel dml;
create table t (c1 integer);
insert into t values(1);
insert into t values(2);
commit;
-- override default DOP to ensure the changed table can be read without committing the transaction
update /*+noparallel */ t set c1 = c1+1;
-- does not throw a ORA-12838
select * from t; I see basically two options to solve the issue in the utPLSQL framework. a) execute I'd go with option b) since this tests the code in the configured way. Especially if you want to test that "your" code does not throw a ORA-12838. |
I'm having trouble reproducing this on my local
Here is what I got when tried reproducing with above settings on my DB.
|
I would really like to be able to reproduce this issue so that I can add a unit test case into framework test suite and therefore avoid regression in future. |
You should get a plan a parallel plan. Otherwise you cannot reproduce it. Something like ---------------------------------------------------
| Id | Operation | Name | E-Rows |
---------------------------------------------------
| 0 | UPDATE STATEMENT | | |
| 1 | PX COORDINATOR | | |
| 2 | PX SEND QC (RANDOM) | :TQ10000 | 2 |
| 3 | UPDATE | T | |
| 4 | PX BLOCK ITERATOR | | 2 |
|* 5 | TABLE ACCESS FULL| T | 2 |
---------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
5 - access(:Z>=:Z AND :Z<=:Z)
Note
-----
- dynamic statistics used: dynamic sampling (level=2)
- automatic DOP: Computed Degree of Parallelism is 2
- Warning: basic plan statistics not available. These are only collected when:
* hint 'gather_plan_statistics' is used for the statement or
* parameter 'statistics_level' is set to 'ALL', at session or system level Can you try to create the test table with a parallel degree? Something like create table t (c1 integer) parallel 2; |
@jgebal - Even I couldn't produce on my db running in VM using given method but the one below works: insert /*+ APPEND_VALUES */ 1 row inserted. select * from t; Error starting at line : 16 in command - |
@jgebal based on https://github.com/utPLSQL/docker-scripts/blob/main/19.3/Dockerfile#L63 the image is based on a Standard Edition 2. Parallel DML requires Enterprise Edition. See https://docs.oracle.com/en/database/oracle/oracle-database/19/dblic/Licensing-Information.html#GUID-0F9EB85D-4610-4EDF-89C2-4916A0E7AC87 |
I've build a EE docker image locally just to test it out |
@jgebal I suppose you can produce the issue without EE using below commands: insert /*+ APPEND_VALUES */ 1 row inserted. select * from t; Error starting at line : 16 in command - |
I have installed utPLSQL on a PaaS ATP database which is 19c Enterprise Edition Version 19.5.0.0.0. I tried to validate installation by creating package test_betwnstr and calling exec ut.run but here I get this exception.
I added a commit at line#91 of the package UT_ANNOTATION_CACHE_MANAGER, which resolved the error, but the run is taking forever.FYI- My installation is without DDL trigger and I do not have many custom objects in schema.
ORA-06512: at "UT3.UT_ANNOTATION_CACHE_MANAGER", line 91
ORA-06512: at "UT3.UT_ANNOTATION_MANAGER", line 201
ORA-06512: at "UT3.UT_ANNOTATION_MANAGER", line 311
ORA-06512: at "UT3.UT_SUITE_MANAGER", line 431
ORA-06512: at "UT3.UT_SUITE_MANAGER", line 505
ORA-06512: at "UT3.UT_RUNNER", line 150
ORA-12838: cannot read/modify an object after modifying it in parallel
ORA-06512: at "UT3.UT_ANNOTATION_CACHE_MANAGER", line 91
ORA-06512: at "UT3.UT_ANNOTATION_MANAGER", line 201
ORA-06512: at "UT3.UT_ANNOTATION_MANAGER", line 311
ORA-06512: at "UT3.UT_SUITE_MANAGER", line 431
ORA-06512: at "UT3.UT_SUITE_MANAGER", line 505
Error starting at line : 8 in command -
begin ut.run(); end;
Error report -
ORA-12838: cannot read/modify an object after modifying it in parallel
ORA-06512: at "UT3.UT_RUNNER", line 180
ORA-06512: at "UT3.UT_ANNOTATION_CACHE_MANAGER", line 91
ORA-06512: at "UT3.UT_ANNOTATION_MANAGER", line 201
ORA-06512: at "UT3.UT_ANNOTATION_MANAGER", line 311
ORA-06512: at "UT3.UT_SUITE_MANAGER", line 431
ORA-06512: at "UT3.UT_SUITE_MANAGER", line 505
ORA-06512: at "UT3.UT_RUNNER", line 150
ORA-06512: at "UT3.UT", line 134
ORA-06512: at "UT3.UT", line 488
ORA-06512: at "UT3.UT", line 558
ORA-06512: at line 1
12838. 00000 - "cannot read/modify an object after modifying it in parallel"
*Cause: Within the same transaction, an attempt was made to add read or
modification statements on a table after it had been modified in parallel
or with direct load. This is not permitted.
*Action: Rewrite the transaction, or break it up into two transactions
one containing the initial modification and the second containing the
parallel modification operation.
The text was updated successfully, but these errors were encountered: