问题描述:运用DBLINK与数据泵导数据时报错ORA-39006、ORA-39113、PLS-00352、PLS-00201、ORA-39097,如下所示:
数据库:源端 oracle 12.2.0.1 目标端:oracle 12.2.0.1
1、问题重现
[oracle@hisdb1 scripts]$ tail -500f nohup.out 

Import: Release 12.2.0.1.0 - Production on Fri Sep 6 13:28:48 2024

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

Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
ORA-39006: internal error
ORA-39113: Unable to determine database version
ORA-06550: line 1, column 7:
PLS-00352: Unable to access another database 'CRMBCV_16510'
ORA-06550: line 1, column 7:
PLS-00201: identifier 'SYS@CRMBCV_16510' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

ORA-39097: Data Pump job encountered unexpected error -6550

2、问题分析
经网上查询资料了解到,造成此异常存在如下原因:
a、dblink必须为public,参考ORA-39113 When Running A DataPump Job Through NETWORK_LINK (Doc ID 2100177.1)
b、dblink需确保正确性
c、GLOBAL_NAMES需设置为false,参考:ORA-39113 When Running A DataPump Job Through NETWORK_LINK (Doc ID 2100177.1)
d、导入用户权限不足
e、版本跨度太大

说明:该场景中可以排除a、c、d、e的可能性,重点查看dblink的正确性.查导入脚本中发现network_link名写错,原本应该是CRMBCV16510_LINK,却被写成CRMBCV_16510.

--错误脚本内容
#!/bin/bash
source ~/.bash_profile
impdp LEO/Uitf#7920@192.168.133.110:1521/tmis \
network_link=CRMBCV_16510 \
remap_schema=scott:LEO \
tables=scott.scriber,scott.employer,scott.group_employer,scott.group_scriber \
REMAP_TABLESPACE=%:D_CUST_03 \
directory=impdp_dir \
table_exists_action=replace \
parallel=16 \
job_name=impdp#LEO#.job \
logfile=impdp#LEO.out

3、解决方案
--按如下所示修改network_link参数.
#!/bin/bash
source ~/.bash_profile
impdp LEO/Uitf#7920@192.168.133.110:1521/tmis \
network_link=CRMBCV16510_LINK \
remap_schema=scott:LEO \
tables=scott.scriber,scott.employer,scott.group_employer,scott.group_scriber \
REMAP_TABLESPACE=%:D_CUST_03 \
directory=impdp_dir \
table_exists_action=replace \
parallel=16 \
job_name=impdp#LEO#.job \
logfile=impdp#LEO.out

说明:network_link成功修改后,异常未在发生.

参考网址:https://www.dbaup.com/ora-39113-unable-to-determine-database-version.html