How does Oracle handle failover?
In the Oracle ecosystem, "failover" isn't just one single button—it’s a multi-layered response system. Depending on whether you are using RAC (Clusters) or Data Guard (Disaster Recovery), Oracle handles the transition from "broken" to "running" in very different ways.
Here is how the "Oracle Magic" works when things go wrong.
If you are running Oracle RAC, failover is handled by shifting the workload between servers that are already "live" and looking at the same data.
The Detection: The nodes in the cluster send "heartbeats" to each other every second.
The Recovery: The surviving node (Node 2) looks at the Redo Logs of the failed node.
The Client Side: This is where Application Continuity comes in. If configured correctly, the database can actually "re-play" the uncommitted transaction on the new node. The user might see a 5-second "hang," but they don't get an error message.
When an entire data center goes dark (fire, flood, or total power loss), Oracle shifts the entire database identity to a Standby Database located elsewhere.
The Transition: This is a "Role Change." The Standby database transitions from a "Receiver of Redo" to a "Generator of Redo."
The "Failover" Command: Unlike a Switchover (which is planned and graceful), a Failover assumes the Primary is dead. It may involve some data loss depending on your protection mode (Maximum Performance vs. Maximum Availability).
Fast-Start Failover (FSFO): As we discussed previously, if you have an Observer process running, this entire process happens automatically in under 30 seconds.
How do the users find the new database once it has moved? Oracle uses Virtual IPs (VIP) and SCAN Listeners.
When a node fails, its VIP is instantly "plucked" from the failed server and moved to a healthy server.
When a client tries to talk to the old IP, the healthy server answers and says, "I'm holding this IP now, but that instance is gone. Go talk to the listener on Node 2 instead."
This prevents the client from waiting for a "TCP Timeout" (which can take 2 minutes), allowing for a near-instant reconnection.
| Feature | RAC Failover | Data Guard Failover |
| Triggered By | Server/Instance crash. | Site/Storage/Primary failure. |
| Data Loss | Zero (Shared storage). | Possible (if not in Max Availability). |
| Client Impact | Sessions migrate to surviving nodes. | Clients must reconnect to a new site. |
| Mechanism | Instance Recovery (Redo Thread). | Role Transition (Standby to Primary). |
In older versions of Oracle, a failover meant the user got an ORA-03113: end-of-file on communication channel error and had to log back in.
In Oracle 19c/23c, we have Application Continuity (AC).
Capturing the interaction between the app and the DB.
In the event of a failover, it opens a new session.
It re-executes the last uncommitted statement.
It returns the result to the app as if nothing happened.
Is Transparent Network Substrate (TNS) configured? Ensure your connection string uses the SCAN name.
Is Fast Connection Failover (FCF) enabled? Your application server (like JBoss or WebLogic) needs to be "RAC-aware."
Is Flashback enabled? This allows you to "un-failover" or reinstate your old primary easily once it’s fixed.
Oracle handles failover by being pessimistic. It assumes the worst (Split-Brain) and uses aggressive fencing and voting to protect the data first, and then uses clever networking and memory-syncing to restore the service to the users.