DBAtlas · Database operations atlas

Perform a planned switchover (DGMGRL, role change without data loss)

OracleData Guard

Command

# Connect with a password (with OS authentication "/" the broker cannot restart the remote instance):
dgmgrl sys@<primary_db_unique_name>
# 1) Precheck:
SHOW CONFIGURATION;
VALIDATE DATABASE '<standby_db_unique_name>';
# 2) Role change:
SWITCHOVER TO '<standby_db_unique_name>';
# 3) Verify: new primary and new standby
SHOW CONFIGURATION;
SHOW DATABASE '<primary_db_unique_name>';

What it does

Swaps the roles of the primary and the standby in a controlled way: all primary redo is shipped and applied on the standby, the old primary restarts as a standby and redo apply starts automatically.

When to use it

For planned maintenance at the primary site (OS, hardware, rolling upgrade), DR drills or data center moves.

Caution

The primary has a short outage; application connections must be routed to the new primary through services defined with -role PRIMARY and FAN/TAF/AC. Long-running transactions and high apply lag lengthen the switchover; bring the lag close to zero first. In RAC the broker manages the instances itself; do not intervene with srvctl.

Open in DBAtlas →

Related