Hello guys i need to copy 6000000 rows from TMP_DATA to DATA what is the best way to do this?
I was thinking of doing INSERT INTO DATA SELECT * FROM TMP_DATA
. But i think it will take ages to do the insert.
What do you suggest?
Kind Regards,
To expand a bit on Anders' answer and mathguy's comments, do the following:
alter table data nologging;
alter session enable parallel dml;
-- disable any triggers on `data` and temporarily drop any indexes
insert /*+ append */ * into data
select /*+ parallel (4) */ * from tmp_data
--sample (10) -- if tmp_data has 60 million rows: 10 means 10%
-- where rownum < 6000001
-- pick one of the two prior clauses if tmp_table has > 6 million rows
after the insert is done:
alter table data nologging;
-- enable triggers and recreate indexes
and have the dba do a backup as the data
table will not be able to be recovered if there was any issue after the load.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments