ITPub博客

首页 > 数据库 > Oracle > append提示与外键还有ORA-12838

append提示与外键还有ORA-12838

原创 Oracle 作者:OmarChina 时间:2007-10-12 09:35:16 0 删除 编辑

今天看AskTom上一文。记录下。

http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:486662100346064066

有外键的时后。append提示就会忽略了。

[@more@]

SQL> create table t1(id int primary key);

Table created.

SQL> create table t2(id int references t1);

Table created.

SQL> create table t3(id int);

Table created.

SQL> insert into t1 select rownum from dual connect by rownum<=10;

10 rows created.

SQL> commit;

Commit complete.

SQL> insert /*+append*/ into t2 select * from t1;

10 rows created.

SQL> insert /*+append*/ into t3 select * from t1;

10 rows created.

SQL> select count(*) from t2;

COUNT(*)

----------

10

因为T2表上存在外键,所以APPEND失效。

SQL> select count(*) from t3;

select count(*) from t3

*

ERROR at line 1:

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

t3表采用了append插入方式插入数据效果生效,不COMMIT就会报错。

SQL> commit

Commit complete.

SQL> select count(*) from t3;

COUNT(*)

----------

10

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9925929/viewspace-976090/,如需转载,请注明出处,否则将追究法律责任。

上一篇: restore archivelog
请登录后发表评论 登录
全部评论
  • 博文量
    68
  • 访问量
    997206