导出dmp文件`
- 导出命令:
expdp username/passowrd@ORCL directory=dir_dp dumpfile=AIR_STNH_DATA.dmp logfile=AIR_STNH_DATA.log tables=xadb.AIR_STNH_DATA
directory=dir_dp 文件夹需要手动创建,百度创建语句
- 导入语句 (当前表是分区表)
impdp username/passowrd@ORCL directory=dir_dp dumpfile=AIR_STNH_DATA.dmp logfile=AIR_STNH_DATA.log tables=xadb.AIR_STNH_DATA CONTENT=DATA_ONLY
- 参考语句:
expdp/impdp的CONTENT选项
CONTENT用于指定要导入/出的内容.默认值为ALL
CONTENT={ALL | DATA_ONLY | METADATA_ONLY}
当设置CONTENT为ALL 时,将导出对象定义及其所有数据.
为DATA_ONLY时,只导出对象数据,
为METADATA_ONLY时,只导出对象定义
1、创建DIRECTORY
create directory dir_dp as ‘D:/oracle/dir_dp’;
2、授权
Grant read,write on directory dir_dp to zftang;
–查看目录及权限
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;
expdp user/pass DIRECTORY=dump DUMPFILE=data.dump CONTENT=METADATA_ONLY
impdp user/pass DIRECTORY=dump DUMPFILE=data.dump CONTENT=METADATA_ONLY