重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1424|回复: 0
打印 上一主题 下一主题

[工具] remap_table在进行impdp时的使用

[复制链接]
跳转到指定楼层
楼主
发表于 2022-6-19 11:45:25 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
remap_table转换多个表时,TB1转换TB2、TB3转换TB4。

1.remap_table=tb1:tb2 remap_table=tb3:tb4
2.remap_table=tb1:tb2,tb3:tb4

impdp关于tables和remap_tables的一些注意事项

1.expdp时写上tables=(表)表示导出某些表;impdp时不写tables条件表示导入dumpfile中的所有表,impdp时写tables=(表)条件表示只导入指定的表,当然如果tables=(dumpfile中的所有表)也就是导入dumpfile中的所有表;且如果用system执行impdp时则tables=(表)时必须加上schema.表名,否则会默认是为system下面的表,会导致报错

2.remap_table如果在同一个schema下进行,虽然不要加remap_schema,但是remap_table冒号前面的表名一定要带schema信息,冒号后面的表名一定不能带schema信息

3.remap_table如果在不同schema的情况下进行,如user1.TB1转换成user2.TB2,user1.TB3转换成user2.TB4,必须加remap_schema,且remap_table冒号前面的表名一定要带schema信息,冒号后面的表名一定不能带schema信息

有如下两种方式

1.remap_table= user1.TB1:TB2 remap_table= user1.TB3:TB4 remap_schema= user1: user2

2.remap_table= user1.TB1:TB2,user1.TB3:TB4 remap_schema= user1: user2


跨schema只导出导入表并重命名的标准方式如下

expdp时tables写上schema.表名并用逗号隔开

impdp时需要remap_schema, tables可写可不写,remap_table冒号前面的表名加上schema,冒号后面的表名不加schema

expdp system/oracle tables=user01.src_tb01,user01.src_tb02,user01.src_tb03 directory=DMP dumpfile=tb_2013.dbf

impdp system/oracle remap_schema=user01:user02 tables=user01.src_tb01,user01.src_tb02,user01.src_tb03  remap_table=user01.src_tb01:dest_tb01,user01.src_tb02:dest_tb02,user01.src_tb03:dest_tb03 directory=IMP dumpfile=tb_2013.dbf
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-4-29 07:12 , Processed in 0.096019 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表