1.使用expdp要先在数据库中创建directory,并给相应的用户read,write权限.
SQL>create dexp和empdp的区别irectory dmpdir as ‘/u01/dmdir’;
SQL>grant read,write on directory to test;
2.常用导出方法
$expdp scott/tiger DUMPFILE=scott.dmp DIRECTORY=dmpdir SCHEMAS=test
$expdp scott/tiger DUMPFILE=tmp_dump.dmp DIRECTORY=dmpdir TABLES=(tmp_test:p1,tmp_test:p2) JOB_NAME=tmp_dump LOGFILE=tmp_dump.log
$expdp scott/tiger DUMPFILE=full.dmp DIRECTORY=dmpdir FULL=Y JOB_NAME=full
$expdp scott/timer DUMPFILE=tmp_200703.dmp DIRECTORY=dmpdir TABLES=tmp QUERY=\”where to_char\(create_time,\’yyyy-mm-dd\’\)\<\'2007-04\'\"
常用一些参数说明:
4.exp/imp与expdp/impdp区别:
把用户usera的对象导到用户userb,用法区别在于fromuser=usera touser=userb ,remap_schema=’usera’:'usera’ 。
(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;
例如: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;