Fast-Start Failover
Published by : Obay Salah , November 19, 2024
Fast-Start Failover is a feature that enables automatic and seamless failover to the standby database in the event of a failure in the primary database. This process eliminates the need for manual intervention during failover and also reconfigures the old primary database automatically to act as the new standby database after failover.
Fast-Start Failover Triggers:
Fast-Start Failover is triggered in the following scenarios:
- Database Instance Failure
- Abrupt Shutdown (Shutdown Abort)
- I/O Errors Causing Datafiles to Go Offline
- Loss of communication between the standby database, the observer, and the primary database.
Steps to Configure Fast-Start Failover:
1. Configure Standby Redo Logs
Ensure that standby redo logs are configured on both the primary and standby databases. These logs are essential for fast and efficient failover.
2. Set the LogXptMode
Property to SYNC
Update the LogXptMode
to ensure synchronous communication between the primary and standby databases.
sql Copy code DGMGRL> EDIT DATABASE 'PRIM' SET PROPERTY 'LogXptMode'='SYNC'; Property "LogXptMode" updated DGMGRL> EDIT DATABASE 'STAN' SET PROPERTY 'LogXptMode'='SYNC'; Property "LogXptMode" updated
3. Configure the FastStartFailoverTarget
Property
Set each database to point to its counterpart as the failover target.
sql Copy code DGMGRL> EDIT DATABASE 'PRIM' SET PROPERTY FastStartFailoverTarget='STAN'; Property "FastStartFailoverTarget" updated DGMGRL> EDIT DATABASE 'STAN' SET PROPERTY FastStartFailoverTarget='PRIM'; Property "FastStartFailoverTarget" updated
4. Enable Real-Time Apply
This ensures that redo data is applied to the standby database as soon as it is received, reducing failover time.
sql Copy code ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE;
5. Switch to MAXAVAILABILITY
Mode
Change the protection mode for maximum availability.
sql Copy code DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
6. Enable Flashback Database
Flashback Database is critical for automatically reconfiguring the primary database as the new standby database.
sql Copy code STARTUP MOUNT; ALTER DATABASE FLASHBACK ON; ALTER DATABASE OPEN;
7. Enable Fast-Start Failover
Activate Fast-Start Failover in the Data Guard Broker.
sql Copy code DGMGRL> ENABLE FAST_START FAILOVER; Enabled.
8. Start the Observer
The observer monitors the primary and standby databases. It is recommended to run the observer on a separate server.
sql Copy code DGMGRL> CONNECT sys/password@PRIMNET; DGMGRL> START OBSERVER; Observer started
9. Verify the Configuration
Check the status of the Fast-Start Failover configuration.
sql Copy code DGMGRL> SHOW CONFIGURATION VERBOSE; Configuration Name: TEST Enabled: YES Protection Mode: MaxAvailability Fast-Start Failover: ENABLED Databases: PRIM - Primary database STAN - Physical standby database - Fast-Start Failover target Fast-Start Failover Threshold: 30 seconds Observer: observer Current status for "TEST": SUCCESS
Change the Failover Threshold
You can adjust the failover timeout (default is 30 seconds). For instance, to change it to 45 seconds:
sql Copy code DGMGRL> EDIT CONFIGURATION SET PROPERTY FastStartFailoverThreshold = 45;
With Fast-Start Failover configured, the observer continuously monitors the primary and standby databases. If a failure occurs in the primary database, the observer initiates failover after the configured threshold (e.g., 30 seconds). The standby database becomes the new primary, and the old primary is reconfigured as the new standby.
Comments
no comment yet!