2 Replies Latest reply: Jan 5, 2014 6:36 AM by fb767351-a660-4b18-9a9f-73bc141f6a0c RSS

    RMAN-00554, RMAN-04005, ORA-12154: TNS:could not resolve the connect identifier specified

    fb767351-a660-4b18-9a9f-73bc141f6a0c

      Hi Gurus,

       

      I need your help!

      I am implementing dataguard through RMAN, where my primary database is mydb and my standby database is orcl. I am pasting step by step process and atlast the error message which I am getting. Please do help me to resolve it.

       

      [oracle@localhost ~]$ . oraenv

      ORACLE_SID = [orcl] ? mydb

      The Oracle base for ORACLE_HOME=/u01/home/oracle/product/11.2.0/db_1 is /u01/app/oracle

      [oracle@localhost ~]$ sqlplus / as sysdba

       

      SQL*Plus: Release 11.2.0.1.0 Production on Sun Jan 5 09:24:56 2014

       

      Copyright (c) 1982, 2009, Oracle.  All rights reserved.

       

      Connected to:

      Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

      With the Partitioning, OLAP, Data Mining and Real Application Testing options

       

      SQL> select db_unique_name, database_role, open_mode from v$database;

       

      DB_UNIQUE_NAME                 DATABASE_ROLE    OPEN_MODE

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

      mydb_un                        PRIMARY          READ WRITE

       

      SQL> show parameter instance_name

       

      NAME                                 TYPE        VALUE

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

      instance_name                        string      mydb

      SQL> show parameter service_names

       

      NAME                                 TYPE        VALUE

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

      service_names                        string      mydb_un

       

      SQL> !

      [oracle@localhost ~]$ . oraenv

      ORACLE_SID = [oracle] ? orcl

      ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/11.2.0/dbhome_1

      The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 is /u01/app/oracle

      [oracle@localhost ~]$ sqlplus / as sysdba


      SQL*Plus: Release 11.2.0.1.0 Production on Sun Jan 5 09:20:04 2014

       

      Copyright (c) 1982, 2009, Oracle.  All rights reserved.

       

      Connected to:

      Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

      With the Partitioning, OLAP, Data Mining and Real Application Testing options

       

      SQL> select host_name, status from v$instance;

       

      HOST_NAME                                                        STATUS

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

      localhost.localdomain                                            STARTED

       

      SQL> show parameter instance_name

       

      NAME                                 TYPE        VALUE

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

      instance_name                        string      orcl

      SQL> show parameter service_names

       

      NAME                                 TYPE        VALUE

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

      service_names                        string      orcl_un

       

      SQL> !

      [oracle@localhost ~]$ lsnrctl status

       

      LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 05-JAN-2014 09:27:44


      Copyright (c) 1991, 2009, Oracle.  All rights reserved.


      Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

      TNS-12541: TNS:no listener

      TNS-12560: TNS:protocol adapter error

        TNS-00511: No listener

         Linux Error: 2: No such file or directory

      Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))

      STATUS of the LISTENER

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

      Alias                     LISTENER

      Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production

      Start Date                05-JAN-2014 08:17:31

      Uptime                    0 days 1 hr. 10 min. 15 sec

      Trace Level               off

      Security                  ON: Local OS Authentication

      SNMP                      OFF

      Listener Log File         /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml

      Listening Endpoints Summary...

        (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))

      Services Summary...

      Service "mydbXDB" has 1 instance(s).

        Instance "mydb", status READY, has 1 handler(s) for this service...

      Service "mydb_un" has 1 instance(s).

        Instance "mydb", status READY, has 1 handler(s) for this service...

      Service "orcl_un" has 1 instance(s).

        Instance "orcl", status BLOCKED, has 1 handler(s) for this service...

      The command completed successfully

       

      [oracle@localhost ~]$ tnsping mydb

       

      TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 05-JAN-2014 09:27:54

       

      Copyright (c) 1997, 2009, Oracle.  All rights reserved.

       

      Used parameter files:

      /u01/home/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora

       

      Used TNSNAMES adapter to resolve the alias

      Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = mydb_un)))

      OK (0 msec)

      [oracle@localhost ~]$ tnsping orcl

       

      TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 05-JAN-2014 09:28:03

       

      Copyright (c) 1997, 2009, Oracle.  All rights reserved.

       

      Used parameter files:

      /u01/home/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora

       

      Used TNSNAMES adapter to resolve the alias

      Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl_un)))

      OK (0 msec)



      [oracle@localhost admin]$ more listener.ora

      # listener.ora Network Configuration File: /u01/home/oracle/product/11.2.0/db_1/network/admin/listener.ora

      # Generated by Oracle configuration tools.


      LISTENER =

        (DESCRIPTION_LIST =

          (DESCRIPTION =

            (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

            (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

          )

        )

      SID_LIST_LISTENER =

        (SID_LIST =

          (SID_DESC =

            (GLOBAL_DBNAME = mydb_un)

            (ORACLE_HOME = /u01/home/oracle/product/11.2.0/db_1)

            (SID_NAME=mydb)

         )

          (SID_DESC =

            (GLOBAL_DBNAME = orcl_un)

            (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)

            (SID_NAME = orcl)

       

          )

      )

      ADR_BASE_LISTENER = /u01/app/oracle

       

       

      [oracle@localhost admin]$ more tnsnames.ora

      # tnsnames.ora Network Configuration File: /u01/home/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora

      # Generated by Oracle configuration tools.


      MYDB =

        (DESCRIPTION =

          (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

          (CONNECT_DATA =

            (SERVER = DEDICATED)

            (SERVICE_NAME = mydb_un)

          )

        )

      ORCL =

        (DESCRIPTION =

          (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

          (CONNECT_DATA =

            (SERVER = DEDICATED)

            (SERVICE_NAME = orcl_un)

          )

        )

       

      [oracle@localhost ~]$ rman target sys/engineer@mydb auxiliary sys/engineer@orcl


      Recovery Manager: Release 11.2.0.1.0 - Production on Sun Jan 5 09:30:59 2014


      Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

       

      RMAN-00571: ===========================================================

      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

      RMAN-00571: ===========================================================

      RMAN-00554: initialization of internal recovery manager package failed

      RMAN-04005: error from target database:

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

      [oracle@localhost ~]$

       

       

       

      Please let me know why I am getting this error if everything is fine above.

       

       

      Regards,

      Michel

        • 1. Re: RMAN-00554, RMAN-04005, ORA-12154: TNS:could not resolve the connect identifier specified
          mseberg

          Here's your issue

           

          (HOST=localhost.localdomain)

           

          If you are going to use "localhost" at least fake it by adding an entry in your /etc/hosts files

           

          Example ( add to both servers so they can see each other )

           

          192.168.0.20               primary.localdomain   primary

          192.168.0.21               standby.localdomain   standby

           

          Does the "hostname" return localhost.localdomain? Setup something so RMAN has something to connect to.

           

          The "/etc/hosts" file must contain a fully qualified name for the server.


          <IP-address> <fully-qualified-machine-name> <machine-name>


          localhost.localdomain is 127.0.0.1, you don't want that.

           

          Best Regards

           

          mseberg

          • 2. Re: RMAN-00554, RMAN-04005, ORA-12154: TNS:could not resolve the connect identifier specified
            fb767351-a660-4b18-9a9f-73bc141f6a0c

            Hi Mseberg,

             

            This problem is just now resolved. What the problem was I did not have tns and listener files in my standby home location. I created it manually and able to create standby database through RMAN duplicate command. Please below:

             

            [oracle@localhost ~]$ rman target sys/oracle_4U@mydb auxiliary sys/oracle_4U@orcl

             

            Recovery Manager: Release 11.2.0.1.0 - Production on Sun Jan 5 10:17:45 2014

             

            Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.


            connected to target database: MYDB (DBID=2749764066)

            connected to auxiliary database: ORCL (not mounted)

            RMAN>