insert into tab1 select * from tab2 partition (p1);
insert into tab1 select * from tab2 partition (p2);
insert into tab1 select * from tab2 partition (p3);
insert into tab1 select * from tab2 partition (p4);
DECLARE
TYPE dtarray IS TABLE OF VARCHAR2(20) INDEX BY BINARY_INTEGER;
v_col1 dtarray;
v_col2 dtarray;
v_col3 dtarray;
BEGIN
SELECT col1, col2, col3 BULK COLLECT
INTO v_col1, v_col2, v_col3
FROM tab2;
FORALL i IN 1 .. v_col1.COUNT
insert into tab1 WHERE tab1.col1 = v_col1;
END;
sqlplus -s user/pwd< runlog.txt
set copycommit 2;
set arraysize 5000;
copy from user/pwd@sid -
to user/pwd@sid -
insert tab1 using select * from tab2;
exit
EOF