1. 程式人生 > >淺談exp與expdp的區別

淺談exp與expdp的區別

1:把使用者usera的物件導到使用者userb,用法區別在於fromuser=usera touser=userb ,remap_schema='usera':'usera' 。例如

imp system/passwd fromuser=usera touser=userb file=/oracle/exp.dmp log=/oracle/exp.log;
impdp system/passwd directory=expdp dumpfile=expdp.dmp remap_schema='usera':'userb' logfile=/oracle/exp.log;

2:更換表空間,用exp/imp的時候,要想更改表所在的表空間,需要手工去處理一下,
如alter table xxx move tablespace_new之類的操作。
用impdp只要用remap_tablespace='tabspace_old':'tablespace_new'

3:當指定一些表的時候,使用exp/imp 時,tables的用法是 tables=('table1','table2','table3')。
expdp/impdp的用法是tables='table1','table2','table3'

4:
是否要匯出資料行
exp (ROWS=Y 匯出資料行,ROWS=N 不匯出資料行)
expdp content(ALL:物件+匯出資料行,DATA_ONLY:只匯出物件,METADATA_ONLY:只匯出資料的記錄)


注:1、IMP只適用於EXP匯出檔案,不適用於EXPDP匯出檔案;IMPDP只適用於EXPDP匯出檔案,而不適用於EXP匯出檔案

      2、expdp/impdp是資料泵,是Oracle 10g 以後才有,expdp只能在伺服器執行;匯入匯出速度比較快