Switchover Failed With ORA-12521 using Dataguard Broker (Doc ID 1380949.1)

Last updated on OCTOBER 12, 2016

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.1 to 12.1.0.2 [Release 11.2 to 12.1]
Information in this document applies to any platform.
***Checked for relevance on 06-May-2013***
*** Reviewed for Relevance 16-Jul-2015 ***

Symptoms

Primary Database:  sgnpdih2
Standby Database: sgnpdih2dg

Performing a switchover operation in a DataGuard environment requires a shutdown of both the (former) primary database and the (former) standby database.

The automatic restart of the databases fails with below error

ORA-12521: TNS:listener does not currently know of instance requested in connect descriptor

DGMGRL> switchover to sgnpdih2;
Performing switchover NOW, please wait...
New primary database "sgnpdih2" is opening...
Operation requires shutdown of instance "sgnpdih2" on database "sgnpdih2dg"
Shutting down instance "sgnpdih2"...
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "sgnpdih2" on database "sgnpdih2dg"
Starting instance "sgnpdih2"...
Unable to connect to database
ORA-12521: TNS:listener does not currently know of instance 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 "sgnpdih2" of database "sgnpdih2dg"

Changes

While performing switchover, in broker the value for instance_name is sgnpdih2dg for StaticConnectIdentifier parameter on standby database (sgnpdih2dg) which is not set correctly for service "sgnpdih2dg_DGMGRL".

Whereas in listener status it shows the registered instance name for service "sgnpdih2dg_DGMGRL" is sgnpdih2.


Standby Host:

DGMGRL> show database verbose sgnpdih2dg

HostName = 'asiarihub2'
SidName = 'sgnpdih2'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=asiarihub2.sing.seagate.com)(PORT=1527))(CONNECT_DATA=(SERVICE_NAME=sgnpdih2dg_DGMGRL)(INSTANCE_NAME=sgnpdih2dg)(SERVER=DEDICATED)))'


oracle@asiarihub2:/home/oracle/scripts# lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 25-NOV-2011 14:22:15

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=asiarihub2.sing.seagate.com)(PORT=1527)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 24-NOV-2011 15:36:43
Uptime 0 days 22 hr. 45 min. 31 sec
........
........
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=asiarihub2.sing.seagate.com)(PORT=1527)))
Services Summary...
Service "sgnpdih2" has 1 instance(s).
Instance "sgnpdih2", status UNKNOWN, has 1 handler(s) for this service...
Service "sgnpdih2dg" has 1 instance(s).
Instance "sgnpdih2dg", status READY, has 1 handler(s) for this service...
Service "sgnpdih2dg_DGB" has 1 instance(s).
Instance "sgnpdih2dg", status READY, has 1 handler(s) for this service...
Service "sgnpdih2dg_DGMGRL" has 1 instance(s).
Instance "sgnpdih2", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully



Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms