8 Replies Latest reply: Oct 5, 2012 4:25 PM by Prashant Dixit RSS

    Database Links: ORA-12154: TNS:could not resolve the connect identifier.

    Prashant Dixit
      Hi Folks,


      Today when tried creating Database Links i started recieving below provided error which says it failed to resolve the mentioned identifier.
      Here is what i was trying - I have two instances on the DB machine
      1. orcl
      2. doom

      --> And i want to connect with a user 'larry' available in orcl instance via another user 'Genie' exists in doom. So i created a Database Link in Doom through User Genie.
      Below are the steps that i performed.


      SQL> conn genie/oracle***
      Connected.

      SQL> show user
      USER is "GENIE"

      SQL> create database link larry1 connect to larry identified by ******* using 'larry1';

      Database link created.


      And this is what happened that i discussed above:
      SQL> select * from dual@larry1;
      select * from dual@larry1
      *
      ERROR at line 1:
      ORA-12154: TNS:could not resolve the connect identifier specified

      TNS entry seems fine to me, below provided is the entries made in tnsnames.ora
      # tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
      # Generated by Oracle configuration tools.

      DOOM =
      (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
      (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = doom)
      )
      )

      ASMDB =
      (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
      (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = asmdb)
      )
      )


      ORCL =
      (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
      (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
      )
      )

      EXTPROC_CONNECTION_DATA =
      (DESCRIPTION =
      (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      )
      (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
      )
      )


      Thanks
      Ant ...

      Edited by: Ant ... on Oct 6, 2012 1:11 AM