Enable Fast-Start Failover (FSFO) and start the observer
OracleData GuardCommand
# 1) Targets and threshold (seconds):
EDIT DATABASE '<primary_db_unique_name>' SET PROPERTY FastStartFailoverTarget='<standby_db_unique_name>';
EDIT DATABASE '<standby_db_unique_name>' SET PROPERTY FastStartFailoverTarget='<primary_db_unique_name>';
EDIT CONFIGURATION SET PROPERTY FastStartFailoverThreshold=30;
# 2) MaxAvailability for zero data loss (SYNC/FASTSYNC transport):
EDIT DATABASE '<primary_db_unique_name>' SET PROPERTY LogXptMode='FASTSYNC';
EDIT DATABASE '<standby_db_unique_name>' SET PROPERTY LogXptMode='FASTSYNC';
EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
# Acceptable loss in MaxPerformance: EDIT CONFIGURATION SET PROPERTY FastStartFailoverLagLimit=30;
ENABLE FAST_START FAILOVER;
# 3) Observer: on a third server, separate from primary and standby (passwordless connection via wallet)
dgmgrl /@<primary_tns> "START OBSERVER obs1 IN BACKGROUND FILE IS '/u01/app/oracle/dg/fsfo_obs1.dat' LOGFILE IS '/u01/app/oracle/dg/obs1.log' CONNECT IDENTIFIER IS <primary_tns>"
# 4) Verify:
SHOW FAST_START FAILOVER;
SHOW OBSERVER;What it does
Lets the observer fail over to the standby automatically after the threshold when the primary is unreachable, and reinstate the old primary automatically when it comes back.
When to use it
On critical systems whose RTO target is minutes, without waiting for human intervention.
Caution
The observer must not run on the same server/data center as the primary or the standby; otherwise FSFO fails on a site loss or can make the wrong decision during a network partition. Flashback must be enabled on both databases. A threshold that is too low turns short network glitches into unnecessary failovers. For planned maintenance, DISABLE FAST_START FAILOVER or account for the observer before shutting down the primary.
Related
- Show the Data Guard broker configuration and database status (DGMGRL)
- Check primary/standby role and switchover readiness with SQL
- Measure transport/apply lag, apply rate and Data Guard processes on the standby
- Validate the standby with the broker before switchover/failover (VALIDATE DATABASE)
- Perform a planned switchover (DGMGRL, role change without data loss)
- Perform a failover after losing the primary (DGMGRL)