官方解释如下:
ORA-12838 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
如果使用了
insert /*+ append */ into table as select .. from table
后没有提交或者回滚该事物,再次在该事物中什么查询或者DML都会报错
如使用循环插入,批量提交的时候,建议取消append 提交
示例:
SQL> create table test1 as select * from dba_objects;
Table created
SQL> insert /*+append*/ into test1 select * from dba_objects where rownum<100;
99 rows inserted
SQL> select /*+parallel(a 13)*/ count(*) from test1 a;
select /*+parallel(a 13)*/ count(*) from test1 a
ORA-12838 cannot read/modify an object after modifying it in parallel