Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Two "create table as select" locking?
Hi!
GS> Question: did the two "create table as select * from A" commands GS> lock each other out? I know two "select * from A" should never lock GS> each other, but does the "create table as" request a different type GS> of lock?
When you run "create table as" statement Oracle runs implicit "create","select", and "insert" statements. Dead lock is possible if two sessions insert rows in different order(primary key must be enabled):
SQL1> create table tmp1 (n number primary key); SQL1> insert into tmp1 values (1); SQL2> insert into tmp1 values (2); SQL1> insert into tmp1 values (2); --
Bye