RMAN-00554: initialization of internal recovery manager package failed – RMAN-04006: error from auxiliary database: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

When you get this kind of error, first of all dont panic or rush to get a solution. Because tns errors and listener errors are simple errors where we mistakenly configure network files like tnsnames.ora and listener.ora .. Cool!

So follow a sequence to troubleshoot this kind of error

Things to check before drill down

Below is a right tns entry

#Primary tns entry
ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.202)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

#Standby tns entry
ORCLDGP =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.123)(PORT = 1526))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcldgp)(UR=A)
    )
  )

Static listener entry should be used in case of dataguard. Whether the database is up or not ,the listener is registered with the instance. Check for below entry in your listener.ora file

SID_LIST_LISTENER =
   (SID_LIST =
     (SID_DESC =
       (GLOBAL_DBNAME = orcldgp)
       (ORACLE_HOME = /oracle/base/product/12.1.0/dbhome_1)
       (SID_NAME = orcldgp)
     )
  )

These silly mistakes we might have done. So hold your eyeball and observe these parameters keenly

Check if you give the correct port name on both source and destination when you connect auxiliary instance for dataguard configuration. By default the listener port number is 1521. But if there are multiple listeners on host, then we need to specify different ports. So check for proper ports

Check both tnsnames.ora files from primary and standby databases for standby network entry. It should contain (UR=A)

The above two mistakes can be rectified by doing a tnsping from primary to standby . In the below output, the port number and service name are wrong which points to different instance. Beware of these silly errors

[oracle@orcl ~]$ tnsping orcldgp

TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 17-JUN-2021 18:42:47

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

Used parameter files:
/oracle/base/product/12.1.0/dbhome_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.123)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcldg)(UR = A)))
OK (0 msec)

Check if your host has multiple listeners running and conflict the connections across different instances. Here there are two listeners running. One from grid home and another from rdbms home. Verify the configurations on both homes for tnsnames.ora and listener.ora files

[oracle@orcldg ~]$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 18-JUN-2021 00:31:43

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                18-JUN-2021 00:02:40
Uptime                    0 days 0 hr. 29 min. 3 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/base/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File         /oracle/base/diag/tnslsnr/orcldg/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcldg)(PORT=1521)))
Services Summary...
Service "orcldgp" has 1 instance(s).
  Instance "orcldgp", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

=====================================================================================

[grid@orcldg ~]$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 18-JUN-2021 00:32:20

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                18-JUN-2021 00:32:15
Uptime                    0 days 0 hr. 0 min. 4 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /grid/base/product/12.1.0/grid/network/admin/listener.ora
Listener Log File         /grid/base/diag/tnslsnr/orcldg/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
Services Summary...
Service "ORCLDG" has 1 instance(s).
  Instance "orcldg", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

Check if you have local listener configured in your instance

SQL> show parameter local_listener

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
local_listener                       string       (ADDRESS=(PROTOCOL=TCP)(HOST=
                                                 192.168.56.123)(PORT=1521))

Check and make sure the listener status is “Unknown” and not “Blocked” statusa and check port number

[oracle@orcldg ~]$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 18-JUN-2021 22:39:19

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     listener
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                18-JUN-2021 22:38:07
Uptime                    0 days 0 hr. 1 min. 13 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/base/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File         /oracle/base/diag/tnslsnr/orcldg/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcldg)(PORT=1521)))
Services Summary...
Service "orcldgp" has 2 instance(s).
  Instance "orcldgp", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

As there is a mismatch in port number , we get TNS-12541: TNS:no listener from primary database

[oracle@orcl ~]$ tnsping orcldgp

TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 18-JUN-2021 17:21:53

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

Used parameter files:
/oracle/base/product/12.1.0/dbhome_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.123)(PORT = 1526)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcldgp)(UR = A)))
TNS-12541: TNS:no listener

If i try connect to auxiliary , i get an error

[oracle@orcl ~]$ rman target sys/password auxiliary sys/password@orcldgp

Recovery Manager: Release 12.1.0.2.0 - Production on Fri Jun 18 17:19:01 2021

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

connected to target database: ORCL (DBID=1559282684)
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04006: error from auxiliary database: ORA-12541: TNS:no listener

So we set proper port for local listener parameter with 1526 as the listener is secondary

SQL> alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.123)(PORT=1526))';

System altered.

Post that reload the listener and check if listener use 1526 port

[oracle@orcldg ~]$ lsnrctl reload

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 18-JUN-2021 23:13:53

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
The command completed successfully

If you still see no change in listener port , then go to next step

[oracle@orcldg ~]$ cd /oracle/base/product/12.1.0/dbhome_1/network/admin/
[oracle@orcldg admin]$ ls
listener.ora  samples  shrept.lst  tnsnames2106092PM4606.bak  tnsnames.ora

Perform an observation by moving the existing “tnsnames.ora” file to a backup file

[oracle@orcldg admin]$ mv tnsnames.ora tnsnames.ora.bkp

Still listener is not using specified tnsnames file

[oracle@orcldg admin]$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 18-JUN-2021 23:34:25

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcldg)(PORT=1521)))
Services Summary...
Service "orcldgp" has 1 instance(s).
  Instance "orcldgp", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

If none of them work, then you would have to recreate the listener from scratch. Make sure that you dedicate the connections to a new listener and recreate the old listener

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s