rbrooker
Member³
hi,
i have a table that has 1.8 billion rows that i need to copy from "HERE" to "THERE" in the same database. in your learned opinions, what would be the fastest means of doing this? As to why, i am changing the partitioning from range hash to range list.
what i have is :
any ideas in how to improve it?
thanks.
i have a table that has 1.8 billion rows that i need to copy from "HERE" to "THERE" in the same database. in your learned opinions, what would be the fastest means of doing this? As to why, i am changing the partitioning from range hash to range list.
what i have is :
Code:
DECLARE
TYPE ARRAY IS TABLE OF owner.transactions%ROWTYPE;
l_data ARRAY;
CURSOR c1 IS
SELECT /*+ PARALLEL( a, 8 ) */ *
FROM owner.transactions a;
BEGIN
OPEN c1;
LOOP
FETCH c1 BULK COLLECT
INTO l_data LIMIT 200000;
FORALL i IN INDICES OF l_data
INSERT INTO owner.new_transactions
VALUES l_data(i);
COMMIT;
EXIT WHEN c1%NOTFOUND;
END LOOP;
COMMIT;
END;
/
thanks.