Dataguard Switchover Using DGMGRL

A switchover is a role reversal between the primary database and one of its standby databases. A switchover guarantees no data loss.
This is typically done for planned maintenance of the primary system.
During a switchover, the primary database transitions to a standby role and the standby database transitions to the primary role

The role of the primary database and a standby database is going to change using the SWITCHOVER command

The broker configuration file is updated to reflect the change in roles.

DETAILS SOURCE TARGET
IP_ADDRESS 192.168.1.44 192.168.1.37
SERVER_NAME PRIMARY STANDBY
DB_VERSION 19.3.0.0 19.3.0.0
DB_NAME PROD STANDBY

 

CHECK THE DATABASE STATUS : 

DGMGRL> show configuration

Configuration – sathish

Protection Mode: MaxPerformance
Members:
PROD – Primary database
STANDBY – Physical standby database

Fast-Start Failover: Disabled

Configuration Status:
SUCCESS (status updated 42 seconds ago)

Check the  Database Is Ready for a Role Change

It will checks whether it is ready for switchover.

DGMGRL> VALIDATE DATABASE ‘prod’;
Database Role: Primary database
Ready for Switchover: Yes
Flashback Database Status:
prime: Off
DGMGRL> VALIDATE DATABASE ‘standby’;
Database Role: Physical standby database
Primary Database: prime
Ready for Switchover: Yes
Ready for Failover: Yes (Primary Running)
Flashback Database Status:
prime: Off
stand: Off

PERFORM THE SWITCHOVER OPERATION :

DGMGRL> switchover to standby;
Performing switchover NOW, please wait…
Operation requires a connection to database “STANDBY”
Connecting …
Connected to “STANDBY”
Connected as SYSDBA.
New primary database “STANDBY” is opening…
Operation requires start up of instance “prod” on database “BALL”
Starting instance “prod”…
Connected to an idle instance.
ORACLE instance started.
Connected to “PROD”
Database mounted.
Connected to “PROD”
Switchover succeeded, new primary is “standby”
DGMGRL>

CHECK THE STATUS IN DG_BROKER :

DGMGRL> show configuration

Configuration – sathish

Protection Mode: MaxPerformance
Members:
STANDBY – Primary database
PROD – Physical standby database

Fast-Start Failover: Disabled

Configuration Status:
SUCCESS (status updated 21 seconds ago)

VERIFY THE STATUS :

DGMGRL> show database ‘PROD‘;

Database – PROD

Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Average Apply Rate: 7.00 KByte/s
Real Time Query: OFF
Instance(s):
PROD

Database Status:
SUCCESS

DGMGRL> SHOW DATABASE ‘STANDBY‘;

Database – STANDBY

Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
PROD

Database Status:
SUCCESS

Recommended Posts

Start typing and press Enter to search