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