Error:

ORA-02085: database link SOURCE_LINK connects to SOURCE_DATABASE

Cause:

a database link connected to a database with a different name. The connection is rejected.

Solution:

I checked the GLOBAL_NAMES.

SQL> show parameter global_names

NAME         TYPE  VALUE
------------------------------------ ----------- ------------------------------
global_names        boolean  TRUE

Global_names was set to TRUE which is not necessarily required in this database. Therefore, I changed the setting into FALSE like this:

SQL> alter system set global_names=FALSE scope=both;

System altered.

SQL> show parameter global_names

NAME         TYPE  VALUE
------------------------------------ ----------- ------------------------------
global_names        boolean  FALSE

I dropped then created it again.

SQL> drop database link source_link;

Database link dropped.

SQL> create database link SOURCE_LINK connect to hr identified by password using 'SOURCE_DATABASE';

Database link created.

Tried to test the new database link again.

SQL> select sysdate from dual@source_link;

SYSDATE
---------
29-NOV-21

Recent Posts

Start typing and press Enter to search