源库:RHEL 7.9+ORACLE 19.19.0.0.0
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Nov 16 14:17:38 2023
Version 19.19.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
BANNER_FULL
--------------------------------------------------------------------------------
BANNER_LEGACY
--------------------------------------------------------------------------------
CON_ID
----------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
0
BANNER
--------------------------------------------------------------------------------
BANNER_FULL
--------------------------------------------------------------------------------
BANNER_LEGACY
--------------------------------------------------------------------------------
CON_ID
----------
目标端:AIX 7.3+ORACLE 19.21.0.0.0
$ oslevel -s
7300-01-02-2320
$
$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Nov 16 14:22:07 2023
Version 19.21.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.21.0.0.0
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
BANNER_FULL
--------------------------------------------------------------------------------
BANNER_LEGACY
--------------------------------------------------------------------------------
CON_ID
----------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.21.0.0.0
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
0
BANNER
--------------------------------------------------------------------------------
BANNER_FULL
--------------------------------------------------------------------------------
BANNER_LEGACY
--------------------------------------------------------------------------------
CON_ID
----------
源端和目标端均为2节点RAC架构。
源端导出语句:
expdp \'/ as sysdba\' directory=dp dumpfile=hisdb_%U-`date +%Y%m%d-%H%M`.dmp logfile=expdp_hisdb-`date +%Y%m%d-%H%M`.log full=y COMPRESSION=ALL CLUSTER=N exclude=statistics parallel=4
由于是RAC架构,导出的时候加了cluster=n参数
目标端导入语句:
impdp \'/ as sysdba\' directory=dp dumpfile=hisdb_%U-20231115-0920.dmp logfile=impdp_hisdb-`date +%Y%m%d-%H%M`.log full=y parallel=4 table_exists_action=replace
导入出现报错:
ORA-39155: error expanding dump file name "/oradump/hisdb_03-20231115-0920.dmp"
ORA-48128: opening of a symbolic link is disallowed
ORA-19505: failed to identify file "/oradump/hisdb_03-20231115-0920.dmp"
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
先检查dmp文件权限:
$ ls -lrt *.dmp
-rwxrwxrwx 1 oracle asmadmin 354300715008 Nov 16 13:00 hisdb_01-20231115-0920.dmp
-rwxrwxrwx 1 oracle asmadmin 176420581376 Nov 16 13:11 hisdb_02-20231115-0920.dmp
-rwxrwxrwx 1 oracle asmadmin 143339905024 Nov 16 13:21 hisdb_03-20231115-0920.dmp
-rwxrwxrwx 1 oracle asmadmin 205399072768 Nov 16 13:35 hisdb_04-20231115-0920.dmp
文件权限给了777,属组等都没问题。
其实问题处理很简单,导入语句加入cluster=n参数即可,调整导入语句:
impdp \'/ as sysdba\' directory=dp dumpfile=hisdb_%U-20231115-0920.dmp logfile=impdp_hisdb-`date +%Y%m%d-%H%M`.log full=y parallel=4 table_exists_action=replace cluster=n
重新导入,问题解决