expdp/impdp ORA-39002&ORA-39166

本文详细阐述了在使用数据泵(expdp和impdp)进行数据库迁移时,遇到ORA-39002和ORA-39166错误的解决方法。通过调整导出和导入参数,成功解决了导入指定表时出现的问题。同时,提供了MOS文档ID1235495.1作为参考,帮助读者更好地理解错误原因及解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

需求:把生产上以某些字母开头的表导入到测试环境的其它用户中。


实现方法:

1.在生产环境使用expdp的模糊导出功能,先导出这些表。

 2.在测试使用impdp的remap_schema功能将这些表导入到测试环境的其它用户。


实现过程:


1.expdp导出表
         

$ expdp scott/tiger   DIRECTORY=DPUMPDIR DUMPFILE=scott220.DMP tables=prod% JOB_NAME=MYJOB3 LOGFILE=scottEXP.LOG


2.impdp导入表

$ impdp username/password  directory=DPUMPDIR dumpfile=scott220.DMP tables=prod_201203_26  remap_schema=scott:liangwei logfile=impdp.log
Import: Release 11.2.0.3.0 - Production on Mon Nov 12 11:32:47 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Data Mining and Real Application Testing options
ORA-39002: invalid operation
ORA-39166: Object liangwei.prod_201203_26 was not found.


导入过程中,只导入指定表出现ORA-39002,ORA-39166错误。


如果impdp使用remap_schema,且指定要导入的表时,要指定表的schema。

$ impdp username/password directory=DPUMPDIR dumpfile=scott220.DMP tables=scott.prod_201203_26  remap_schema=scott:liangwei logfile=impdp.log


如果impdp使用remap_schema,导入dmp的所有数据时则不需要指定schema。

$ impdp username/password directory=DPUMPDIR dumpfile=scott220.DMP   remap_schema=scott:liangwei logfile=impdp.log


参考文档:MOS [ID 1235495.1]
DataPump Import (IMPDP) With REMAP_SCHEMA Fails With Errors ORA-39002 ORA-39166 [ID 1235495.1]
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值