The following steps will help you configure FSFO in a configuration managed by the Data Guard broker:
DGMGRL> show configuration Configuration - PACKT Protection Mode: MaxPerformance Databases: TURKEY_UN - Primary database INDIA_UN - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS
LogXptMode
is set to synchronous redo transport.SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ NO
DB_FLASHBACK_RETENTION_TARGET
, DB_RECOVERY_FILE_DEST_SIZE
,
and DB_RECOVERY_FILE_DEST
. The following query shows you how to set these parameters:SQL> ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=5760; System altered. SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=20G; System altered. SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='/data/FLASHBACK'; System altered. SQL> ALTER DATABASE FLASHBACK ON; Database altered.
listener.ora
file needs to include a service with GLOBAL_DB_NAME
, as follows, to enable the broker to automatically start the databases in the case of a switchover. This configuration is applicable on both servers. To set up the configuration, shut down the listener, make the changes, and restart the listener as follows:(SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /u01/home/oracle/product/11.2.0/db_1) (PROGRAM = extproc) ) (SID_DESC = (GLOBAL_DBNAME = turkey_un_DGMGRL) (SID_NAME = TURKEY) (ORACLE_HOME = /u01/home/oracle/product/11.2.0/db_1) ) )
FastStartFailoverTarget
value is required if there are multiple standby databases available in the Data Guard configuration. Use the following commands for the same:DGMGRL> edit database 'TURKEY_UN' SET PROPERTY FastStartFailoverTarget='INDIA_UN'; Property "faststartfailovertarget" updated DGMGRL> edit database 'INDIA_UN' SET PROPERTY FastStartFailoverTarget='TURKEY_UN'; Property "faststartfailovertarget" updated
FastStartFailoverLagLimit
property refers to how much data loss is acceptable in terms of seconds. The FastStartFailoverThreshold
property refers to the number of seconds for which the configuration will wait before initiating the failover process as follows:DGMGRL> EDIT CONFIGURATION SET PROPERTY FastStartFailoverLagLimit=30; Property "faststartfailoverlaglimit" updated DGMGRL> EDIT CONFIGURATION SET PROPERTY FastStartFailoverThreshold=30; Property "faststartfailoverthreshold" updated
DGMGRL> enable fast_start failover; Enabled.
$dgmgrl -logfile /tmp/obsvr.log sys/free2go@TURKEY "start observer" &
DGMGRL> SHOW FAST_START FAILOVER; Fast-Start Failover: ENABLED Threshold: 30 seconds Target: INDIA_UN Observer: oracle-ha Lag Limit: 30 seconds Shutdown Primary: TRUE Auto-reinstate: TRUE Configurable Failover Conditions Health Conditions: Corrupted Controlfile YES Corrupted Dictionary YES Inaccessible Logfile NO Stuck Archiver NO Datafile Offline YES Oracle Error Conditions: (none) SQL> select DB_UNIQUE_NAME, FS_FAILOVER_STATUS, FS_FAILOVER_CURRENT_TARGET from v$database; DB_UNIQUE_NA FS_FAILOVER_STATUS FS_FAILOVER_CURRENT_TARGET ------------ ---------------------- ------------------------------ turkey_un TARGET UNDER LAG LIMIT INDIA_UN
The FS_FAILOVER_STATUS
value will be in "TARGET UNDER LAG LIMIT"
if it is in the Maximum Performance mode, and in case it is in the Maximum Availability mode, the value will be SYNCHRONIZED
.
We've just seen how to configure a fast-start failover after setting the required parameters, and also verified the status of the configuration after starting the observer.
After configuring the observer, sometimes the process may be dropped and you may see errors in the configuration as shown later. In such a case, FSFO may not be able to initiate a failover in the case of primary database failure as follows:
ORA-16824: multiple warnings, including fast-start failover-related warnings, detected for the database
For any troubleshooting issue, first look at the configuration status as follows:
DGMGRL> show configuration; Configuration - PACKT Protection Mode: MaxPerformance Databases: TURKEY_UN - Primary database Warning: ORA-16824: multiple warnings, including fast-start failover-related warnings, detected for the database INDIA_UN - (*) Physical standby database Warning: ORA-16824: multiple warnings, including fast-start failover-related warnings, detected for the database Fast-Start Failover: ENABLED Configuration Status: WARNING 2012-09-09 19:01:15.111 00000000 1269603843 Operation HEALTH_CHECK continuing with warning, status = ORA-16819 2012-09-09 19:01:15.112 00000000 1269603843 Operation HEALTH_CHECK continuing with warning, status = ORA-16819
Check for the status report of the configuration as follows:
DGMGRL> show database 'TURKEY_UN' 'StatusReport'; STATUS REPORT INSTANCE_NAME SEVERITY ERROR_TEXT * WARNING ORA-16819: fast-start failover observer not started
As per the previous error, the observer is not running. The process may have been dropped or the observer system may have rebooted. Connect to the broker utility from the observer system using Oracle Net Services and start observer
as follows:
$dgmgrl -logfile /tmp/obsvr.log sys/free2go@TURKEY "start observer" &
Check the configuration status as follows:
DGMGRL> SHOW FAST_START FAILOVER; Fast-Start Failover: ENABLED Threshold: 30 seconds Target: INDIA_UN Observer: oracle-ha Lag Limit: 30 seconds Shutdown Primary: TRUE Auto-reinstate: TRUE Configurable Failover Conditions Health Conditions: Corrupted Controlfile YES Corrupted Dictionary YES Inaccessible Logfile NO Stuck Archiver NO Datafile Offline YES Oracle Error Conditions: (none)
To make the observer process highly available and running all the time, we may need to bounce the observer process when needed. So we can prepare a script and run it as a job regularly. It can be scheduled as an OS-level job. The following shell script example can be used on Linux/Unix systems:
# start and Stop Observer export ORACLE_BASE=/u02/app/oracle export ORACLE_HOME=/u01/home/oracle/product/11.2.0/db_1 export PATH=$ORACLE_HOME/bin:$PATH dgmgrl << eof connect sys/free2go@turkey STOP OBSERVER; START OBSERVER; eof