Reinstate for Data Guard succeeded

After a failover to the standby Oracle Database, we need to reinstate the old primary and we don’t need to recreate the Database, in this case, we need to enable Flashback Database.

Enable Flashback:

SQL> show parameter flash
NAME TYPE VALUE

db_flash_cache_file string
db_flash_cache_size big integer 0
db_flashback_retention_target integer 1440
SQL>
SQL> select flashback_on from v$database;
FLASHBACK_ON
NO
SQL>
SQL> alter database flashback on;
Database altered.

Note: To enable the flashback in the standby, we need to stop replication temporary and enable reactive the replication.

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE  cancel;
Database altered.
SQL> alter database flashback on;
Database altered.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT NODELAY;
Database altered.

Reinstate a Database after Failover:

$ dgmgrl sys/oracle_4U@wadodbsb
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Sat May 27 06:48:36 2023
Version 19.19.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected to "wadodbsb"
Connected as SYSDBA.
DGMGRL> failover to wadodbsb;
Performing failover NOW, please wait…
Failover succeeded, new primary is "wadodbsb"
DGMGRL>
DGMGRL> show configuration;
Configuration - wadohr
Protection Mode: MaxPerformance
Members:
wadodbsb - Primary database
wadodb - Physical standby database (disabled)
ORA-16661: the standby database needs to be reinstated
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 91 seconds ago)
DGMGRL>
DGMGRL>
DGMGRL> reinstate database wadodb;
Reinstating database "wadodb", please wait…
Operation requires shut down of instance "wadodb" on database "wadodb"
Shutting down instance "wadodb"…
Connected to "wadodb"
ORACLE instance shut down.
Operation requires start up of instance "wadodb" on database "wadodb"
Starting instance "wadodb"…
Connected to an idle instance.
ORACLE instance started.
Connected to "wadodb"
Database mounted.
Continuing to reinstate database "wadodb" …
Reinstatement of database "wadodb" succeeded
DGMGRL>
DGMGRL>

Enjoy!

Bookmark the permalink.
Loading Facebook Comments ...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.