Oracle Datapump相关操作汇总
--create directory
create directory dump_dir as '/splex/dump';
grant read,write on directory dump_dir to public;
--export full database schema
expdp user/password content=metadata_only cluster=no full=y directory=dump_dir dumpfile=expdp_full_schema.dmp logfile=expdp_full_schema.log
--export full database
expdp user/password content=all cluster=no full=y directory=dump_dir dumpfile=expdp_full.dmp logfile=expdp_full.log
--export users schema
expdp user/password schemas=user1,user2,user3 content=metadata_only cluster=no exclude=statistics directory=dump_dir dumpfile=expdp_users_schema.dmp logfile=expdp_users_schema.log
--export users schema and data
expdp user/password schemas=user1,user2,user3 content=all cluster=no PARALLEL=4 FILESIZE=20480M exclude=statistics directory=dump_dir dumpfile=expdp_users_%U.dmp logfile=expdp_users.log
--export tables schema
expdp user/password tables=tab1,tab2,tab3 content=metadata_only cluster=no exclude=statistics directory=dump_dir dumpfile=expdp_tables_schema.dmp logfile=expdp_tables_schema.log
--export tables schema and data
expdp user/password tables=tab1,tab2,tab3 content=all cluster=no PARALLEL=4 FILESIZE=20480M exclude=statistics directory=dump_dir dumpfile=expdp_tables_%U.dmp logfile=expdp_tables.log
network_link=dblink_name --export remote database by dblink
--export tables schema and data using compress
expdp user/password tables=tab1,tab2,tab3 content=all cluster=no PARALLEL=4 FILESIZE=20480M exclude=statistics directory=dump_dir dumpfile=expdp_tables_%U.dmp logfile=expdp_tables.log
compression=all --对元数据和表数据进行压缩,11g开始支持
compression=data_only --对表数据进行压缩,11g开始支持
compression=metadata_only --对元数据进行压缩,10g开始支持,默认方式
--import schema or data
impdp user/password directory=dump_dir dumpfile=expdp.dmp logfile=impdp.log ignore=y
--import schema or data using parallel
impdp user/password directory=dump_dir PARALLEL=4 dumpfile=expdp_%U.dmp logfile=impdp.log ignore=y
--REMAP_SCHEMA=schema1:schema2 --不同用户之间的数据迁移
--REMAP_TABLESPACE=tbs1:tbs2 ---不同表空间之间的数据迁移
--REMAP_TABLE=schema1.tab1:tab2 ---相同schema不同表之间的数据迁移
--REMAP_TABLE=schema1.tab1:tab2 REMAP_SCHEMA=schema1:schema2 ---不同schema不同表之间的数据迁移
--TABLE_EXISTS_ACTION=SKIP --跳过已经存在的表
--TABLE_EXISTS_ACTION=APPEND --追加数据至已经存在的表,但不影响已经存在的数据,这是默认行为
--TABLE_EXISTS_ACTION=TRUNCATE --truncate已经存在的表的数据,保留表结构,然后进行数据导入
--TABLE_EXISTS_ACTION=REPLACE --drop 已经存在的表,然后进行数据导入
本文来自博客园,作者:踏雪无痕2017,转载请注明原文链接:https://www.cnblogs.com/oradba/p/14822201.html
分类:
数据库数据迁移与历史数据归档
, Oracle
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)