userid=test/test --導出的用戶,本地用戶!!
directory=dmpfile --導出的邏輯目錄,一定要在oracle中創建完成的,并且給用戶授權讀寫權限
dumpfile=xx.dmp --導出的數據文件的名稱,如果想在指定的位置的話可以寫成dumpfile=/home/oracle/userxx.dmp
logfile=xx.log --日志文件,如果不寫這個參數的話默認名稱就是export.log,可以在本地的文件夾中找到
schemas=userxx --使用dblink導出的用戶不是本地的用戶,需要加上schema來確定導出的用戶,類似于exp中的owner,但還有一定的區別
EXCLUDE=TABLE:"IN('T1','T2','T3')" --exclude 可以指定不導出的東西,table,index等,后面加上不想導出的表名
network_link=db_local --這個參數是使用的dblink來遠程導出,需要指定dblink的名稱
列出一些場景:
1)導出用戶及其對象
expdp scott/tiger@orcl schemas=scott dumpfile=expdp.dmp directory=dump_dir logfile=expdp.log;
2)導出指定表
expdp scott/tiger@orcl tables=emp,dept dumpfile=expdp.dmp directory=dump_dir logfile=expdp.log;
3)按查詢條件導
expdp scott/tiger@orcl directory=dump_dir dumpfile=expdp.dmp tables=empquery='where deptno=20' logfile=expdp.log;
4)按表空間導
expdp system/manager@orcl directory=dump_dir dumpfile=tablespace.dmp tablespaces=temp,example logfile=expdp.log;
5)導整個數據庫
expdp scott/123@127.0.0.1/orcl directory=dump_dir dumpfile=ly.dmp full=y logfile=expdp.log;
6)導入指定表
impdp scott/tiger@orcl directory=dump_dir dumpfile=expdp.dmp table_exists_action=replace;