- Introduction:
- Using Flashback Database.
- Using Data Guard Broker (DGMGRL).
- Flashback Database must be enabled on the old primary.
- Flashback logs must be available covering the failover point.
- Standby redo log should exist.
- Old Primary must not be opened in R/W after failover.
- DG broker should be configured (for DGMGRL method).
| Hostname | oradbdc.oraeasy.com |
|---|---|
| SID | oradbdc |
| Database Version | 19c (19.28) |
| Hostname | oradbdr.oraeasy.com |
|---|---|
| SID | oradbdr |
| Database Version | 19c (19.28) |
Using Flashback Database.
1. First verify the precheck at Primary & Standby database.
Primary.
SQL> def
DEFINE _DATE = "02-APR-2026" (CHAR)
DEFINE _CONNECT_IDENTIFIER = "oradbdc" (CHAR)
DEFINE _USER = "SYS" (CHAR)
DEFINE _PRIVILEGE = "AS SYSDBA" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1928000000" (CHAR)
DEFINE _EDITOR = "vi" (CHAR)
DEFINE _O_VERSION = "Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0" (CHAR)
DEFINE _O_RELEASE = "1928000000" (CHAR)
SQL>
SQL> select name,DB_UNIQUE_NAME,open_mode, database_role,flashback_on from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE FLASHBACK_ON
--------- ------------------------------ -------------------- ---------------- ------------------
ORADB oradbdc READ WRITE PRIMARY YES
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORPDB READ WRITE NO
SQL>
SQL> col MEMBER for a80
SQL> SELECT group#, type, member FROM v$logfile ORDER BY group#;
GROUP# TYPE MEMBER
---------- ------- ------------------------------------------------------------
1 ONLINE /u01/app/oracle/oradata/oradbdc/redo01.log
2 ONLINE /u01/app/oracle/oradata/oradbdc/redo02.log
3 ONLINE /u01/app/oracle/oradata/oradbdc/redo03.log
4 STANDBY /u01/app/oracle/oradata/oradbdc/standby_redo01.log
5 STANDBY /u01/app/oracle/oradata/oradbdc/standby_redo02.log
6 STANDBY /u01/app/oracle/oradata/oradbdc/standby_redo03.log
7 STANDBY /u01/app/oracle/oradata/oradbdc/standby_redo04.log
7 rows selected.
SQL> set lines 200 pages 300
SQL> alter session set nls_date_format= 'DD-MON-YYYY HH24:MI:SS';
Session altered.
SQL> select d.db_unique_name,d.database_role, a.thread#, b.last_seq, a.applied_seq, a.last_app_timestamp, b.last_seq - a.applied_seq ARC_DIFF
FROM
(select thread#, MASQL> X(sequence#) applied_seq, MAX(next_time) last_app_timestamp from gv$archived_log where applied='YES' group by thread#) a,
(select thread#, MAX(sequence#) last_seq from gv$archived_log group by thread#) b,
(select db_unique_name,database_role from v$database) d where a.thread#=b.thread#;
DB_UNIQUE_NAME DATABASE_ROLE THREAD# LAST_SEQ APPLIED_SEQ LAST_APP_TIMESTAMP ARC_DIFF
------------------------------ ---------------- ---------- ---------- ----------- -------------------- ----------
oradbdc PRIMARY 1 47 47 02-APR-2026 21:05:57 0
7 rows selected.
Standby.
SQL> def
DEFINE _DATE = "02-APR-2026" (CHAR)
DEFINE _CONNECT_IDENTIFIER = "oradbdr" (CHAR)
DEFINE _USER = "SYS" (CHAR)
DEFINE _PRIVILEGE = "AS SYSDBA" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1928000000" (CHAR)
DEFINE _EDITOR = "vi" (CHAR)
DEFINE _O_VERSION = "Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0" (CHAR)
DEFINE _O_RELEASE = "1928000000" (CHAR)
SQL>
SQL> /
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE FLASHBACK_ON
--------- ------------------------------ -------------------- ---------------- ------------------
ORADB oradbdr MOUNTED PHYSICAL STANDBY YES
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED MOUNTED
3 ORPDB MOUNTED
SQL> col MEMBER for a80
SQL> SELECT group#, type, member FROM v$logfile ORDER BY group#;
GROUP# TYPE MEMBER
---------- ------- ----------------------------------------------------------
1 ONLINE /u01/app/oracle/oradata/oradbdr/redo01.log
2 ONLINE /u01/app/oracle/oradata/oradbdr/redo02.log
3 ONLINE /u01/app/oracle/oradata/oradbdr/redo03.log
4 STANDBY /u01/app/oracle/oradata/oradbdr/standby_redo01.log
5 STANDBY /u01/app/oracle/oradata/oradbdr/standby_redo02.log
6 STANDBY /u01/app/oracle/oradata/oradbdr/standby_redo03.log
7 STANDBY /u01/app/oracle/oradata/oradbdr/standby_redo04.log
7 rows selected
SQL> set lines 200 pages 300
SQL> alter session set nls_date_format= 'DD-MON-YYYY HH24:MI:SS';
Session altered.
SQL> select d.db_unique_name,d.database_role, a.thread#, b.last_seq, a.applied_seq, b.last_seq - a.applied_seq ARC_DIFF, a.last_app_timestamp,
round((sysdate - a.last_app_timestamp)*24*60,2) Gap_in_Mins, round((sysdate - a.last_app_timestamp)*24*60*60,2) Gap_in_Seconds
FROM
(select thread#, MAX(sequence#) applied_seq, MAX(next_time) last_app_timestamp from gv$archived_log where REGISTRAR='RFS' and applied='YES' group by thread#) a,
(select thread#, MAX(sequence#) last_seq from gv$archived_log group by thread#) b,
(select db_unique_name,database_role from v$database) d where a.thread#=b.thread#;
DB_UNIQUE_NAME DATABASE_ROLE THREAD# LAST_SEQ APPLIED_SEQ ARC_DIFF LAST_APP_TIMESTAMP GAP_IN_MINS GAP_IN_SECONDS
------------------------------ ---------------- ---------- ---------- ----------- ---------- -------------------- ----------- --------------
oradbdr PHYSICAL STANDBY 1 47 47 0 02-APR-2026 21:05:57 7.83 470
2. Now assume that Primary is not available and let's do the failover.
SQL> select name,DB_UNIQUE_NAME,open_mode, database_role from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
ORADB oradbdr MOUNTED PHYSICAL STANDBY
SQL> select d.db_unique_name,d.database_role, a.thread#, b.last_seq, a.applied_seq, b.last_seq - a.applied_seq ARC_DIFF, a.last_app_timestamp,
round((sysdate - a.last_app_timestamp)*24*60,2) Gap_in_Mins, round((sysdate - a.last_app_timestamp)*24*60*60,2) Gap_in_Seconds
FROM
(select thread#, MAX(sequence#) applied_seq, MAX(next_time) last_app_timestamp from gv$archived_log where REGISTRAR='RFS' and applied='YES' group by thread#) a,
(select thread#, MAX(sequence#) last_seq from gv$archived_log group by thread#) b,
(select db_unique_name,database_role from v$database) d where a.thread#=b.thread#;
DB_UNIQUE_NAME DATABASE_ROLE THREAD# LAST_SEQ APPLIED_SEQ ARC_DIFF LAST_APP_TIMESTAMP GAP_IN_MINS GAP_IN_SECONDS
------------------------------ ---------------- ---------- ---------- ----------- ---------- -------------------- ----------- --------------
oradbdr PHYSICAL STANDBY 1 47 47 0 02-APR-2026 21:05:57 32.75 1965
SQL> select process,status,thread#,sequence#,block# from v$managed_standby where process like '%MRP%';
PROCESS STATUS THREAD# SEQUENCE# BLOCK#
--------- ------------ ---------- ---------- ----------
MRP0 APPLYING_LOG 1 48 983
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> alter database recover managed standby database finish;
Database altered.
SQL> select name,DB_UNIQUE_NAME,open_mode, database_role from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
ORADB oradbdr MOUNTED PHYSICAL STANDBY
SQL> alter database activate standby database;
Database altered.
SQL> select name,DB_UNIQUE_NAME,open_mode, database_role from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
ORADB oradbdr MOUNTED PRIMARY
SQL> shut immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1962930480 bytes
Fixed Size 9179440 bytes
Variable Size 1157627904 bytes
Database Buffers 788529152 bytes
Redo Buffers 7593984 bytes
Database mounted.
Database opened.
SQL>
SQL> select name,DB_UNIQUE_NAME,open_mode, database_role from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
ORADB oradbdr READ WRITE PRIMARY
SQL>
3. Now let's do the Reinstate activity.
On current Primary, check standby_became_primary_scn.
SQL> select name,DB_UNIQUE_NAME,open_mode, database_role from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
ORADB oradbdr READ WRITE PRIMARY
SQL> SELECT to_char(standby_became_primary_scn) FROM v$database;
TO_CHAR(STANDBY_BECAME_PRIMARY_SCN)
----------------------------------------
2687193
On old Primary, Start the listener and database in mount mode.
[oracle@oradbdc ~]$ lsnrctl start
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 02-APR-2026 22:00:42
Copyright (c) 1991, 2025, Oracle. All rights reserved.
Starting /u01/app/oracle/product/19c/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19c/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/oradbdc/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oradbdc.oraeasy.com)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oradbdc.oraeasy.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 02-APR-2026 22:00:42
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/19c/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oradbdc/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oradbdc.oraeasy.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
[oracle@oradbdc ~]$
[oracle@oradbdc ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Apr 2 21:48:52 2026
Version 19.28.0.0.0
Copyright (c) 1982, 2025, Oracle. All rights reserved.
Connected to an idle instance.
SQL> def
DEFINE _DATE = "02-APR-26" (CHAR)
DEFINE _CONNECT_IDENTIFIER = "oradbdc" (CHAR)
DEFINE _USER = "SYS" (CHAR)
DEFINE _PRIVILEGE = "AS SYSDBA" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1928000000" (CHAR)
DEFINE _EDITOR = "vi" (CHAR)
DEFINE _O_VERSION = "" (CHAR)
DEFINE _O_RELEASE = "" (CHAR)
SQL> startup mount
ORACLE instance started.
Total System Global Area 1962930480 bytes
Fixed Size 9179440 bytes
Variable Size 1157627904 bytes
Database Buffers 788529152 bytes
Redo Buffers 7593984 bytes
Database mounted.
SQL> set lines 333
SQL> select name,DB_UNIQUE_NAME,open_mode, database_role,flashback_on from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE FLASHBACK_ON
--------- ------------------------------ -------------------- ---------------- ------------------
ORADB oradbdc MOUNTED PRIMARY YES
Now run FLASHBACK DATABASE TO SCN to reinstate the Primary.
SQL> FLASHBACK DATABASE TO SCN 2687193; ==> SCN fetched on current Primary
Flashback complete.
SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
Database altered.
SQL> shut immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> startup mount
ORACLE instance started.
Total System Global Area 1962930480 bytes
Fixed Size 9179440 bytes
Variable Size 1157627904 bytes
Database Buffers 788529152 bytes
Redo Buffers 7593984 bytes
Database mounted.
SQL>
Start the MRP process.
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> select name,DB_UNIQUE_NAME,open_mode, database_role,flashback_on from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE FLASHBACK_ON
--------- ------------------------------ -------------------- ---------------- ------------------
ORADB oradbdc MOUNTED PHYSICAL STANDBY YES
4. Now do some log switches and check the sync.
At Primary.
SQL> select name,DB_UNIQUE_NAME,open_mode, database_role from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
ORADB oradbdr READ WRITE PRIMARY
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
SQL> /
System altered.
SQL>
SQL> SELECT MAX(SEQUENCE#) FROM V$ARCHIVED_LOG WHERE DEST_ID = 1 AND ARCHIVED = 'YES'
AND RESETLOGS_ID = (SELECT RESETLOGS_ID FROM V$DATABASE_INCARNATION WHERE STATUS = 'CURRENT');
MAX(SEQUENCE#)
--------------
11
At Standby.
SQL> select name,DB_UNIQUE_NAME,open_mode, database_role from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
ORADB oradbdc MOUNTED PHYSICAL STANDBY
SQL> SELECT MAX(SEQUENCE#) FROM V$ARCHIVED_LOG WHERE APPLIED = 'YES'
AND RESETLOGS_ID = (SELECT RESETLOGS_ID FROM V$DATABASE_INCARNATION WHERE STATUS = 'CURRENT');
MAX(SEQUENCE#)
--------------
11
SQL> select process,status,thread#,sequence#,block# from v$managed_standby where process like '%MRP%';
PROCESS STATUS THREAD# SEQUENCE# BLOCK#
--------- ------------ ---------- ---------- ----------
MRP0 APPLYING_LOG 1 12 903
Using Data Guard Broker (DGMGRL).
1. First verify the precheck at Primary & Standby database.
Primary.
SQL> def
DEFINE _DATE = "07-APR-26" (CHAR)
DEFINE _CONNECT_IDENTIFIER = "oradbdc" (CHAR)
DEFINE _USER = "SYS" (CHAR)
DEFINE _PRIVILEGE = "AS SYSDBA" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1928000000" (CHAR)
DEFINE _EDITOR = "vi" (CHAR)
DEFINE _O_VERSION = "Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0" (CHAR)
DEFINE _O_RELEASE = "1928000000" (CHAR)
SQL>
SQL> select name,DB_UNIQUE_NAME,open_mode, database_role,flashback_on from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE FLASHBACK_ON
--------- ------------------------------ -------------------- ---------------- ------------------
ORADB ORADBDC READ WRITE PRIMARY YES
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORPDB READ WRITE NO
SQL> col MEMBER for a80
SQL> SELECT group#, type, member FROM v$logfile ORDER BY group#;
GROUP# TYPE MEMBER
---------- ------- --------------------------------------------------------------------------------
1 ONLINE /u01/app/oracle/oradata/ORADB/redo01.log
2 ONLINE /u01/app/oracle/oradata/ORADB/redo02.log
3 ONLINE /u01/app/oracle/oradata/ORADB/redo03.log
4 STANDBY /u01/app/oracle/oradata/ORADB/standby_redo01.log
5 STANDBY /u01/app/oracle/oradata/ORADB/standby_redo02.log
6 STANDBY /u01/app/oracle/oradata/ORADB/standby_redo03.log
7 STANDBY /u01/app/oracle/oradata/ORADB/standby_redo04.log
7 rows selected.
SQL> set lines 200 pages 300
SQL> alter session set nls_date_format= 'DD-MON-YYYY HH24:MI:SS';
Session altered.
SQL> select d.db_unique_name,d.database_role, a.thread#, b.last_seq, a.applied_seq, a.last_app_timestamp, b.last_seq - a.applied_seq ARC_DIFF
FROM
(select thread#, MASQL> X(sequence#) applied_seq, MAX(next_time) last_app_timestamp from gv$archived_log where applied='YES' group by thread#) a,
(select thread#, MAX(sequence#) last_seq from gv$archived_log group by thread#) b,
(select db_unique_name,database_role from v$database) d where a.thread#=b.thread#;
DB_UNIQUE_NAME DATABASE_ROLE THREAD# LAST_SEQ APPLIED_SEQ LAST_APP_TIMESTAMP ARC_DIFF
---------------- ---------------- ---------- ---------- ----------- -------------------- ----------
ORADBDC PRIMARY 1 45 45 07-APR-2026 21:55:11 0
7 rows selected.
[oracle@oradbdc ~]$ dgmgrl /
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Tue Apr 7 22:09:19 2026
Version 19.28.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected to "ORADBDC"
Connected as SYSDG.
DGMGRL> show configuration
Configuration - oradbdg
Protection Mode: MaxPerformance
Members:
oradbdc - Primary database
oradbdr - Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 16 seconds ago)
DGMGRL>
DGMGRL> show database oradbdc;
Database - oradbdc
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
oradbdc
Database Status:
SUCCESS
DGMGRL>
Standby.
SQL> def
DEFINE _DATE = "07-APR-2026" (CHAR)
DEFINE _CONNECT_IDENTIFIER = "oradbdr" (CHAR)
DEFINE _USER = "SYS" (CHAR)
DEFINE _PRIVILEGE = "AS SYSDBA" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1928000000" (CHAR)
DEFINE _EDITOR = "vi" (CHAR)
DEFINE _O_VERSION = "Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0" (CHAR)
DEFINE _O_RELEASE = "1928000000" (CHAR)
SQL>
SQL> select name,DB_UNIQUE_NAME,open_mode, database_role,flashback_on from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE FLASHBACK_ON
--------- ------------------------------ -------------------- ---------------- ------------------
ORADB oradbdr MOUNTED PHYSICAL STANDBY YES
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED MOUNTED
3 ORPDB MOUNTED
SQL>
SQL> col MEMBER for a80
SQL> SELECT group#, type, member FROM v$logfile ORDER BY group#;
GROUP# TYPE MEMBER
---------- ------- --------------------------------------------------------------------------------
1 ONLINE /u01/app/oracle/oradata/oradbdr/redo01.log
2 ONLINE /u01/app/oracle/oradata/oradbdr/redo02.log
3 ONLINE /u01/app/oracle/oradata/oradbdr/redo03.log
4 STANDBY /u01/app/oracle/oradata/oradbdr/standby_redo01.log
5 STANDBY /u01/app/oracle/oradata/oradbdr/standby_redo02.log
6 STANDBY /u01/app/oracle/oradata/oradbdr/standby_redo03.log
7 STANDBY /u01/app/oracle/oradata/oradbdr/standby_redo04.log
7 rows selected.
SQL> set lines 200 pages 300
SQL> alter session set nls_date_format= 'DD-MON-YYYY HH24:MI:SS';
Session altered.
SQL> select d.db_unique_name,d.database_role, a.thread#, b.last_seq, a.applied_seq, b.last_seq - a.applied_seq ARC_DIFF, a.last_app_timestamp,
round((sysdate - a.last_app_timestamp)*24*60,2) Gap_in_Mins, round((sysdate - a.last_app_timestamp)*24*60*60,2) Gap_in_Seconds
FROM
(select thread#, MAX(sequence#) applied_seq, MAX(next_time) last_app_timestamp from gv$archived_log where REGISTRAR='RFS' and applied='YES' group by thread#) a,
(select thread#, MAX(sequence#) last_seq from gv$archived_log group by thread#) b,
(select db_unique_name,database_role from v$database) d where a.thread#=b.thread#;
DB_UNIQUE_NAME DATABASE_ROLE THREAD# LAST_SEQ APPLIED_SEQ ARC_DIFF LAST_APP_TIMESTAMP GAP_IN_MINS GAP_IN_SECONDS
--------------- ---------------- ---------- ---------- ----------- ---------- -------------------- ----------- --------------
oradbdr PHYSICAL STANDBY 1 45 45 0 07-APR-2026 21:55:11 9.93 596
[oracle@oradbdr ~]$ dgmgrl /
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Tue Apr 7 22:10:12 2026
Version 19.28.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected to "oradbdr"
Connected as SYSDG.
DGMGRL>
DGMGRL> show configuration
Configuration - oradbdg
Protection Mode: MaxPerformance
Members:
oradbdc - Primary database
oradbdr - Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 59 seconds ago)
DGMGRL>
DGMGRL> show database oradbdr
Database - oradbdr
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: 6.00 KByte/s
Real Time Query: OFF
Instance(s):
oradbdr
Database Status:
SUCCESS
DGMGRL>
2. Now assume that Primary is not available and let's do the failover using DGMGRL.
[oracle@oradbdr ~]$ dgmgrl /
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Tue Apr 7 22:18:10 2026
Version 19.28.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected to "oradbdr"
Connected as SYSDG.
DGMGRL>
DGMGRL> show configuration
Configuration - oradbdg
Protection Mode: MaxPerformance
Members:
oradbdc - Primary database
Error: ORA-12541: TNS:no listener
oradbdr - Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
ERROR (status updated 0 seconds ago)
DGMGRL>
DGMGRL> show database oradbdc
Database - oradbdc
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
oradbdc
Database Status:
DGM-17016: failed to retrieve status for database "oradbdc"
ORA-12541: TNS:no listener
ORA-16625: cannot reach member "oradbdc"
DGMGRL> show database oradbdr
Database - oradbdr
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 293 seconds ago)
Apply Lag: 0 seconds (computed 293 seconds ago)
Average Apply Rate: 1.00 KByte/s
Real Time Query: OFF
Instance(s):
oradbdr
Database Warning(s):
ORA-16857: member disconnected from redo source for longer than specified threshold
Database Status:
WARNING
DGMGRL>
DGMGRL> failover to oradbdr;
Performing failover NOW, please wait...
Failover succeeded, new primary is "oradbdr"
DGMGRL>
DGMGRL> show configuration
Configuration - oradbdg
Protection Mode: MaxPerformance
Members:
oradbdr - Primary database
oradbdc - Physical standby database (disabled)
ORA-16661: the standby database needs to be reinstated
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 13 seconds ago)
DGMGRL>
3. Now let's do the Reinstate activity using DGMGRL.
On old Primary, Start the listener and database in mount mode.
[oracle@oradbdc ~]$ lsnrctl start
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 07-APR-2026 22:21:40
Copyright (c) 1991, 2025, Oracle. All rights reserved.
Starting /u01/app/oracle/product/19c/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19c/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/oradbdc/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oradbdc.oraeasy.com)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oradbdc.oraeasy.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 07-APR-2026 22:21:40
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/19c/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oradbdc/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oradbdc.oraeasy.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
[oracle@oradbdc ~]$
[oracle@oradbdc ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Apr 7 22:21:43 2026
Version 19.28.0.0.0
Copyright (c) 1982, 2025, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
Total System Global Area 1962930480 bytes
Fixed Size 9179440 bytes
Variable Size 1157627904 bytes
Database Buffers 788529152 bytes
Redo Buffers 7593984 bytes
Database mounted.
SQL>
SQL> select name,DB_UNIQUE_NAME,open_mode, database_role from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
ORADB ORADBDC MOUNTED PRIMARY
SQL>
Now reinstate the old Primary using DGMGRL on current Primary.
[oracle@oradbdr ~]$ dgmgrl /
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Tue Apr 7 22:23:36 2026
Version 19.28.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected to "ORADBDR"
Connected as SYSDG.
DGMGRL>
DGMGRL> show configuration
Configuration - oradbdg
Protection Mode: MaxPerformance
Members:
oradbdr - Primary database
oradbdc - Physical standby database (disabled)
ORA-16661: the standby database needs to be reinstated
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 16 seconds ago)
DGMGRL>
DGMGRL> reinstate database oradbdc;
Reinstating database "oradbdc", please wait...
Reinstatement of database "oradbdc" succeeded
DGMGRL>
DGMGRL> show configuration
Configuration - oradbdg
Protection Mode: MaxPerformance
Members:
oradbdr - Primary database
oradbdc - Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 51 seconds ago)
DGMGRL>
Now check the new standby (old Primary).
SQL> select name,DB_UNIQUE_NAME,open_mode, database_role from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
ORADB ORADBDC MOUNTED PHYSICAL STANDBY
4. Now do some log switches and check the sync.
At Primary.
SQL> select name,DB_UNIQUE_NAME,open_mode, database_role from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
ORADB oradbdr READ WRITE PRIMARY
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
SQL> /
System altered.
SQL> SELECT MAX(SEQUENCE#) FROM V$ARCHIVED_LOG WHERE DEST_ID = 1 AND ARCHIVED = 'YES'
AND RESETLOGS_ID = (SELECT RESETLOGS_ID FROM V$DATABASE_INCARNATION WHERE STATUS = 'CURRENT');
MAX(SEQUENCE#)
--------------
3
[oracle@oradbdr ~]$ dgmgrl /
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Wed Apr 7 22:27:13 2026
Version 19.28.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected to "oradbdr"
Connected as SYSDG.
DGMGRL>
DGMGRL> show configuration
Configuration - oradbdg
Protection Mode: MaxPerformance
Members:
oradbdr - Primary database
oradbdc - Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 20 seconds ago)
DGMGRL> show database oradbdr
Database - oradbdr
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
oradbdr
Database Status:
SUCCESS
DGMGRL>
At Standby.
SQL> select name,DB_UNIQUE_NAME,open_mode, database_role from v$database;
NAME DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE
--------- ------------------------------ -------------------- ----------------
ORADB oradbdc MOUNTED PHYSICAL STANDBY
SQL> SELECT MAX(SEQUENCE#) FROM V$ARCHIVED_LOG WHERE APPLIED = 'YES'
AND RESETLOGS_ID = (SELECT RESETLOGS_ID FROM V$DATABASE_INCARNATION WHERE STATUS = 'CURRENT');
MAX(SEQUENCE#)
--------------
3
SQL> select process,status,thread#,sequence#,block# from v$managed_standby where process like '%MRP%';
PROCESS STATUS THREAD# SEQUENCE# BLOCK#
--------- ------------ ---------- ---------- ----------
MRP0 APPLYING_LOG 1 4 11568
SQL>
[oracle@oradbdc ~]$ dgmgrl /
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Wed Apr 7 22:27:32 2026
Version 19.28.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected to "ORADBDC"
Connected as SYSDG.
DGMGRL>
DGMGRL> show configuration
Configuration - oradbdg
Protection Mode: MaxPerformance
Members:
oradbdr - Primary database
oradbdc - Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 36 seconds ago)
DGMGRL>
DGMGRL> show database oradbdc
Database - oradbdc
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: 18.00 KByte/s
Real Time Query: OFF
Instance(s):
oradbdc
Database Status:
SUCCESS
DGMGRL>
After Reinstate activity you can do switchover activity as per need. Follow below link.
Switchover to Standby (DGMGRL)
Thank you for reading!
I hope this content has been helpful to you. Your feedback and suggestions are always welcome — feel free to leave a comment or reach out with any queries.
Abhishek Shrivastava

Comments
Post a Comment