Oracle Data Guard Switchover and Failover in OCI
Oracle Data Guard is a high availability and disaster recovery solution that maintains one or more synchronized standby databases for a production (primary) database. In Oracle Cloud Infrastructure (OCI), Data Guard operations such as Switchover, Failover, and Reinstate can be performed using the dbaascli utility, making database role transitions simple and automated.
Environment Details
| Role | DB Unique Name |
|---|---|
| Primary Database | ORCL |
| Standby Database | ORCLDG |
Understanding Oracle Data Guard
Oracle Data Guard protects databases against:
- Hardware failures
- Storage failures
- Site outages
- Planned maintenance activities
- Human errors
A Data Guard configuration consists of:
Primary Database
The production database that receives all read-write transactions.
Physical Standby Database
An exact block-by-block copy of the primary database that continuously receives and applies redo from the primary.
Redo Transport Services
Transfers redo generated on the primary to the standby.
Redo Apply Services
Applies redo on the standby database to keep it synchronized.
Switchover
What is a Switchover?
A Switchover is a planned role reversal between the primary and standby databases with zero or minimal downtime and no data loss.
Common Use Cases
- Operating system patching
- Database upgrades
- Exadata maintenance
- Data center migration
- Planned DR testing
Role Transition
Before Switchover:
Validate:
- Primary Database = ORCL
- Standby Database = ORCLDG
- Protection Mode
- Transport Status
- Apply Status
- Overall Health = SUCCESS
The command performs:
- Synchronizes remaining redo.
- Stops Primary services on ORCL.
- Converts ORCLDG to Primary.
- Converts ORCL to Physical Standby.
- Starts Data Guard services automatically.
Step 5: Monitor Progress
Check operation status:
Objective
Perform a Failover when the Primary database becomes unavailable and then Reinstate the failed Primary database to restore the Data Guard configuration.
Initial Configuration
Before Failover
Step 1: Perform Failover
When to Use Failover
Failover is performed when:
- Primary database is unavailable.
- Server crash.
- Storage failure.
- Site failure.
- Database cannot be recovered within acceptable business timelines.
Unlike Switchover, Failover is an emergency operation.
Execute Failover
Run the following command on the standby environment:
Result of Failover
Before:
Validation After Failover
Connect to ORCLDG and verify:
Step 2: Reinstate the Failed Primary
What is Reinstate?
After a Failover, the original Primary database cannot automatically rejoin the configuration.
Reinstate converts the failed Primary database into a Physical Standby and restores Data Guard protection.
Reinstate Works Only If
✅ Flashback Database is enabled
Without Flashback Database, a full standby rebuild may be required.
Method B: Reinstate Using dbaascli
Connect to the ORCL server.
Set Oracle environment:
--primaryDBUniqueName should point to ORCLDG.
No comments:
Post a Comment