博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
impdp的remap_schema
阅读量:7138 次
发布时间:2019-06-28

本文共 1513 字,大约阅读时间需要 5 分钟。

   今天在写一个简单的备份脚本时,遇到了一个小问题。

      在用IMPDP执行导入操作时报没有该用户。

    
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production

With the Partitioning, OLAP and Data Mining options

ORA-39002: invalid operation

ORA-39165: Schema XXX was not found.
      

      奇怪明明建立了,怎么还会没有呢?这是突然想起来在IMPDP的参数SCHEMAS指定的比较“别扭”,因为原来在使用IMP的时候在SCHEMA级别时常常需要写FROMUSER 、TOUSER这两个参数的。但是IMPDP却没有!正好这次IMPDP导入的用户名和源用户又不同!

      还好使用另外的REMAP_SCHEMA参数解决了该问题。ORACLE的官方手册中这样提到:

     
REMAP_SCHEMA


Default: none


Purpose


Loads all objects from the source schema into a target schema.


Syntax and Description


REMAP_SCHEMA=source_schema:target_schema


Multiple REMAP_SCHEMA lines can be specified, but the source schema must be different for each one. However, different source schemas can map to the same target schema. The mapping may not be 100 percent complete, because there are certain schema references that Import is not capable of finding. For example, Import will not find schema references embedded within the body of definitions of types, views, procedures, and packages.


If the schema you are remapping to does not already exist, the import operation creates it, provided the dump file set contains the necessary CREATE USER metadata for the source schema and you are importing with enough privileges.
      

      要注意:

      1.该参数的使用方法
REMAP_SCHEMA=source_schema:target_schema
      
2.即使你指定的对应SCHEMA不存在,只要导入时连接的用户有足够的权限,就会使用DUMP文件中的CREATE USER的metadata来创建一个对应的用户的。

       

     ----------手册真的很重要 -:)

本文转自Be the miracle!博客51CTO博客,原文链接http://blog.51cto.com/miracle/83688如需转载请自行联系原作者

Larry.Yue

你可能感兴趣的文章
webpack源码分析(1)----- webpack.cmd
查看>>
Oracle存在修改,不存在插入记录
查看>>
Java实现欢迎登录学员管理系统
查看>>
自我剖析,坚持有多难?
查看>>
find 指令
查看>>
系统学习redis之六——redis数据类型之set数据类型及操作
查看>>
【简报】帮助开发人员在线了解CSS Filter特性的工具 - CSS FilterLab
查看>>
软考信息系统监理师:2016年4月22日作业
查看>>
META-INF\MANIFEST.MF (系统找不到指定的路径)
查看>>
俄罗斯方块软件:C语言应用初步感受
查看>>
【安全牛学习笔记】收集敏感数据、隐藏痕迹
查看>>
LinkedME|Deep Linking技术你真的了解吗
查看>>
Memcached,redis监控详解
查看>>
Linux-13软件安装
查看>>
MySQL 基本语句
查看>>
CentOS7.4——构建iscsi网络存储
查看>>
DEDECMS 全站关键字自动添加链接的方法
查看>>
Linux入门及企业服务器知识学习笔记
查看>>
Let’sEncrypt证书申请
查看>>
硬盘分区、寻址和系统启动过程
查看>>