Tuesday, November 5, 2013

ORA-12154: TNS: could not resolve the connect identifier specified


##########################
## Error
##########################

ORA-12154: TNS: could not resolve the connect  identifier specified

### Full Error

Mon Nov 04 21:01:00 2013
Error 12154 received logging on to the standby

##########################
#  Error Occurred
##########################

Error occured while Primary database is trying to connect to a standby database for transfering archive logs in 11.2.0.3.0 version

##########################
## Command Executed
##########################

Primary trying to transfer Archive logs to Standby

##########################
## Issue Description / Troubleshooting
##########################

### 11.2.0.3.0

#########################################
# 1) Check Whether archive destination is showing any errors
#########################################

set lines 200
col dest_name for a20
col destination for a50
col error for a15
col db_unique_name for a15
col name for a100

select dest_id,dest_name,target,name_space,destination,status,error,db_unique_name from v$archive_dest where destination is not null;

   DEST_ID DEST_NAME            TARGET  NAME_SP DESTINATION                                        STATUS    ERROR           DB_UNIQUE_NAME
---------- -------------------- ------- ------- -------------------------------------------------- --------- --------------- ---------------
         1 LOG_ARCHIVE_DEST_1   PRIMARY SYSTEM  USE_DB_RECOVERY_FILE_DEST                          VALID                     NONE
         2 LOG_ARCHIVE_DEST_2   STANDBY SYSTEM  oralin_stdby                                        ERROR     ORA-12154:      oralin_stdby
                                                                                                             TNS:could not
                                                                                                             resolve the
                                                                                                             connect
                                                                                                             identifier
                                                                                                             specified

#########################################
# 2) TNS Names Used to Connect
#########################################


oralin_stdby.example.com =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = kstdbylorap08)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = oralin_stdby.example.com)
    )
  )

#########################################
# 3) Check Service & Domain parameters
#########################################

In standby :

SQL> sho parameter servi

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      oralin_stdby
db_domain                            string

##########################
## Solution
##########################

From Troubleshooting 2) output, we can see from TNSNAMES that service name is oralin_stdby and Domain is example.com

From Troubleshooting 2) output, Service name is correct but there is no domain set at the database level.

So the problem is with the domain name. I have removed Domain (example.com) from TNSNAMES and the connection to database was successful.

Modified TNSNAMES :


oralin_stdby.example.com =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = kstdbylorap08)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = oralin_stdby)
    )
  )

No comments: