0% found this document useful (0 votes)
56 views3 pages

Steps To Perform Switchover

This document outlines the steps to perform a switchover between a primary database (Casper) and physical standby database (CasperStdby). The steps include verifying the databases are ready for switchover, shutting down the primary and mounting the standby, then using ALTER DATABASE commands to commit the primary to a standby role and the standby to a primary role.

Uploaded by

eshwar badisa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views3 pages

Steps To Perform Switchover

This document outlines the steps to perform a switchover between a primary database (Casper) and physical standby database (CasperStdby). The steps include verifying the databases are ready for switchover, shutting down the primary and mounting the standby, then using ALTER DATABASE commands to commit the primary to a standby role and the standby to a primary role.

Uploaded by

eshwar badisa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Steps to perform Switchover

DATAGUARD SWITCHOVER STEPS:

A switchover allows the primary database to switch roles with its standby database. There is no
data loss during a switchover. We can switch back to the original Primary database later by
performing another switchover.

This document only talks about switchover involving physical standby database. In this example,
the original primary database is called CASPER and the original standby database is called
CASPERSTDBY.

I. Before Switchover:

PRIMARY :
 Verify the primary database instance is open.

SQL> Select Database_role, open_mode from v$Database;


DATABASE_ROLE OPEN_MODE
---------------- --------------------
PRIMARY READ WRITE

STANDBY :

 Verify the standby database instance is mounted.

SQL> Select Database_role, open_mode from v$Database;


DATABASE_ROLE OPEN_MODE
---------------- --------------------
PHYSICAL STANDBY MOUNTED

PRIMARY :
 Verify there are no active users connected to the databases.

 Make sure the last redo data transmitted from the Primary database was applied on
the standby database. Issue the following commands on Primary database and
Standby database to find out:

Steps to perform Switchover

ices
Steps to perform Switchover

SQL> select sequence#, applied from v$archived_log;


 verify there are no redo gaps.

SQL> select STATUS, GAP_STATUS from V$ARCHIVE_DEST_STATUS where DEST_ID = 2;


STATUS GAP_STATUS
--------- ------------------------
VALID NO GAP

STANDBY :

 verify that all available redo has been applied to the standby, by querying the
standby.

SQL> select NAME, VALUE, DATUM_TIME from V$DATAGUARD_STATS;

NOTE: There should be no “transport lag” or “apply lag”, and “finish time” should be zero.

II. Quick Switchover Steps:

PRIMARY :

 verify that the primary database is ready to be transitioned to a standby, by querying


the primary.

SQL> select SWITCHOVER_STATUS from V$DATABASE;


SWITCHOVER_STATUS
--------------------
TO STANDBY

NOTE: If we see TO STANDBY or SESSIONS ACTIVE then it is ready. So, switch the primary
to standby role:

SQL> alter database commit to switchover to physical standby with session shutdown;
SQL> shutdown immediate;
Steps to perform Switchover

ices
Steps to perform Switchover

SQL> startup mount;

STANDBY :

 verify that the standby database can be switched to primary role, by querying the
standby:

SQL> select SWITCHOVER_STATUS from V$DATABASE;


SWITCHOVER_STATUS
--------------------
TO PRIMARY

NOTE: If we see TO PRIMARY or SESSIONS ACTIVE then it is ready.

SQL> alter database commit to switchover to primary with session shutdown;


SQL> alter database open;

 Now we have completed the switchover, be sure to start Redo Apply on the standby:
SQL> alter database recover managed standby database using current logfile
disconnect from session;

 Now check the Database role in PRIMARY and STANDBY side


SQL> Select Database_role, open_mode from v$Database;

Steps to perform Switchover

ices

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy