Friday, May 8, 2020

12c PDB or Multitenant Only: ORA-02085: Database Link "LINK_NAME_HERE" Connects To "TARGET_DB" (Doc ID 2344831.1) To BottomTo Bottom



APPLIES TO:

Oracle Net Services - Version 12.1.0.2 and later
Information in this document applies to any platform.
This problem is limited in scope to the use of a DBLINK in a PDB or multitenant database in version 12.1.0.x.

SYMPTOMS

A database link that is created in a PDB where GLOBAL_NAMES=false can incorrectly throw
this error.  This is true even when a check of GLOBAL_NAMES in the PDB reveals it is set
to false.

While logged in to the PDB and select across the link yields:
select * from dual@linkname;
ORA-2085: database link %s connects to %s

The error is only thrown when the GLOBAL_NAMES parameter at the origin or source database is set to TRUE
and the following condition is met:
The origin or source database link name does NOT match the target
database DB_NAME.DB_DOMAIN or the value of the GLOBAL_NAME table.

See the following document for an explanation of this error and the relationship between GLOBAL_NAMES and a dblink.
Note: 210630.1 Database Links: Troubleshooting ORA-2085: database link %s connects to %s

A check of the CDB reveals that GLOBAL_NAMES is set to true.
A check of the PDB reveals that GLOBAL_NAMES is set to false.



CHANGES

This problem may arise suddenly if the CDB has been restarted.
Again, no apparent changes have occurred and this established dblink has been working
for some time.

This is not an issue that arises during a dblink creation.

CAUSE

This is a defect that impacts the 12.1.0.2 version of the PDB.
See the following published BUG:

Bug: 22267060 ORA-2085 IS RAISED EVEN SETTING GLOBAL_NAMES=FALSE

The problem might arise after the CDB is restarted.
Check show parameter at the CDB and you will see it is set to TRUE.
Check show parameter at the PDB and you will see it is set to FALSE.
However, the TRUE setting is being enforced at the PDB due to this defect.

SOLUTION

Simply re-issuing the alter system set command to set GLOBAL_NAMES to false at the PDB will allow the link to work.

PDB>alter system set GLOBAL_NAMES=false;

Now dblink works.

No comments:

Post a Comment