ORA-39142 ORA-39000 轉(zhuǎn)儲(chǔ)文件不兼容
數(shù)據(jù)庫(kù):oracle 11.2.0.4
系統(tǒng):centos 7.9
問(wèn)題描述:將dmp文件執(zhí)行impdp導(dǎo)入時(shí)報(bào)錯(cuò)ORA-39142:版本號(hào)5.1 (在轉(zhuǎn)儲(chǔ)文件 "/tmp/DUMP1.DMP" 中)不兼容,如下所示:
[oracle@hisdb1 ~]$ impdp system/oracle_4U@192.168.133.160:1521/orcl directory=imp_dir dumpfile=DUMP1.DMP schemas=rmlis remap_tablespace=%:USERS cluster=n logfile=imprm.log
Import: Release 11.2.0.4.0 - Production on Tue Aug 9 22:36:53 2022
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-39142: incompatible version number 5.1 in dump file "/tmp/DUMP1.DMP"
異常原因:導(dǎo)致此錯(cuò)誤的原因?yàn)閛racle高版本導(dǎo)出,低版本導(dǎo)入造成.
解決方案:在源端加上version=版本號(hào)導(dǎo)出,如version=11.2
以下為MOS文檔相關(guān)信息:
Data Pump file version.
=======================
Version Written by Can be imported into Target:
Data Pump database with 10gR1 10gR2 11gR1 11gR2 12cR1 12cR2 18c 19c
Dumpfile Set compatibility 10.1.0.x 10.2.0.x 11.1.0.x 11.2.0.x 12.1.0.x 12.2.0.x 18.x.y.z 19.x.y.z
------------ --------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
0.1 10.1.x supported supported supported supported supported supported supported supported
1.1 10.2.x no supported supported supported supported supported supported supported
2.1 11.1.x no no supported supported supported supported supported supported
3.1 11.2.x no no no supported supported supported supported supported
4.1 12.1.x no no no no supported supported supported supported
5.1 12.2.x no no no no no supported supported supported
5.1 18.x.y no no no no no no supported supported
5.1 19.x.y no no no no no no no supported
比如:12.2導(dǎo)出的dmp文件版本位5.1,11.2的dmp版本位3.1,所以在導(dǎo)入時(shí)會(huì)出現(xiàn)ORA-39142:版本號(hào)5.1(在轉(zhuǎn)儲(chǔ)文件"/tmp/DUMP1.DMP"中)不兼容報(bào)錯(cuò)。
Export Use Export Data Pump parameter VERSION=...
From if dumpfile needs to be imported into a
Source Target Database with compatibility level
Database (value of init.ora/spfile parameter COMPATIBLE):
With
COMPATIBLE 10.1.0.x.y 10.2.0.x.y 11.1.0.x.y 11.2.0.x.y 12.1.0.x.y 12.2.0.x.y 18.x.y.z 19.x.y.z
---------- ------------- ------------- ------------- ------------- ------------- ------------- ------------ ------------
10.1.0.x.y - - - - - - - -
---------- ------------- ------------- ------------- ------------- ------------- ------------- ------------ ------------
10.2.0.x.y VERSION=10.1 - - - - - - -
---------- ------------- ------------- ------------- ------------- ------------- ------------- ------------ ------------
11.1.0.x.y VERSION=10.1 VERSION=10.2 - - - - - -
---------- ------------- ------------- ------------- ------------- ------------- ------------- ------------ ------------
11.2.0.x.y VERSION=10.1 VERSION=10.2 VERSION=11.1 - - - - -
---------- ------------- ------------- ------------- ------------- ------------- ------------- ------------ ------------
12.1.0.x.y VERSION=10.1 VERSION=10.2 VERSION=11.1 VERSION=11.2 - - - -
---------- ------------- ------------- ------------- ------------- ------------- ------------- ------------ ------------
12.2.0.x.y VERSION=10.1 VERSION=10.2 VERSION=11.1 VERSION=11.2 VERSION=12.1 - - -
---------- ------------- ------------- ------------- ------------- ------------- ------------- ------------ ------------
18.x.y.z VERSION=10.1 VERSION=10.2 VERSION=11.1 VERSION=11.2 VERSION=12.1 VERSION=12.2 - -
---------- ------------- ------------- ------------- ------------- ------------- ------------- ------------ ------------
19.x.y.z VERSION=10.1 VERSION=10.2 VERSION=11.1 VERSION=11.2 VERSION=12.1 VERSION=12.2 VERSION=18.x -
---------- ------------- ------------- ------------- ------------- ------------- ------------- ------------ ------------
所以12.2導(dǎo)出如果需要在11.2導(dǎo)入的話(huà),需要加入?yún)?shù)VERSION=11.2
[oracle@test ~]$ cat expdptest.sh
expdp sys/******@192.168.133.120:1521/orcl directory=expdpdir dumpfile=DUMP1.DMP logfile=expdp.log schemas=scott CLUSTER=N version=11.2
