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

sys@ORCL> conn anbob

Enter password:

Connected.

anbob@ORCL> create table testap(id number);

Table created.

anbob@ORCL> insert /*+ append*/ into testap select 1 from dual;

1 row created.

anbob@ORCL> select * from testap;

select * from testap

*

ERROR at line 1:

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

anbob@ORCL> !oerr ora 12838

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.

anbob@ORCL> insert /*+ append*/ into testap values(2);

insert /*+ append*/ into testap values(2)

*

ERROR at line 1:

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

anbob@ORCL> rollback;

Rollback complete.

anbob@ORCL> insert /*+ append*/ into testap values(2);

1 row created.

anbob@ORCL> select * from testap;

ID

----------

2

note :

insert /*+ append*/ 是直接路径加载几乎不生成redo、undo且并行插入,再进行其它操作也就无法保证事务的原子性,因此必须在append 操作后执行commit,结束事务开始新事务,而此时其它session 是不会报错的.

打赏

8732971891f4ba05583674ca6b8145ac.png微信扫一扫,打赏作者吧~

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值