Bulk Insert from SQL Server to Oracle
890207Sep 23 2011 — edited Sep 24 2011I have to load around 20 million rows from SQL Server table to Oracle table using Network Link,wrote following code using Bulk Collect,which is working but taking more time(taking 5 hrs).
I also tried with changing table to parallel degree 8 didn't help(Also Oracle Table set to NOLOGGONG mode).
Is there any better way to do this ? Appreciate any help in this regard .
Script :
CREATE OR REPLACE PROCEDURE INSERT_SQLSERVER_TO_ORACLE
IS
TYPE v_ARRAY IS TABLE OF TARGET_CUST%ROWTYPE INDEX BY BINARY_INTEGER;
ins_rows v_ARRAY;
BEGIN
DECLARE CURSOR REC1 IS
SELECT COL1, COL2,COL3,COL4 SOURCE_SQLSERVER_CUST;
BEGIN
OPEN REC1;
LOOP
FETCH REC1 BULK COLLECT INTO ins_rows LIMIT 5000;
FORALL i IN ins_rows.FIRST..ins_rows.LAST
INSERT INTO TARGET_CUST VALUES ins_rows(i);
EXIT WHEN REC1%NOTFOUND;
END LOOP;
COMMIT;
CLOSE REC1;
END;
END;
Thanks in Advance.