I have a 5 Million row table that I'm trying to recreate as a partitioned table. Basically I've created a matching, partitioned table and am using a cursor loop to read a row from the original table and inserting it into the new table. It is doing a commit after each insert which is slowing things down. Is there any way inside of a simple cursor loop to tell to only commit every X number of rows?
Here is the loop
DECLARE
CURSOR c_Customer_Dim IS
SELECT * FROM MKDM.CUSTOMER_DIM;
Actually, it will slow things down a little bit by using mod, you can just use counter to determine the commit point, somthing like:
If counter = X THEN ----- X rows to commit
counter := 0;
commit;
END IF;
counter := counter + 1;
.....
Bookmarks