-- 数据泵
1.先建一个外部目录,在需要导出的用户下
create or replace directory MYPORT
as 'D:\appdata\dataport';
2.system授权
grant read,write on directory myport to smstest;
3.进入BIn目录
cmd——d:-cd D:\app\zKF77467\product\11.1.0\db_1\BIN
D:\app\zKF77467\product\11.1.0\db_1\BIN>expdp smstest/smstest directory=myport dumpfile=smstest.dmp
如果未指定目录directory=myport,则会导入系统默认指定的目录D:\app\zKF77467\admin\orcl\dpdump中
-- 按模式导出
expdp system/orcl directory=myport dumpfile=dump_test.dmp schemas=dump_test
impdp system/manger dumpfile=dump_test.dmp schemas=u_test nologfile=y
--按全库导出
expdp system/orcl directory=myport dumpfile=myfull.dmp full=y
1,进入bin目录
2,表模式导出
expdp scott/scott_2009 directory=mypump dumpfile=expdptab.dmp tables=dept,emp
(select * from dba_tablespaces; alter tablespace testspace online;)
3,全库模式导出
expdp system/system directory=mypump dumpfile=expdp.dmp full=y
4,schema模式导出
expdp system/system directory=mypump dumpfile=expdp.dmp schemas=scott nologfile=y
5,表空间数据导出
expdp system/system directory=mypump dumpfile=expdpspace.dmp tablespaces=users
6,可移动表空间导出
1 将user表空间设置成只读状态,然后执行可移动表空间元数据导出
sql> alter tablespace users read only;
BIN> expdp system/system directory=mypump dumpfile=exptrans.dmp transport_tablespaces=users;
sql> alter tablespace users online;
1,表模式导入
impdp scott/scott_2009 directory=mypump dumpfile=expdptab.dmp tables=dept,emp table_exists_action=replace
2,全库模式导入
impdp system/system directory=mypump dumpfile=expdp.dmp full=y
3,schema模式导入
impdp system/system directory=mypump dumpfile=expdp.dmp schemas=scott nologfile=y
4,表空间数据导入
impdp system/system directory=mypump dumpfile=expdpspace.dmp tablespaces=users
5,可移动表空间导入
1 将user表空间设置成只读状态,然后执行可移动表空间元数据导出
sql> alter tablespace users read only;
BIN> impdp system/system directory=mypump dumpfile=exptrans.dmp transport_tablespaces=users;
sql> alter tablespace users online;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12961536/viewspace-769562/
,如需转载,请注明出处,否则将追究法律责任。