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、如果只想导出特别表名的表

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

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

你可能感兴趣的:(Oracle)