Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 E-mail Us
 Oracle Articles
New Oracle Articles

 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 







Data Guard switchover with dgmgrl

Oracle Database Tips by Donald BurlesonMarch 11, 2015

Question:  I want to use the switchover command with dgmgrl to switch over to my Data Guard Standby database.  How to I configure my tnsnames with failover for Data Guard switchover dgmgrl command?

db1 =
     (FAILOVER = ON)
       (ADDRESS = (PROTOCOL = TCP)(HOST = host1(PORT = 1521))
       (ADDRESS = (PROTOCOL = TCP)(HOST = host2)(PORT = 1521)

Answer:  For complete details on doing a Data Guard switchover, see the book "Oracle Data Guard" by Bipul Kumar.  There are many examples, and Ritesh Chhajer offers this example of doing a Data Guard switchover using dgmgrl:

1. Ensure SPFILE is used

SQL> sho parameter spfile

2. Verify dmon process is running and broker parameters viz. DG_BROKER_START is set to TRUE and DG_BROKER_CONFIG_FILEn are set correctly

SQL> sho parameter broker
$ps -ef|grep dmon|grep -v grep

3. Check if LOCAL_LISTENER is set(This is needed only if you are non-default port other than 1521)

DGMGRL> show instance 'TESTPRIR1' 'LocalListenerAddress';

4. Verify if GLOBAL_DBNAME in listener.ora is set correctly to

Example listener.ora:

    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /apps/oracle/product/10g/db)
      (PROGRAM = extproc)
    (SID_DESC =
      (ORACLE_HOME = /apps/oracle/product/10g/db)

Note: In the above case, db_domain was null.

5. Verify if START_OPTIONS is set to MOUNT in the OCR

$ srvctl config database -d TESTPRI -a
testprir1 TESTPRIR1 /apps/oracle/product/10g/db
testprir2 TESTPRIR2 /apps/oracle/product/10g/db
DB_NAME: null
ORACLE_HOME: /apps/oracle/product/10g/db
SPFILE: /n01/oradata/TESTPRI/spfileTESTPRI.ora
DOMAIN: null

6. Broker configuration is enabled and state of all members as intended is ONLINE

DGMGRL> show configuration

7. remote_login_passwordfile is set to 'EXCLUSIVE'

SQL> sho parameter remote_login_passwordfile

8. Verify TESTPRI and TESTDG tnspingable from both primary as well as standby and can connect to each other.

Let us do the actual switchover now. Since our primary database is RAC, let us also keep a watch on how the OCR status is changing.

9. Ensure <<db_unique_name>>_DGMGRL is part of service names otherwise post switchover, instances may have to be manually started

OCR Config before switchover:

[oracle@testprir1]/apps/oracle/product/10g/db/dbs% srvctl status database -d TESTPRI
Instance TESTPRIR1 is running on node testprir1
Instance TESTPRIR2 is running on node testprir2

[oracle@testprir1]/apps/oracle/product/10g/db/dbs% srvctl config database -d TESTPRI -a
testprir1 TESTPRIR1 /apps/oracle/product/10g/db
testprir2 TESTPRIR2 /apps/oracle/product/10g/db
DB_NAME: null
ORACLE_HOME: /apps/oracle/product/10g/db
SPFILE: /n01/oradata/TESTPRI/spfileTESTPRI.ora
DOMAIN: null

Broker config before switchover:

DGMGRL> show configuration;

  Name:            DG_TEST
  Enabled:         YES
  Protection Mode: MaxPerformance
    TESTPRI - Primary database
    TESTDG  - Physical standby database

Current status for "DG_TEST":

Switchover Now:

DGMGRL> switchover to 'TESTDG';




Oracle Training at Sea
oracle dba poster

Follow us on Twitter 
Oracle performance tuning software 
Oracle Linux poster


Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.