DBAtlas · Database operations atlas

Perform a failover after losing the primary (DGMGRL)

OracleData Guard

Command

# Connect to the standby (the primary is unreachable):
dgmgrl sys@<standby_db_unique_name>
# 1) Assess the data that will be lost (Transport Lag / Apply Lag):
SHOW DATABASE '<standby_db_unique_name>';
# 2) Complete failover: all received redo is applied, then the role changes (recommended)
FAILOVER TO '<standby_db_unique_name>';
# 3) Emergency: immediately, without applying redo (more data loss)
# FAILOVER TO '<standby_db_unique_name>' IMMEDIATE;
SHOW CONFIGURATION;

What it does

Promotes the standby to the primary role when the primary is unavailable; a complete failover first applies all received redo, IMMEDIATE skips apply.

When to use it

When the primary site, storage or database is lost beyond recovery and the RTO does not allow waiting for a switchover.

Caution

This role change is irreversible. First make sure the primary is REALLY down; if the old primary stays open and the application keeps writing to it, you get split-brain and divergent data (shut down/isolate the old primary). In MaxPerformance mode you lose as much data as the transport lag. Afterwards review all standbys and the backup strategy for the new primary.

Open in DBAtlas →

Related