Oracle数据泵的备份与恢复

1、创建DIRECTORY

create directory sjhf as '/data/sjhf';
Grant read,write on directory sjhf to test;

2、查看目录及权限

SELECT privilege, directory_name, DIRECTORY_PATH FROM user_tab_privs t,
all_directories d WHERE t.table_name(+) = d.directory_name ORDER BY 2, 1; 

3、执行导出

expdp test/passwd@orcl version=10.2.0.1 directory=sjhf dumpfile =test.dmp 

4、执行导入
先将要恢复的dmp文件放置/data/sjhf目录下,例如:test.dmp

impdp test/passwd@orcl directory=sjhf dumpfile=test.dmp

5、如果只想导出指定表名的表

--Linux下
expdp scott/tiger directory=sjhf dumpfile=scott.dmp include=table:\"LIKE \'%EMP%\'\"

--Windows下
expdp scott/tiger directory=sjhf dumpfile=scott.dmp include=table:\"LIKE '%EMP%'\" 

 

posted on 2016-01-29 11:03  梓沐  阅读(346)  评论(0编辑  收藏  举报

导航