Monday, July 14, 2014

DGMGRL Switchover and ORA-12514: TNS:listener does not currently know of service requested in connect descriptor


1.dgmgrl switchover fails with "ORA-12514: TNS:listener does not currently know of service requested in connect descriptor"
DGMGRL> switchover to 'orcl_uk';
Performing switchover NOW, please wait...
Operation requires shutdown of instance "orcl2" on database "orcl_in"
Shutting down instance "orcl2"...
Database closed.
Database dismounted.
ORACLE instance shut down.
New primary database "orcl_uk" is opening...
Operation requires shutdown of instance "orcl1" on database "orcl_in"
Shutting down instance "orcl1"...
ORACLE instance shut down.
Operation requires startup of instance "orcl1" on database "orcl_in"
Starting instance "orcl1"...
Unable to connect to database
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

Failed.
Warning: You are no longer connected to ORACLE.

Please complete the following steps to finish switchover:
        start up and mount instance "orcl1" of database "orcl_in"

DGMGRL>


2.Alter log file of the new primary database recorded with the below error message "Heartbeat failed to connect to standby 'orcl'. Error is 1034."
orcl_uk aler log:
===============
Error Message
=============
Fatal NI connect error 12514, connecting to:
 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ol6-112-rac1-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=ol6-112-rac2-vip)(PORT=1521))(LOAD_BALANCE=ON)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl_in_DGB)(CID=(PROGRAM=oracle)(HOST=ol6-112-rac2.localdomain)(USER=oracle))))

  VERSION INFORMATION:
        TNS for Linux: Version 11.2.0.3.0 - Production
        TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production
  Time: 12-JUL-2014 20:57:45
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12564

TNS-12564: TNS:connection refused
    ns secondary err code: 0
    nt main err code: 0
    nt secondary err code: 0
    nt OS err code: 0


***********************************************************************

Fatal NI connect error 12514, connecting to:
 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ol6-112-rac1-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=ol6-112-rac2-vip)(PORT=1521))(LOAD_BALANCE=ON)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl_in_DGB)(CID=(PROGRAM=oracle)(HOST=ol6-112-rac2.localdomain)(USER=oracle))))

  VERSION INFORMATION:
        TNS for Linux: Version 11.2.0.3.0 - Production
        TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production
  Time: 12-JUL-2014 20:57:45
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12564

TNS-12564: TNS:connection refused
    ns secondary err code: 0
    nt main err code: 0
    nt secondary err code: 0
    nt OS err code: 0
Sat Jul 12 20:57:47 2014
Error 1034 received logging on to the standby
PING[ARC2]: Heartbeat failed to connect to standby 'orcl'. Error is 1034.

3.Check the old primary database listener status and identified the service name for the old primary database is not in proper format (db_unique_name)_DGMGRL. It should be ORCL_IN_DGMGRL instead of ORCL_INK_DGMGRL
istener status for orcl
[oracle@ol6-112-rac1 admin]$ lsnrctl status listener

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 12-JUL-2014 21:54:35

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     listener
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                11-JUL-2014 22:54:28
Uptime                    0 days 23 hr. 0 min. 21 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/11.2.0/grid/app/11.2.0.3/grid_1/network/admin/listener.ora
Listener Log File         /u01/app/11.2.0/grid_base/diag/tnslsnr/ol6-112-rac1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.111)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.113)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "ORCL_IN" has 2 instance(s).
  Instance "orcl1", status UNKNOWN, has 1 handler(s) for this service...
  Instance "orcl1", status READY, has 1 handler(s) for this service...
Service "ORCL_INK_DGMGRL" has 1 instance(s).
  Instance "orcl1", status UNKNOWN, has 1 handler(s) for this service...
Service "ORCL_IN_DGB" has 1 instance(s).
  Instance "orcl1", status READY, has 1 handler(s) for this service...


4.Change the service_name in the listener.ora file and reload the listener and check the status of listener again
[grid@ol6-112-rac1 admin]$ lsnrctl status listener

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 12-JUL-2014 22:07:24

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     listener
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                11-JUL-2014 22:54:28
Uptime                    0 days 23 hr. 13 min. 5 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/11.2.0/grid/app/11.2.0.3/grid_1/network/admin/listener.ora
Listener Log File         /u01/app/11.2.0/grid_base/diag/tnslsnr/ol6-112-rac1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
Services Summary...
Service "ORCL_IN" has 1 instance(s).
  Instance "orcl1", status UNKNOWN, has 1 handler(s) for this service...
Service "ORCL_IN_DGMGRL" has 1 instance(s).
  Instance "orcl1", status UNKNOWN, has 1 handler(s) for this 

5.Switchback the database to original primary and switchover to standby once again to check the switchover it without any issues
[oracle@ol6-112-rac1 admin]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production

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

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/sys123@crman1
Connected.
DGMGRL>
DGMGRL>
DGMGRL>
DGMGRL> switchover to "orcl_uk";
Performing switchover NOW, please wait...
Operation requires shutdown of instance "orcl2" on database "orcl_in"
Shutting down instance "orcl2"...
Database closed.
Database dismounted.
ORACLE instance shut down.
New primary database "orcl_uk" is opening...
Operation requires shutdown of instance "orcl1" on database "orcl_in"
Shutting down instance "orcl1"...
ORACLE instance shut down.
Operation requires startup of instance "orcl1" on database "orcl_in"
Starting instance "orcl1"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "orcl_uk"

No comments: