首页 > 数据库 > Oracle > Oracle数据泵的备份与恢复
1、创建DIRECTORY
create directory sjhf as 'E:\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
通用写法
expdp test/passwd@orcl version=10.2.0.1 dumpfile=test%mydate%.dmp directory=sjhf logfile=test%mydate%.log
forfiles /p "E:\sjhf" /s /m *.dmp /d -1 /c "cmd /c del @file"
4、执行导入
先将要恢复的dmp文件放置E:\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%'\"
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29812844/viewspace-1878485/ ,如需转载,请注明出处,否则将追究法律责任。