暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

数据泵常用操作

原创 user-yy 2023-12-21
78

EXPDP

导出整库
expdp username/password DIRECTORY=dpump_dir DUMPFILE=full_export_%U.dat FULL=Y LOGFILE=export.log PARALLEL=4
%U 是一个自动生成文件名的占位符,PARALLEL=4 表示使用4个并行进程来执行导出。

导出某个模式
[oracle@strong ~]$ expdp system/system@orcl schemas=hr
dumpfile=hr_dump:schema_by_system.dat
[oracle@strong ~]$ expdp hr/hr@orcl directory=hr_dump
dumpfile=schema_by_hr.dat

导出特定的表
expdp system/system@orcl
tables=hr.employees,hr.jobs,hr.departments directory=hr_dump
dumpfile=table_by_system.dat

导出指定的表空间
expdp system/system@orcl tablespaces=sysaux parallel=2
directory=hr_dump dumpfile=tablespace_by_system.dat

只导出数据行
通过content参数,可以指定导出的内容:
ALL:导出表数据和元数据;
DATA_ONLY:只导出表行数据;
METADATA_ONLY:只导出元数据,即对象的定义(只导出表结构)
expdp system/system@orcl schemas=hr content=data_only
directory=hr_dump dumpfile=schema_by_system_dataonly.dat

--------------------------------------------------------------------------------------------------------------------------------------
IMPDP
导入整库
impdp system/system@orcl full=y directory=hr_dump
dumpfile=full_export.dat

导入表空间
impdp system/system@orcl tablespaces=sysaux
directory=hr_dump dumpfile=tablespace_by_system.dat
table_exists_action=replace

导入指定的表
impdp hr/hr@orcl tables=employees directory=hr_dump
dumpfile=table_by_hr.dat table_exists_action=replace

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论