ORA-02085: database link DBLINK_TEST connects to TESTDB

If parameter global_names =TRUE, the database link name has to match the remote database name.

Try to query a remote table through a database link:

SQL> select count(*) from testuser.test@dblink_test;
select count(*) from testuser.test@dblink_test;
*
ERROR at line 1:
ORA-02085: database link UDBLINK_TEST connects to TESTDB

REASON

Check database parameter global_names =TRUE. If parameter global_names =TRUE, the database link name has to match the remote database name( TESTDB).

WORKAROUND

Turn off  global_names in session level, then it should be ok.

SQL>alter session set global_names=false;
Session altered.

SQL>select count(*) from testuser.test@dblink_test;

 COUNT(*)
----------
       100