Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Multi table insert direct path into only one table.

chris_cFeb 5 2015 — edited Feb 6 2015

Is it possible to perform a multi table insert where only one of the target tables is loaded as a direct path? The simplest example I can come up with is:-

create table tab1 (col01 varchar2(25));

create table tab2 (col01 varchar2(25));

create table tab3 (col01 varchar2(25));

insert into tab1 values ('A');

insert into tab1 values ('B');

commit;

INSERT ALL

  when col01 ='A'

THEN

  into tab2 (col01)

ELSE

  into tab3 (col01)

select col01 from tab1;

adding an append hint (e.g. INSERT /*+ APPEND */ ALL) causes all the tables to be loaded as direct path, the problem here is that in the actual design I am looking at tab3 is used by multiple inserts where records coming in are rejected and we are seeing a lot of enq tm contention as multiple processes are attempting to direct path load at the same time, I suspect the answer to the question is that this isn't possible so the developer is going to have to re-write their logic.

Oracle version is 11.2.0.3 on redhat 6

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 6 2015
Added on Feb 5 2015
2 comments
951 views