ORA-12838: cannot read/modify an object after modifying it in parallel

renjixinchina發表於2014-04-02

官方解釋如下:

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

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15747463/viewspace-1134815/,如需轉載,請註明出處,否則將追究法律責任。

相關文章