Description:-
- If your former primary database was configured with Flashback Database, you can easily reinstate the failed primary database as a standby database of the new primary database.
- The failed primary database will be reinstated as a standby type that matches the old standby database.
- For example, if you failed over to a physical standby database, the old primary will be reinstated as a physical standby database.
- It may be possible to convert the old Primary into a Standby database now instead of having to do a time consuming duplicate again.
- Flashback is enabled on both side and flashback logs and retention time has not exceeded, then it is not necessary.to recreate standby database from scratch.
- Flashback is not enabled on both side then we need to recreate standby database from scratch.
Let’s start the Demo:-
Step1:-Restart the Old Primary Database.
SQL> select flashback_on,instance_name,database_role from v$database,V$instance;
FLASHBACK_ON INSTANCE_NAME DATABASE_ROLE
—————— —————- —————-
YES chennai PRIMARY
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 1048575776 bytes
Fixed Size 8904480 bytes
Variable Size 339738624 bytes
Database Buffers 696254464 bytes
Redo Buffers 3678208 bytes
Database mounted.
Step2:-Reinstate the old primary database.
[oracle@dev19c CHENNAI]$ dgmgrl
DGMGRL for Linux: Release 19.0.0.0.0 – Production on Sat Oct 26 13:13:35 2019
Version 19.4.1.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type “help” for information.
DGMGRL> connect sys/oracle@chennai
Connected to “CHENNAI”
Connected as SYSDBA.
DGMGRL> REINSTATE DATABASE ‘delhi’;
Reinstating database “delhi”, please wait…
Reinstatement of database “delhi” succeeded
Step3:-Show the Configuration and Databases.
DGMGRL> SHOW CONFIGURATION;
Configuration – hari
Protection Mode: MaxAvailability
Members:
chennai – Primary database
delhi – Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 18 seconds ago)
Step4:-Verify the standby status
DGMGRL> show database ‘delhi’;
Database – delhi
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Average Apply Rate: 2.00 KByte/s
Real Time Query: ON
Instance(s):
delhi
Database Status:
SUCCESS
Step5:-Check Database level
SQL> select flashback_on,instance_name,database_role from v$database,V$instance;
FLASHBACK_ON INSTANCE_NAME DATABASE_ROLE
—————— —————- —————-
YES delhi PHYSICAL STANDBY
SQL> SELECT ARCH.THREAD# “Thread”, ARCH.SEQUENCE# “Last Sequence Received”, APPL.SEQUENCE# “Last Sequence Applied”, (ARCH.SEQUENCE# – APPL.SEQUENCE#) “Difference” FROM (SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;
Thread Last Sequence Received Last Sequence Applied Difference
———- ———————- ——————— ———-
1 5 5 0
Successfully completed the Reinstating a Failed oracle 19c Primary Database using DGMGRL Utlility
Connect with me:-
Telegram App:https://t.me/oracledbwr
LinkedIn:https://www.linkedin.com/in/hariprasathdba
Facebook:https://www.facebook.com/HariPrasathdba
FB Group:https://www.facebook.com/groups/894402327369506/
FB Page : https://www.facebook.com/dbahariprasath/?
Twitter : https://twitter.com/hariprasathdba