Recover the old primary as a standby after a failover (REINSTATE)
OracleData GuardCommand
# 1) Bring the old primary to MOUNT (sqlplus / as sysdba):
# SQL> STARTUP MOUNT;
# (RAC: srvctl start database -db <old_primary_db_unique_name> -startoption mount)
# 2) From DGMGRL connected to the new primary:
dgmgrl sys@<new_primary_db_unique_name>
REINSTATE DATABASE '<old_primary_db_unique_name>';
# 3) Verify:
SHOW CONFIGURATION;
SHOW DATABASE '<old_primary_db_unique_name>';What it does
Flashes the old primary back to before the failover SCN with flashback database, converts it to a physical standby and starts receiving redo from the new primary; no need to rebuild the standby from scratch.
When to use it
After a failover, once the old primary server/storage is reachable again; after an FSFO automatic failover (the observer usually reinstates it by itself).
Caution
Flashback must have been enabled on the old primary BEFORE the failover and the flashback logs must cover the failover SCN (db_flashback_retention_target, FRA size); otherwise the reinstate fails and the standby must be rebuilt with RMAN duplicate. Data written to the old primary after the failover is permanently lost.
Related
- Show the Data Guard broker configuration and database status (DGMGRL)
- Check primary/standby role and switchover readiness with SQL
- Measure transport/apply lag, apply rate and Data Guard processes on the standby
- Validate the standby with the broker before switchover/failover (VALIDATE DATABASE)
- Perform a planned switchover (DGMGRL, role change without data loss)
- Perform a failover after losing the primary (DGMGRL)