top of page

Automatic Failover Across Clouds: Data Guard Fast-Start Failover with an Observer in a Third Location

OmerNarman
Nov 4
7 min read

A Data Guard standby in another cloud protects the data, but someone still has to notice the outage and run the failover. At 03:00 that can take an hour. Fast-start failover (FSFO) removes the human from the critical path: a small process called the observer watches both databases, and when the primary disappears, the broker fails over to the standby within seconds to a few minutes, and later turns the old primary into a standby again.


The danger in any automatic failover is a split brain, where both sites think they are primary. Fast-start failover avoids it by design, but only if the observer runs somewhere that can see each site independently. This post sets it up with the primary in OCI, the standby in Azure and the observer on a small VM in a third location.



The Use Case

The order-entry database must survive the loss of its OCI region with a recovery time under five minutes and at most 30 seconds of data loss. Asynchronous transport is used because of the distance. A tiny VM in a third location, a different cloud region from both databases, runs the observer.


Environment used in this runbook


  • Primary: SALES_OCI, Oracle Database 19c (19.24) on an OCI VM

  • Standby: SALES_AZURE, physical standby on an Azure VM, broker configuration sales_dg

  • Observer host: obs-site3, a small Linux VM in a third location with the Oracle 19c client (Administrator install, which includes DGMGRL)

  • Transport: ASYNC, protection mode MaxPerformance

  • Licence: fast-start failover is part of Data Guard, included with Enterprise Edition; no Active Data Guard licence is needed for it



How Fast-Start Failover Decides

  • The observer connects to both databases and pings them. It is the witness that breaks the tie.

  • Failover needs two votes. The standby fails over only when it and the observer have both lost contact with the primary for longer than FastStartFailoverThreshold seconds.

  • The primary protects itself. If the primary loses contact with both the standby and the observer for longer than the threshold, it stops accepting work, so it can never continue as a second primary.

  • The lag limit caps data loss. In MaxPerformance mode, the standby fails over only if it is no more than FastStartFailoverLagLimit seconds behind.

  • Reinstatement. When the old primary comes back, the broker flashes it back and converts it into a standby, which needs Flashback Database on both databases.



Step 1: Check the Configuration and Enable Flashback

Fast-start failover needs a healthy broker configuration, and automatic reinstatement needs Flashback Database on both databases. Check both and enable flashback where it is off (on the standby, stop apply first).


SQL

-- On each database

SELECT db_unique_name, database_role, flashback_on FROM v$database;

Expected output

DB_UNIQUE_NAME   DATABASE_ROLE    FLASHBACK_ON
---------------- ---------------- ------------------
SALES_OCI        PRIMARY          YES

What to expect: FLASHBACK_ON YES on the primary, and the same on the standby. If it is NO, run ALTER DATABASE FLASHBACK ON (with redo apply stopped on the standby), as shown in the Flashback Database post on this blog. Without it, fast-start failover still works, but the old primary must be rebuilt by hand after a failover.



Step 2: Set the Failover Target and the Thresholds

Tell each database which member to fail over to, and set how long to wait and how much data loss is acceptable. The values below suit a cross-region setup: long enough to ride out a short network blip, short enough for a five-minute recovery time.


Shell

dgmgrl sys@SALES_OCI <<'EOF'

EDIT DATABASE 'SALES_OCI' SET PROPERTY FastStartFailoverTarget = 'SALES_AZURE';

EDIT DATABASE 'SALES_AZURE' SET PROPERTY FastStartFailoverTarget = 'SALES_OCI';

EDIT CONFIGURATION SET PROPERTY FastStartFailoverThreshold = 60;

EDIT CONFIGURATION SET PROPERTY FastStartFailoverLagLimit = 30;

EDIT CONFIGURATION SET PROPERTY FastStartFailoverAutoReinstate = TRUE;

EOF

Expected output

Property "faststartfailovertarget" updated
Property "faststartfailovertarget" updated
Property "faststartfailoverthreshold" updated
Property "faststartfailoverlaglimit" updated
Property "faststartfailoverautoreinstate" updated

What this does: Each database names the other as its failover target, so fast-start failover works in both directions after a role change. The broker waits 60 seconds without contact before failing over, and refuses to fail over if the standby is more than 30 seconds behind, which bounds data loss. Auto-reinstate makes the broker convert the old primary into a standby when it returns.



Step 3: Install the Observer Host and Store the Credentials in a Wallet

The observer is a DGMGRL session that runs continuously. It needs to connect as SYS (or SYSDG) to both databases without a password on the command line, so store the credentials in an Oracle wallet on the observer host.


Shell

# On obs-site3, as oracle, with the 19c client installed

mkdir -p /u01/app/oracle/observer/wallet

mkstore -wrl /u01/app/oracle/observer/wallet -create

mkstore -wrl /u01/app/oracle/observer/wallet -createCredential SALES_OCI sys

mkstore -wrl /u01/app/oracle/observer/wallet -createCredential SALES_AZURE sys

cat >> $ORACLE_HOME/network/admin/sqlnet.ora <<'EOF'

WALLET_LOCATION = (SOURCE = (METHOD = FILE)(METHOD_DATA = (DIRECTORY = /u01/app/oracle/observer/wallet)))

SQLNET.WALLET_OVERRIDE = TRUE

EOF

mkstore -wrl /u01/app/oracle/observer/wallet -listCredential

Expected output

Oracle Secret Store Tool Release 19.0.0.0.0 - Production
Enter wallet password:
List credential (index: connect_string username)
2: SALES_AZURE sys
1: SALES_OCI sys

What to expect: A wallet with one credential per database, each keyed by its TNS alias. The tnsnames.ora on the observer host must contain SALES_OCI and SALES_AZURE entries that reach each database directly, not through a load balancer that could send the observer to the wrong site.



Step 4: Check the Observer's Network Paths

The observer must reach each database over a path that does not depend on the other site. If the observer could only reach Azure through OCI, losing OCI would also cut it off from Azure, and failover could not happen.


Shell

# On obs-site3: wallet-based connections to both databases

dgmgrl /@SALES_OCI "show database 'SALES_OCI'" | grep -E 'Role|Database Status' -A1

dgmgrl /@SALES_AZURE "show database 'SALES_AZURE'" | grep -E 'Role|Database Status' -A1

Expected output

  Role:               PRIMARY
  Intended State:     TRANSPORT-ON
Database Status:
SUCCESS
  Role:               PHYSICAL STANDBY
  Intended State:     APPLY-ON
Database Status:
SUCCESS

What to expect: Both connections succeed without a password prompt, using the wallet, and each reports its role. Trace the network route from the observer host to each site (traceroute or the cloud network tools) and confirm the two paths are independent.



Step 5: Start the Observer in the Background

From 19c, DGMGRL can start the observer as a background process with its own configuration file and log. Give it a name, so you can run several observers later for redundancy.


Shell

cd /u01/app/oracle/observer

dgmgrl /@SALES_OCI "start observer obs_site3 in background file is '/u01/app/oracle/observer/fsfo.dat' logfile is '/u01/app/oracle/observer/obs_site3.log' connect identifier is SALES_OCI"

tail -3 /u01/app/oracle/observer/obs_site3.log

Expected output

Submitted command "START OBSERVER" using connect identifier "SALES_OCI"
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Wed Nov 4 10:12:44 2026
Observer 'obs_site3' started
[W000 2026-11-04T10:12:45.118+01:00] Observer trace level is set to USER

What this does: The observer starts in the background, writes its state to fsfo.dat and its activity to obs_site3.log, and keeps running after you log out. Start it from a systemd unit or a cron @reboot entry as well, so it comes back after a reboot of the observer host.



Step 6: Enable Fast-Start Failover

With the target, thresholds and observer in place, enable fast-start failover. The broker checks the prerequisites and refuses with a clear error if something is missing.


Shell

dgmgrl /@SALES_OCI <<'EOF'

ENABLE FAST_START FAILOVER;

SHOW FAST_START FAILOVER;

EOF

Expected output

Enabled in Potential Data Loss Mode.

Fast-Start Failover: Enabled in Potential Data Loss Mode

  Protection Mode:    MaxPerformance
  Lag Limit:          30 seconds

  Threshold:          60 seconds
  Active Target:      SALES_AZURE
  Potential Targets:  "SALES_AZURE"
    SALES_AZURE valid
  Observer:           obs_site3
  Shutdown Primary:   TRUE
  Auto-reinstate:     TRUE
  Observer Reconnect: (none)
  Observer Override:  FALSE

What to expect: "Enabled in Potential Data Loss Mode", because transport is asynchronous: up to the 30-second lag limit can be lost in a failover. The observer obs_site3 is listed, the active target is SALES_AZURE, and the primary will shut down if it is isolated. For zero data loss, combine fast-start failover with MaxAvailability and synchronous transport, for example through a far sync instance.



Step 7: Confirm the Configuration Reports Healthy

Check the whole configuration from any member. A fast-start failover configuration with a warning, such as a missing observer, may not fail over when you need it.


Shell

dgmgrl /@SALES_OCI "show configuration"

Expected output

Configuration - sales_dg

  Protection Mode: MaxPerformance
  Members:
  SALES_OCI   - Primary database
    SALES_AZURE - (*) Physical standby database

Fast-Start Failover: Enabled in Potential Data Loss Mode

Configuration Status:
SUCCESS   (status updated 22 seconds ago)

What to expect: SUCCESS, and an asterisk next to SALES_AZURE, marking it as the fast-start failover target. Add this command to your monitoring: alert if the status is not SUCCESS or if the observer disappears from SHOW FAST_START FAILOVER.



Step 8: Test a Real Failover

Test in a maintenance window on a non-production copy first, then once on production with the business informed. The realistic test is an abrupt loss of the primary, not a clean shutdown: a SHUTDOWN IMMEDIATE does not trigger fast-start failover.


Shell

# On the primary host: simulate a crash

sqlplus -s / as sysdba <<'EOF'

SHUTDOWN ABORT

EOF

# On the observer host: follow what the observer does

tail -f /u01/app/oracle/observer/obs_site3.log

Expected output

[W000 2026-11-04T10:31:07.512+01:00] Primary database cannot be reached.
[W000 2026-11-04T10:31:07.512+01:00] Fast-Start Failover threshold has not exceeded. Retry for the next 60 seconds
[W000 2026-11-04T10:32:08.031+01:00] Fast-Start Failover threshold has expired.
[W000 2026-11-04T10:32:08.031+01:00] Try to connect to the standby.
[W000 2026-11-04T10:32:08.402+01:00] Check if the standby is ready for failover.
[S002 2026-11-04T10:32:08.611+01:00] Fast-Start Failover started...
[S002 2026-11-04T10:32:41.207+01:00] Fast-Start Failover finished...
[W000 2026-11-04T10:32:41.207+01:00] Failover succeeded. New primary is "SALES_AZURE"

What to expect: The observer waits the 60-second threshold, then starts the failover, and about half a minute later SALES_AZURE is the new primary. The total time from crash to new primary is a little over 90 seconds, well inside the five-minute target. Applications using a role-based service with Transparent Application Continuity reconnect on their own.



Step 9: Watch the Old Primary Being Reinstated

Start the old primary again. Because auto-reinstate is on and Flashback Database is enabled, the broker flashes it back to the failover point and converts it into a physical standby of the new primary.


Shell

# On the old primary host

sqlplus -s / as sysdba <<'EOF'

STARTUP MOUNT

EOF

# A few minutes later, from the observer host

dgmgrl /@SALES_AZURE "show configuration"

Expected output

ORACLE instance started.
Database mounted.

Configuration - sales_dg

  Protection Mode: MaxPerformance
  Members:
  SALES_AZURE - Primary database
    SALES_OCI   - (*) Physical standby database

Fast-Start Failover: Enabled in Potential Data Loss Mode

Configuration Status:
SUCCESS   (status updated 41 seconds ago)

What to expect: SALES_OCI is back as a physical standby and is now the fast-start failover target, marked with the asterisk. The configuration is protected again without anyone rebuilding anything. Switch back to OCI later, in a planned window, with SWITCHOVER TO 'SALES_OCI'.


Tip: Run a second observer in yet another location for resilience (19c supports up to three observers per configuration, one active and the others standing by). If the active observer's host fails, a backup observer takes over.


Summary

Fast-start failover turns a cross-cloud Data Guard configuration into one that heals itself. Enable Flashback Database on both databases, set each database's failover target, a threshold and a lag limit that match your recovery objectives, and turn on auto-reinstate. Run the observer from a third location with independent network paths and a wallet for its credentials, start it in the background, and enable fast-start failover. Confirm SUCCESS with the target marked, test with a real crash rather than a clean shutdown, and watch the old primary come back as a standby. Fast-start failover is part of Data Guard in Enterprise Edition, with no extra option needed.

Recent Posts

See All

Comments


bottom of page