How to reinstate the old Primary as a Standby after Failover
Primary database crash and failed over to standby.
We can reinstate old primary as standby by performing flashback on the old primary database.
Please execute the below in new primary
SELECT TO_CHAR(STANDBY_BECAME_PRIMARY_SCN) FROM V$DATABASE;
Flashback the old primary to the above scn(taken from step 1).
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;
SQL> FLASHBACK DATABASE TO SCN standby_became_primary_scn;
Convert to physical standby.
ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
Set up DG and verify log sync.
Start managed recovery.