日期:2014-05-16  浏览次数:20519 次

ORA-12838错误总结
ORA-12838: cannot read/modify an object after modifying it in parallel
此错误是在调用过程中出现的。经过查询,是由于在过程中使用了append insert运行后没有及时提交造成。对于此问题,确切的解释是这样的,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.
这样就清晰的多了,错误的原因是direct load,也就是前面的append insert。解决的办法就是在append insert后及时的commit。

及时修改过程,重新运行,就再没有此问题了。

Insert和append insert的原理上是完全不同的,insert append可以实现直接路径加载,速度比常规加载方式快很多。但有一点需要注意: insert append时在表上加“6”类型的Exclusive锁,即排它锁,为表级锁,会阻塞表上的所有DML语句。因此在有业务运行的上传环境下要慎重使用。