When trying to configure data guard broker I’m getting Error: ORA – 12154 : TNS: could not resolve the connect identifier specified

dataguardlisteneroracle-11g-r2tnsnames

I'm trying to setup data guard broker in my production instance. I have duplicated the primary database to standby database successfully. I've added primary database to data broker configuration and when I'm trying to add standby database following error is getting

DGMGRL> ADD DATABASE 'orcl_standby' AS CONNECT IDENTIFIER IS orcl_standby maintained as physical;
ERROR: ORA - 12154 : TNS: could not resolve the connect identifier specified

Tnsping from primary db to standby db and vice-versa is successful. I'm able to connect primary db from standby db using sqlplus sys/password@orcl as sysdba but when trying to connect to standby db from primary db, error is getting like

ORA – 12154 : TNS: could not resolve the connect identifier specified.

Tried out all possible solutions.

Below is my tnsnames.ora file

    ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.25.42)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
      (SID = orcl)
      (UR = A)
    )
  )

ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORCL_STANDBY=
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.25.44)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl_standby)
      (SID = orcl_standby)
      (UR = A)
    )
  )      

Any help will be appreciated

Best Answer

The part after IDENTIFIER IS must be a connection to the database. You should replace the orcl_standby with something like '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp) (HOST=<server of the Standby>)(PORT=1521)))(CONNECT_DATA=(SID=<the SID of the Standby>)(SERVER=DEDICATED)))'.