ORA-39002 ORA-39358 错误处理方法

178 篇文章 16 订阅

问题说明

在做数据库还原时出现ORA-39002 和 ORA-39358 错误,具体信息如下:

$ impdp rui/oracle directory=dmp_dir dumpfile=test_expdp20210514.dmp logfile=test_impdp202105141.log  job_name=rui202105141_job

Import: Release 12.1.0.2.0 - Production on Fri May 14 11:05:04 2021

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
ORA-39002: invalid operation
ORA-39358: Export dump file version 12.1.0.2.0 not compatible with target version 11.2.0.0.0

说明:
源库和目标库的版本均为12.1.0.2.0

一时之间有些郁闷,我的目标库版本就是12.1.0.2.0 呀,哪里冒出的 “version 11.2.0.0.0” 呢?

在网上查找资料发现可能是参数 compatible 配置的问题。
查看源库和目标库的 compatible 参数值,分别如下:

源库
SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      12.1.0.2.0
noncdb_compatible                    boolean     FALSE
目标库
SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      11.2.0.0.0
noncdb_compatible                    boolean     FALSE

问题果然出在这里!

于是决定将目标库的 compatible 参数值修改为 12.1.0.2.0 ,操作方法见下文。

处理方法

修改 compatible 参数值

$ sqlplus / as sysdba
SQL> show parameter compatible    //查看当前参数值为11.2.0.0.0

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      11.2.0.0.0
noncdb_compatible                    boolean     FALSE
SQL> alter system set compatible='12.1.0.2.0' scope=spfile; //修改参数值为12.1.0.2.0

System altered.

SQL> shutdown immediate    

SQL> startup
ORACLE instance started.

SQL> show parameter compatible  //查看更新后的参数值,已为12.1.0.2.0

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      12.1.0.2.0
noncdb_compatible                    boolean     FALSE

效果验证

再次执行如下命令:

$ impdp rui/oracle directory=dmp_dir dumpfile=test_expdp20210514.dmp logfile=test_impdp202105141.log  job_name=rui202105141_job

可正常导入。

在这里插入图片描述

  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值