1. 程式人生 > >大資料量單表在不同表名列名間的資料遷移

大資料量單表在不同表名列名間的資料遷移

(windows Server 2008 R2+oracle 11g)

單表資料1.5億條記錄,90個欄位,檔案大小70G

處理思路:源端單表exp,目標端單表imp,再通過欄位對應關係轉入到目標表(不同表名、列名)
exp username1/password1 buffer=64000 FLASHBACK_SCN=15549635609926 CONSTRAINTS=N GRANTS=N TRIGGERS=N indexes=no file=d:\tablename1.dmp TABLES=(tablename1);
imp username2/[email protected] file=f:\tablesname1.dmp log=f:\tablename1.log  tables=(tablename1) ignore=y buffer=1024000 commit=y;


create table tablename2 as select

col1  C1,col2 C2,col3 C3,col4 C4,col5 C5) from tablename1;

(注:儘量create table as select 方式。因為insert into tablename2 select * from tablename1需要更多資源,效率較慢,在plsql中執行出現無法更新資料且不報錯誤的問題)



v$session_longops檢視執行時間大於6秒的記錄,並跟蹤執行進度。