1. 执行expdp之前要先创建directory对象,如:
CONNECT system/manager
CREATE OR REPLACE DIRECTORY expdir AS ‘d:/exp’;
GRANT read,write ON DIRECTORY expdir TO public;
2. 常见用法:
2.1 导出scott整个schema
expdp scott/tiger@bright parfile=c:/exp.par –默认导出登陆账号的schema
exp.par内容:
DIRECTORY=expdir
DUMPFILE=scott_full.dmp
LOGFILE=scott_full.log
或者:
expdp system/oracle@bright parfile=c:/exp.par –其他账号登陆,在参数中指定schemas
exp.par内容:
DIRECTORY=expdir
DUMPFILE=scott_full.dmp
LOGFILE=scott_full.log
SCHEMAS=SCOTT
2.2 导出scott下的dept,emp表
expdp scott/tiger@bright parfile=c:/exp.par
exp.par内容:
DIRECTORY=expdir
DUMPFILE=scott.dmp
LOGFILE=scott.log
TABLES=DEPT,EMP
2.3 导出scott下除emp之外的表
expdp scott/tiger@bright parfile=c:/exp.par
exp.par内容:
DIRECTORY=expdir
DUMPFILE=scott.dmp
LOGFILE=scott.log
EXCLUDE=TABLE:”=’EMP’”
2.4 导出scott下的存储过程
expdp scott/tiger@bright parfile=c:/exp.par
exp.par内容:
DIRECTORY=expdir
DUMPFILE=scott.dmp
LOGFILE=scott.log
INCLUDE=PROCEDURE
2.5 导出scott下以’E'开头的表
expdp scott/tiger@bright parfile=c:/exp.par
DIRECTORY=expdir
DUMPFILE=scott.dmp
LOGFILE=scott.log
INCLUDE=TABLE:”LIKE ‘E%’” –可以改成 NOT LIKE,就导出不以E开头的表