Wednesday, 15 March 2017

ORA-12545: Connect failed because target host or object does not exist

ORA-12545: Connect failed because target host or object does not exist 


If the protocol is TCP/IP, edit the TNSNAMES.ORA file to change the host name to a numeric IP address and try again.

or 

use ip address instead host name while creating the db link

create  database link my_db_link
  connect to user1 IDENTIFIED BY "password1"
  using '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =10.11.12.200)(PORT = 1521)) ) (CONNECT_DATA = (SID = ABC_TEST) (SERVER = DEDICATED) ) ) ';
 


create  database link link my_db_link  
connect to user1 IDENTIFIED BY "password1"
  using '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =oraserver.abc.com)(PORT = 1521)) ) (CONNECT_DATA = (SID =
ABC_TEST) (SERVER = DEDICATED) ) ) ';


If still not working then get the GLOBAL name from the source db and use the name for DBLINK name


Ex:
SELECT * FROM GLOBAL_NAME;
TEST_SCHEMA

in this case


create  database link TEST_SCHEMA
  connect to user1 IDENTIFIED BY "password1"
  using '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =10.11.12.200)(PORT = 1521)) ) (CONNECT_DATA = (SID = ABC_TEST) (SERVER = DEDICATED) ) ) ';

 
 

No comments:

Post a Comment