By Mouhamadou Diaw

In a previous blog, we talked about Fast-Start Failover with the MaxProtection mode.
With Oracle 12.2 Oracle Data Guard now supports multiple failover targets in a fast-start failover configuration.
Previous functionality allowed for only a single fast-start failover target. If the failover target was unable to meet the requirements for fast-start failover at the time of primary failure, then an automatic failure would not occur.
Designating multiple failover targets significantly improves the likelihood that there will always be a standby suitable for automatic failover when needed.
Multiple failover targets increase high availability by making an automatic failover more likely to occur if there is a primary outage.
Indeed FastStartFailoverTarget can now have as value one site

DGMGRL> edit database 'ORCL_SITE' set property FastStartFailoverTarget='ORCL_SITE1';
Property "faststartfailovertarget" updated
DGMGRL>


DGMGRL> enable fast_start failover;
Enabled.
DGMGRL> show fast_start failover;
Fast-Start Failover: ENABLED
Threshold: 30 seconds
Target: ORCL_SITE1
Observer: standserver1.localdomain
Lag Limit: 30 seconds (not in use)
Shutdown Primary: TRUE
Auto-reinstate: TRUE
Observer Reconnect: (none)
Observer Override: FALSE

It can also have as values two sites (Priority following the order)

DGMGRL> disable Fast_start Failover;
Disabled.
DGMGRL> edit database 'ORCL_SITE' set property FastStartFailoverTarget='ORCL_SITE1,ORCL_SITE2';
Property "faststartfailovertarget" updated
DGMGRL>


DGMGRL> enable fast_start failover;
Enabled.
DGMGRL> show fast_start failover;
Fast-Start Failover: ENABLED
Threshold: 30 seconds
Target: ORCL_SITE1
Candidate Targets: ORCL_SITE1,ORCL_SITE2
Observer: standserver1.localdomain
Lag Limit: 30 seconds (not in use)
Shutdown Primary: TRUE
Auto-reinstate: TRUE
Observer Reconnect: (none)
Observer Override: FALSE

It can also have as value the keyword ANY (Priority defined by oracle)

DGMGRL> edit database 'ORCL_SITE' set property FastStartFailoverTarget='ANY';
Property "faststartfailovertarget" updated
DGMGRL> edit database 'ORCL_SITE1' set property FastStartFailoverTarget='ANY';
Property "faststartfailovertarget" updated
DGMGRL> edit database 'ORCL_SITE2' set property FastStartFailoverTarget='ANY';
Property "faststartfailovertarget" updated

With the value set to ANY we can see that there is a target failover but also there are also candidate targets. If a failover occurs the order will be ORCL_SITE1 first and if Not available ORCL_SITE2 will be the target.

DGMGRL> enable fast_start failover;
Enabled.
DGMGRL> show fast_start failover;
Fast-Start Failover: ENABLED
Threshold: 30 seconds
Target: ORCL_SITE1
Candidate Targets: ORCL_SITE1,ORCL_SITE2
Observer: standserver1.localdomain
Lag Limit: 30 seconds (not in use)
Shutdown Primary: TRUE
Auto-reinstate: TRUE
Observer Reconnect: (none)
Observer Override: FALSE

From the observer we can confirm that target is ORCL_SITE1

[W000 12/15 14:40:25.12] This observer is no longer registered with the configuration.
[W000 12/15 14:40:25.20] FSFO target standby is ORCL_SITE1
[W000 12/15 14:40:27.66] Observer trace level is set to USER
[W000 12/15 14:40:27.66] Try to connect to the primary.
[W000 12/15 14:40:27.66] Try to connect to the primary ORCL_SITE.
[W000 12/15 14:40:27.67] The standby ORCL_SITE1 is ready to be a FSFO target
[W000 12/15 14:40:29.67] Connection to the primary restored!

Now let’s simulate the case that ORCL_SITE1 is no longer available, for this let’s simply shutdown ORCL_SITE1 database, the failover target should be changed to ORCL_SITE2

SQL> shutdown abort
ORACLE instance shut down.
SQL>


DGMGRL> show fast_start failover;
Fast-Start Failover: ENABLED
Threshold: 30 seconds
Target: ORCL_SITE2
Candidate Targets: ORCL_SITE1,ORCL_SITE2
Observer: standserver1.localdomain
Lag Limit: 30 seconds (not in use)
Shutdown Primary: TRUE
Auto-reinstate: TRUE
Observer Reconnect: (none)
Observer Override: FALSE

From the observer we can see following messages that confirm that the failover target was switched to ORCL_SITE2

[W000 12/15 14:54:52.00] Permission granted to the primary database for target switch.
[W000 12/15 14:54:54.03] Standby database has changed to ORCL_SITE2.
[W000 12/15 14:54:54.04] Try to connect to the primary.
[W000 12/15 14:54:54.04] Try to connect to the primary ORCL_SITE.
[W000 12/15 14:54:55.48] The primary database returned to SYNC/NOT LAGGING state with the standby database ORCL_SITE2.
[W000 12/15 14:54:55.48] Connection to the primary restored!
[W000 12/15 14:54:58.48] Disconnecting from database ORCL_SITE.
[W000 12/15 14:55:04.52] The standby ORCL_SITE2 is ready to be a FSFO target

Conclusion
We have seen that we can now have multiple targets for the Fast-Start Failover and how to implement it