Search This Blog

Monday, November 9, 2020

ORA-02019: connection description for remote database not found

 My database name is: VTXDS


SQL> select name from v$database;


NAME

---------

VTXDS


SQL>


--Now try to create database link via vertex user.


SQL> create database link VTXDEV9 connect to vertex identified by vertex using 'VTXDEV9';


Database link created.


SQL>


--Succeed, now let`s check.


SQL> select * from dual@VTXDEV9LINK;

select * from dual@VTXDEV9LINK

                   *

ERROR at line 1:

ORA-02085: database link VTXDEV9LINK.DBDOMAIN connects to

VTXDEV9.DBDOMAIN


After checking Meta Link sources - identified

ORA-02085:

database link string connects to string

Cause:

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

Action:

create a database link with the same name as the database the database it connects to, or set global_names=false. 

Global_names parameter indeed true on my database, lets change it.

SQL> show parameter global_name

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

global_names                         boolean     TRUE

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

System altered.

SQL> show parameter global_name

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

global_names                         boolean     FALSE

Drop database link which created before.

SQL> drop database link VTXDEV9LINK;

Database link dropped.

SQL> create database link VTXDEV9LINK connect to vertex identified by vertex using 'VTXDEV9';

Database link created.

SQL> select * from dual@VTXDEV9;

D

-

X


Success !

TRy from VTXDEV9 DB 

What else if global_names`s TRUE and I try to create db link with same same of SID ?

SQL> create database link VTXDSLINK connect to vertex identified by vertex using 'VTXDS';

create database link VTXDSLINK connect to vertex identified by vertex using 'VTXDS'

                          *

ERROR at line 1:

ORA-02082: a loopback database link must have a connection qualifier



To prevent this kind of error rename global name.



SQL> select * from global_name;

GLOBAL_NAME

--------------------------------------------------------------------------------

VTXDS.DBDOMAIN

SQL> alter database rename global_name to VTXDEV9.DBDOMAIN;

Database altered.

SQL> create database link VTXDSLINK connect to vertex identified by vertex using 'VTXDS';

Database link created.

DB link created, but does not work.



SQL> select * from dual@VTXDSLINK;

select * from dual@VTXDSLINK

                   *

ERROR at line 1:

ORA-02085: database link VTXDSLINK.DBDOMAIN connects to VTXDS.DBDOMAIN

Now update global_name`s again and check db link.

SQL> alter database rename global_name to VTXDS;

Database altered.

SQL> select * from dual@VTXDS;

D

-

X


Alter Database Rename GLOBAL_NAME Without Specify DB_DOMAIN (Doc ID 155093.1)

How to Rename Database/Change DB_NAME or ORACLE_SID/Instance Name (Doc ID 15390.1)

No comments:

Post a Comment

Transportable tablespace refresh

  1.check tablespace for the user which need to refresh -------------------------------------------------------------------  SQL> select ...