Loading Data Guard Switchover Runbook…
Overview
Environment
Cutover Flow
Pre-Checks
Switchover
Post-Checks
Broker
New Primary
Outcome
DBA Playbook · Advanced Implementation · Real-Time Cutover

Oracle 19c Data Guard Switchover Production Cutover Runbook

A complete real-world runbook for a planned Oracle Data Guard role transition between a primary and a physical standby server. Covers pre-switchover validation, Data Guard Broker switchover, post-switchover sequence and apply checks, role-reversal verification and post-cutover tasks for an Oracle 19c environment.

38
Sections
19c
Oracle DB
★★★
Advanced
0s
Lag at Cutover
BEFORE SWITCHOVERPRIMARYDBprimary-db-serverPRIMARYSTANDBYDBstandby-db-serverSTANDBYREDO TRANSPORT⇅ SWITCHOVER · ZERO LAGAFTER SWITCHOVERPRIMARYDBprimary-db-serverSTANDBYSTANDBYDBstandby-db-serverPRIMARYREDO TRANSPORT

Environment & Architecture Overview

This runbook performs a planned Data Guard switchover between a primary server and a standby server, reversing the database roles with zero data loss. The Data Guard Broker drives the transition and every step is validated before and after the role change.

🔄
Operation
Planned Switchover (Role Transition)
🗄️
Oracle Version
Oracle Database 19c Enterprise Edition
🛡️
DR Type
Physical Standby Database
⚖️
Protection Mode
Maximum Performance (ASYNC)
🧭
Management
Data Guard Broker — DGMGRL
⚡
Fast-Start Failover
Disabled — Manual Switchover
🖧
Topology
Single Instance — No Clusterware
📝
Redo Configuration
3 Online / 4 Standby Groups — 200 MB
📋 Databases & Servers
  • Primary DB: PRIMARYDB on the primary server — primary before the cutover, standby after the switchover.
  • Standby DB: STANDBYDB on the standby server — standby before the cutover, primary after the switchover.
  • The Data Guard Broker configuration is named dg_primarydb. Because both databases share the same instance name PRIMARYDB; but their DB_UNIQUE_NAME values are different.
  • Names in this guide always refer to the original roles — after Phase 3 the roles are reversed, but the database name & db unique name stay the same.
PRIMARYDB · PRIMARY → STANDBY STANDBYDB · STANDBY → PRIMARY

Cutover Flow

Six phases, executed in order. Each phase must be fully green before moving to the next — select a step to jump to its details.

STEP 1

Validate Standby Side

Broker health, readiness, network, lag, gap and apply processes.

STEP 2

Verify Primary Side

Role, active sessions, last sequence, TNS and Broker snapshot.

STEP 3

Log Switch, Re-Validate & Switchover

Final log switch, re-run the sequence checks, SWITCHOVER ... VERIFY and alert-log review, then SWITCHOVER TO STANDBYDB;.

STEP 4

Post-Switchover Checks

Sequences, MRP/RFS and applied-log status on the new standby.

STEP 5

Broker Re-Validation

Roles reversed, properties and switchback readiness.

STEP 6

New Primary & Time Zone

Log switch test, redo destination and DB time zone alignment.

Step-by-Step Cutover

Follow all sections in sequence. Each section maps directly to the original cutover. All commands are preserved as executed; captured output is shown beneath each command with server names, IP addresses and other environment-specific values replaced by generic placeholders.

Phase 1 — Pre-Switchover Validation (Standby Server)
SECTION 1.1
🔌

Broker Configuration & Database Status

Start the cutover by connecting to the Data Guard Broker from the standby server and confirming the overall health of the configuration. The configuration must report SUCCESS, the primary must be in TRANSPORT-ON state and the standby in APPLY-ON with zero transport and apply lag before any role transition is attempted.

dgmgrl — Standby Server
dgmgrl
connect sys
SHOW CONFIGURATION;
SHOW DATABASE PRIMARYDB;
SHOW DATABASE STANDBYDB;
Output — dgmgrlOUTPUT
DGMGRL for Linux: Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys
Password:
Connected to "STANDBYDB"
Connected as SYSDBA.

DGMGRL> SHOW CONFIGURATION;

Configuration - dg_primarydb

  Protection Mode: MaxPerformance
  Members:
  PRIMARYDB - Primary database
    STANDBYDB - Physical standby database

Fast-Start Failover:  Disabled

Configuration Status:
SUCCESS   (status updated 8 seconds ago)

DGMGRL> SHOW DATABASE PRIMARYDB;

Database - PRIMARYDB

  Role:               PRIMARY
  Intended State:     TRANSPORT-ON
  Instance(s):
    PRIMARYDB

Database Status:
SUCCESS

DGMGRL> SHOW DATABASE STANDBYDB;

Database - STANDBYDB

  Role:               PHYSICAL STANDBY
  Intended State:     APPLY-ON
  Transport Lag:      0 seconds (computed 1 second ago)
  Apply Lag:          0 seconds (computed 1 second ago)
  Average Apply Rate: 149.00 KByte/s
  Real Time Query:    OFF
  Instance(s):
    PRIMARYDB

Database Status:
SUCCESS
📌 Key Notes
  • Protection mode is MaxPerformance (asynchronous redo transport) and Fast-Start Failover is Disabled — a planned switchover is driven manually through dgmgrl
  • Configuration Status: SUCCESS is the gate for the cutover — if it shows WARNING or ERROR, stop and resolve it first
  • Both members share the same instance name (PRIMARYDB) while their DB_UNIQUE_NAME values differ (PRIMARYDB / STANDBYDB)
SECTION 1.2
🔍

Primary Database Properties (Verbose)

Review every Broker property of the primary database. This confirms the redo transport settings (ASYNC, no delay, no compression), the apply settings, the static connect identifier used by the Broker during a role change, and the locations of the alert log and Broker log that will be monitored during the cutover.

dgmgrl — Standby Server
SHOW DATABASE VERBOSE STANDBYDB;
SHOW DATABASE VERBOSE PRIMARYDB;
Output — SHOW DATABASE VERBOSEOUTPUT
Database - PRIMARYDB

  Role:               PRIMARY
  Intended State:     TRANSPORT-ON
  Instance(s):
    PRIMARYDB

  Properties:
    DGConnectIdentifier             = 'PRIMARYDB'
    ObserverConnectIdentifier       = ''
    FastStartFailoverTarget         = ''
    PreferredObserverHosts          = ''
    LogShipping                     = 'ON'
    RedoRoutes                      = ''
    LogXptMode                      = 'ASYNC'
    DelayMins                       = '0'
    Binding                         = 'optional'
    MaxFailure                      = '0'
    ReopenSecs                      = '300'
    NetTimeout                      = '30'
    RedoCompression                 = 'DISABLE'
    PreferredApplyInstance          = ''
    ApplyInstanceTimeout            = '0'
    ApplyLagThreshold               = '30'
    TransportLagThreshold           = '30'
    TransportDisconnectedThreshold  = '30'
    ApplyParallel                   = 'AUTO'
    ApplyInstances                  = '0'
    StandbyFileManagement           = ''
    ArchiveLagTarget                = '0'
    LogArchiveMaxProcesses          = '0'
    LogArchiveMinSucceedDest        = '0'
    DataGuardSyncLatency            = '0'
    LogArchiveTrace                 = '0'
    LogArchiveFormat                = ''
    DbFileNameConvert               = ''
    LogFileNameConvert              = ''
    ArchiveLocation                 = ''
    AlternateLocation               = ''
    StandbyArchiveLocation          = ''
    StandbyAlternateLocation        = ''
    InconsistentProperties          = '(monitor)'
    InconsistentLogXptProps         = '(monitor)'
    LogXptStatus                    = '(monitor)'
    SendQEntries                    = '(monitor)'
    RecvQEntries                    = '(monitor)'
    HostName                        = 'primary-db-server'
    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<primary-server-ip>)(PORT=1601))(CONNECT_DATA=(SERVICE_NAME=PRIMARYDB_DGMGRL)(INSTANCE_NAME=PRIMARYDB)(SERVER=DEDICATED)))'
    TopWaitEvents                   = '(monitor)'
    SidName                         = '(monitor)'

  Log file locations:
    Alert log               : /u01/app/oracle/diag/rdbms/primarydb/PRIMARYDB/trace/alert_PRIMARYDB.log
    Data Guard Broker log   : /u01/app/oracle/diag/rdbms/primarydb/PRIMARYDB/trace/drcPRIMARYDB.log

Database Status:
SUCCESS
📌 Key Notes
  • StaticConnectIdentifier points to the <db>_DGMGRL static service on port 1601 — the Broker uses it to restart an instance during switchover, so it must be reachable even when the database is down
  • InconsistentProperties should stay empty/(monitor) — any mismatch between the Broker and the database parameters would surface here
SECTION 1.3
🛫

Validate Primary for Switchover

Run VALIDATE DATABASE VERBOSE against the primary. This Broker command performs a readiness assessment — switchover capability, flashback status, clusterware management, temp files, in-flight datafile moves, transport state and standby-redo-log clearing — and is the single most important pre-check in the runbook.

dgmgrl — Standby Server
VALIDATE DATABASE VERBOSE PRIMARYDB;
Output — VALIDATE DATABASE VERBOSEOUTPUT
  Database Role:    Primary database

  Ready for Switchover:  Yes

  Flashback Database Status:
    PRIMARYDB:  Off

  Capacity Information:
    Database  Instances        Threads
    PRIMARYDB 1                1

  Managed by Clusterware:
    PRIMARYDB:  NO
    Validating static connect identifier for the primary database PRIMARYDB...
    The static connect identifier allows for a connection to database "PRIMARYDB".

  Temporary Tablespace File Information:
    PRIMARYDB TEMP Files:  1

  Data file Online Move in Progress:
    PRIMARYDB:  No

  Transport-Related Information:
    Transport On:  Yes

  Log Files Cleared:
    PRIMARYDB Standby Redo Log Files:  Cleared
📌 Key Notes
  • Ready for Switchover: Yes is mandatory — do not proceed on any other value
  • Managed by Clusterware: NO is expected for a single-instance, non-RAC deployment
  • Flashback Database is Off on both sides — the old primary cannot be rewound automatically in a failover scenario, so keep this in mind for the rollback plan
SECTION 1.4
🛬

Validate Standby for Switchover & Failover

Repeat the validation against the standby database. Besides switchover readiness this reports failover readiness and confirms that the standby redo logs are available and that the standby's online redo logs have not yet been cleared (they are cleared automatically once the standby is converted to primary).

dgmgrl — Standby Server
VALIDATE DATABASE STANDBYDB;
Output — VALIDATE DATABASEOUTPUT
  Database Role:     Physical standby database
  Primary Database:  PRIMARYDB

  Ready for Switchover:  Yes
  Ready for Failover:    Yes (Primary Running)

  Flashback Database Status:
    PRIMARYDB  :  Off
    STANDBYDB:  Off

  Managed by Clusterware:
    PRIMARYDB  :  NO
    STANDBYDB:  NO
    Validating static connect identifier for the primary database PRIMARYDB...
    The static connect identifier allows for a connection to database "PRIMARYDB".

  Log Files Cleared:
    PRIMARYDB Standby Redo Log Files:    Cleared
    STANDBYDB Online Redo Log Files:   Not Cleared
    STANDBYDB Standby Redo Log Files:  Available
📌 Key Notes
  • Both Ready for Switchover and Ready for Failover must be Yes
  • Not Cleared for the standby's online redo logs is normal at this stage — they are recreated automatically when the role changes
SECTION 1.5
🌐

Validate Network Configuration

Verify bidirectional Oracle Net connectivity between both members through the Broker. The command tests the regular connect path in each direction and then validates the static connect identifier of each database — the one used when the Broker has to start an instance during the role transition.

dgmgrl — Standby Server
VALIDATE NETWORK CONFIGURATION FOR ALL;
Output — VALIDATE NETWORK CONFIGURATIONOUTPUT
Connecting to instance "PRIMARYDB" on database "PRIMARYDB" ...
Connected to "PRIMARYDB"
Checking connectivity from instance "PRIMARYDB" on database "PRIMARYDB" to instance "PRIMARYDB" on database "STANDBYDB"...
Succeeded.
Connecting to instance "PRIMARYDB" on database "STANDBYDB" ...
Connected to "STANDBYDB"
Checking connectivity from instance "PRIMARYDB" on database "STANDBYDB" to instance "PRIMARYDB" on database "PRIMARYDB"...
Succeeded.

Oracle Clusterware is not configured on database "PRIMARYDB".
Connecting to database "PRIMARYDB" using static connect identifier "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<primary-server-ip>)(PORT=1601))(CONNECT_DATA=(SERVICE_NAME=PRIMARYDB_DGMGRL)(INSTANCE_NAME=PRIMARYDB)(SERVER=DEDICATED)(STATIC_SERVICE=TRUE)))" ...
Succeeded.
The static connect identifier allows for a connection to database "PRIMARYDB".

Oracle Clusterware is not configured on database "STANDBYDB".
Connecting to database "STANDBYDB" using static connect identifier "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<standby-server-ip>)(PORT=1601))(CONNECT_DATA=(SERVICE_NAME=STANDBYDB_DGMGRL)(INSTANCE_NAME=PRIMARYDB)(SERVER=DEDICATED)(STATIC_SERVICE=TRUE)))" ...
Succeeded.
The static connect identifier allows for a connection to database "STANDBYDB".
📌 Key Notes
  • Every line must end in Succeeded — a failure on the static identifier means the Broker cannot restart the old primary as a standby after the switchover
  • The static listener entries (*_DGMGRL) must exist in listener.ora on both servers
SECTION 1.6
📶

TNS Connectivity Test (tnsping)

Complement the Broker network validation with a plain tnsping of both TNS aliases from the standby server. This confirms that name resolution through tnsnames.ora works and that the listener on each side responds within an acceptable latency.

bash — Standby Server
tnsping primarydb
tnsping standbydb
Output — tnspingOUTPUT
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production

Copyright (c) 1997, 2019, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/19.0.0/dbhome_1/network/admin/sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = <primary-server-ip>)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = PRIMARYDB)))
OK (20 msec)

TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production

Used parameter files:
/u01/app/oracle/product/19.0.0/dbhome_1/network/admin/sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = <standby-server-ip>)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = PRIMARYDB)))
OK (0 msec)
📌 Key Notes
  • The ~20 ms round trip to the remote server and ~0 ms to the local one reflects the cross-site network path between the two servers
SECTION 1.7
🧭

Database Role & Switchover Status (SQL)

Cross-check the Broker view with the database's own dictionary. On the standby, V$DATABASE must show the PHYSICAL STANDBY role in MOUNTED mode with MAXIMUM PERFORMANCE protection. A SWITCHOVER_STATUS of NOT ALLOWED is the expected state on a standby before the role change.

SQL*Plus — Standby Server
sqlplus / as sysdba

set lines 300 pages 300
SELECT name, db_unique_name, database_role,
       protection_mode, protection_level,
       open_mode, switchover_status
FROM   v$database;
Output — V$DATABASEOUTPUT
NAME      DB_UNIQUE_NAME   DATABASE_ROLE    PROTECTION_MODE      PROTECTION_LEVEL     OPEN_MODE   SWITCHOVER_STATUS
--------- ---------------- ---------------- -------------------- -------------------- ----------- -----------------
PRIMARYDB STANDBYDB        PHYSICAL STANDBY MAXIMUM PERFORMANCE  MAXIMUM PERFORMANCE  MOUNTED     NOT ALLOWED
📌 Key Notes
  • The standby is opened in MOUNTED mode (Real Time Query is OFF) — managed recovery runs against a mounted instance
  • The Broker performs the actual role conversion — you do not need to run ALTER DATABASE COMMIT TO SWITCHOVER manually
SECTION 1.8
⏱️

Transport Lag, Apply Lag & Archive Gap

Confirm from the standby that redo is being received and applied in real time, and that there is no archive gap. Both lags must be +00 00:00:00 and V$ARCHIVE_GAP must return no rows.

SQL*Plus — Standby Server
SELECT name, value, unit, time_computed
FROM   v$dataguard_stats
WHERE  name IN ('apply lag','transport lag');

SELECT *
FROM   V$ARCHIVE_GAP;
Output — V$DATAGUARD_STATS / V$ARCHIVE_GAPOUTPUT
NAME           VALUE               UNIT                           TIME_COMPUTED
-------------- ------------------- ------------------------------ -------------------
transport lag  +00 00:00:00        day(2) to second(0) interval   MM/DD/YYYY HH24:MI:SS
apply lag      +00 00:00:00        day(2) to second(0) interval   MM/DD/YYYY HH24:MI:SS

no rows selected
📌 Key Notes
  • Do not start the switchover while any lag is building up — a non-zero apply lag directly lengthens the switchover duration
  • V$ARCHIVE_GAP returning no rows means no missing archived logs between the primary and standby
SECTION 1.9
🔢

Last Sequence Received vs Applied — Cross-Check with Primary

Reconcile the redo sequence numbers on the standby, then compare them with the last sequence generated on the primary (captured in Section 2.3). Two things must hold: the difference between the last sequence received and the last sequence applied on the standby must be zero for every thread, and the last sequence applied on the standby must equal the last sequence generated on the primary. Together they prove that no redo is missing or waiting to be applied.

SQL*Plus — Standby Server (received vs applied)
SELECT ARCH.THREAD#   AS "Thread",
       ARCH.SEQUENCE# AS "Last Seq Received",
       APPL.SEQUENCE# AS "Last Seq Applied",
       (ARCH.SEQUENCE# - APPL.SEQUENCE#) AS "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;
Output — Standby Sequence ReconciliationOUTPUT
    Thread Last Seq Received Last Seq Applied Difference
---------- ----------------- ---------------- ----------
         1            254563           254563          0
SQL*Plus — Primary Server (same query as Section 2.3)
SELECT thread#, MAX(sequence#) AS "Last Seq Generated"
FROM   v$archived_log val, v$database vdb
WHERE  val.resetlogs_change# = vdb.resetlogs_change#
GROUP  BY thread#
ORDER  BY thread#;
Output — Primary Last Sequence GeneratedOUTPUT
   THREAD# Last Seq Generated
---------- ------------------
         1             254563
Cross-Check — Primary vs Standby (Thread 1)CROSS-CHECK
Primary  : Last Seq Generated  (V$ARCHIVED_LOG)  = 254563
Standby  : Last Seq Received   (V$ARCHIVED_LOG)  = 254563
Standby  : Last Seq Applied    (V$LOG_HISTORY)   = 254563

Standby received - Standby applied               = 0
Primary generated - Standby applied              = 0

Result: Yes - standby is fully in sync with the primary
📌 Pass Criteria
  • Single-instance database → only Thread 1 is present
  • Check 1: Difference = 0 on the standby — everything received has been applied
  • Check 2: Last Seq Applied (standby) = Last Seq Generated (primary) — the standby has applied every archived log the primary has produced (254563 = 254563)
  • Run both queries close together: if the primary has switched a log in between, the primary number will be higher by one — simply re-run both and compare again
  • If the standby is lower than the primary, check the transport/apply lag in Section 1.8 and the managed recovery state in Section 1.10 before proceeding
  • This cross-check is repeated after a final log switch in Section 3.3, immediately before the switchover
SECTION 1.10
⚙️

Managed Standby Processes

Inspect the background processes on the standby through V$MANAGED_STANDBY. The MRP0 process must be in APPLYING_LOG state on the latest sequence, and the RFS processes must be connected to the primary and IDLE (waiting for new redo).

SQL*Plus — Standby Server
SELECT PROCESS,
       STATUS,
       THREAD#,
       SEQUENCE#
FROM   V$MANAGED_STANDBY;
Output — V$MANAGED_STANDBY (trimmed)OUTPUT
PROCESS   STATUS          THREAD#  SEQUENCE#
--------- ------------ ---------- ----------
ARCH      CLOSING               1     254535
DGRD      ALLOCATED             0          0
DGRD      ALLOCATED             0          0
ARCH      CLOSING               1     254551
ARCH      CONNECTED             0          0
ARCH      CLOSING               1     254552
ARCH      CONNECTED             0          0
...
ARCH      CLOSING               1     254563
ARCH      CONNECTED             0          0
ARCH      CLOSING               1     254549
ARCH      CONNECTED             0          0
ARCH      CLOSING               1     254550
RFS       IDLE                  1     254564
RFS       IDLE                  1          0
RFS       IDLE                  0          0
MRP0      APPLYING_LOG          1     254564

36 rows selected.
📌 Key Notes
  • MRP0 — APPLYING_LOG means managed recovery is actively applying redo; its sequence should trail the latest received sequence by at most one
  • RFS (Remote File Server) processes are the receivers of redo from the primary — IDLE is healthy
Phase 2 — Pre-Switchover Checks (Primary Server)
SECTION 2.1
🖥️

Primary Role & Switchover Status

Move to the primary server and repeat the dictionary check. On the primary, SWITCHOVER_STATUS should be TO STANDBY (or SESSIONS ACTIVE), meaning the database is ready to be converted to a standby.

SQL*Plus — Primary Server
sqlplus / as sysdba

SELECT name, db_unique_name, database_role,
       protection_mode, protection_level,
       open_mode, switchover_status
FROM   v$database;
Output — V$DATABASEOUTPUT
NAME      DB_UNIQUE_NAME   DATABASE_ROLE    PROTECTION_MODE      PROTECTION_LEVEL     OPEN_MODE   SWITCHOVER_STATUS
--------- ---------------- ---------------- -------------------- -------------------- ----------- -----------------
PRIMARYDB PRIMARYDB        PRIMARY          MAXIMUM PERFORMANCE  MAXIMUM PERFORMANCE  READ WRITE  TO STANDBY
📌 Key Notes
  • TO STANDBY on the primary + NOT ALLOWED on the standby is the correct pre-switchover combination
  • If the status shows SESSIONS ACTIVE the switchover can still proceed — the Broker will disconnect the sessions
SECTION 2.2
👥

Active Session Review

List all user sessions connected to the primary so the application team can be informed before the cutover. Every session listed here will be terminated when the primary is converted to a standby; connection pools should be stopped or redirected to the new primary.

SQL*Plus — Primary Server
SET LINES 300
SET PAGES 300

COLUMN SID       FORMAT 99999
COLUMN SERIAL#   FORMAT 999999
COLUMN USERNAME  FORMAT A20
COLUMN MACHINE   FORMAT A30
COLUMN PROGRAM   FORMAT A40
COLUMN STATUS    FORMAT A10
COLUMN LOGON_TIME FORMAT A20

SELECT sid,
       serial#,
       username,
       machine,
       program,
       status,
       logon_time
FROM   v$session
WHERE  username IS NOT NULL
  AND  type = 'USER'
ORDER  BY username, machine;
Output — V$SESSION (trimmed)OUTPUT
   SID SERIAL# USERNAME             MACHINE                        PROGRAM                                  STATUS     LOGON_TIME
------ ------- -------------------- ------------------------------ ---------------------------------------- ---------- --------------------
    21   53862 APP_USER             app-server-01                  JDBC Thin Client                         INACTIVE   DD-MON-YY
  1512   26295 APP_USER             app-server-01                  JDBC Thin Client                         INACTIVE   DD-MON-YY
  1481   22128 APP_USER             app-server-01                  JDBC Thin Client                         INACTIVE   DD-MON-YY
   993   32904 APP_USER             app-server-01                  JDBC Thin Client                         INACTIVE   DD-MON-YY
   ...
    66   23213 APP_USER             dba-workstation                SQL Developer                            INACTIVE   DD-MON-YY
  1007   25836 APP_USER             app-server-02                  JarLauncher                              INACTIVE   DD-MON-YY
📌 Key Notes
  • Application connections come from the application tier (JDBC Thin Client pool) plus a few ad-hoc tools such as SQL Developer
  • Stop the application and any ad-hoc client connections before executing the switchover to avoid abrupt disconnects
  • Sessions are INACTIVE at the time of the check — no long-running transactions are in flight
SECTION 2.3
🧾

Confirm Role & Last Generated Sequence

Capture the last archived-log sequence generated on the primary. This number is the reference point — after the switchover the new standby must show the same (or a higher) applied sequence, proving that no redo was lost. The same check is repeated after a final log switch in Section 3.2, immediately before the switchover.

SQL*Plus — Primary Server
SELECT DATABASE_ROLE,
       OPEN_MODE
FROM   V$DATABASE;

SELECT thread#, MAX(sequence#) AS "Last Seq Generated"
FROM   v$archived_log val, v$database vdb
WHERE  val.resetlogs_change# = vdb.resetlogs_change#
GROUP  BY thread#
ORDER  BY thread#;
OutputOUTPUT
DATABASE_ROLE    OPEN_MODE
---------------- --------------------
PRIMARY          READ WRITE

   THREAD# Last Seq Generated
---------- ------------------
         1             254563
📌 Key Notes
  • The last generated sequence (254563) matches the last received and applied sequence on the standby captured in Section 1.9 — the cross-check in that section is repeated after the switchover in Section 4.1
SECTION 2.4
📶

TNS Connectivity from the Primary Server

Run the same tnsping test from the primary server. After the switchover this server becomes the standby and must be able to reach the new primary — and vice-versa — so the path has to work in both directions.

bash — Primary Server
tnsping standbydb
tnsping primarydb
Output — tnspingOUTPUT
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = <standby-server-ip>)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = PRIMARYDB)))
OK (20 msec)

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = primary-db-server)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = PRIMARYDB)))
OK (0 msec)
SECTION 2.5
🩺

Broker State Before Switchover

Take a final snapshot of the Broker configuration from the primary server. This is the last green light before the role transition: configuration SUCCESS, transport on, apply on and zero lag on the standby.

dgmgrl — Primary Server
dgmgrl
connect sys
show configuration
show database standbydb
show database primarydb
Output — dgmgrlOUTPUT
Connected to "PRIMARYDB"
Connected as SYSDBA.

DGMGRL> show configuration

Configuration - dg_primarydb

  Protection Mode: MaxPerformance
  Members:
  PRIMARYDB - Primary database
    STANDBYDB - Physical standby database

Fast-Start Failover:  Disabled

Configuration Status:
SUCCESS   (status updated 30 seconds ago)

DGMGRL> show database standbydb

Database - STANDBYDB

  Role:               PHYSICAL STANDBY
  Intended State:     APPLY-ON
  Transport Lag:      0 seconds (computed 1 second ago)
  Apply Lag:          0 seconds (computed 1 second ago)
  Average Apply Rate: 141.00 KByte/s
  Real Time Query:    OFF
  Instance(s):
    PRIMARYDB

Database Status:
SUCCESS

DGMGRL> show database primarydb

Database - PRIMARYDB

  Role:               PRIMARY
  Intended State:     TRANSPORT-ON
  Instance(s):
    PRIMARYDB

Database Status:
SUCCESS
📌 Key Notes
  • All pre-checks are green: proceed to the final log switch and re-validation in Phase 3, then to the role transition
Phase 3 — Final Log Switch, Re-Validation & Switchover
SECTION 3.1
🔀

Force a Log Switch on the Primary

As the very last step before the role transition, force a log switch on the primary server. This closes and archives the current online redo log and ships it to the standby, so that the standby is guaranteed to hold every change made up to this moment before the switchover starts. In the following sections, N is the last sequence generated on the primary captured in Section 2.3 (Thread 1).

SQL*Plus — Primary Server
sqlplus / as sysdba

ALTER SYSTEM SWITCH LOGFILE;
Expected ResultEXPECTED RESULT
System altered.
📌 Why a Final Log Switch?
  • The switch archives the current log and starts a new one — the last archived sequence on the primary moves from N to N+1
  • Give the standby a few seconds to receive and apply the archived log before running the re-validation queries below
  • Do not repeat the log switch unnecessarily — each additional switch only raises the sequence number you have to re-verify
SECTION 3.2
🧾

Re-Check Last Generated Sequence on the Primary

Repeat the check from Section 2.3 on the primary. The last generated sequence must now be higher than the value captured earlier — this is the new reference number that the standby has to match.

SQL*Plus — Primary Server
SELECT thread#, MAX(sequence#) AS "Last Seq Generated"
FROM   v$archived_log val, v$database vdb
WHERE  val.resetlogs_change# = vdb.resetlogs_change#
GROUP  BY thread#
ORDER  BY thread#;
Expected ResultEXPECTED RESULT
   THREAD# Last Seq Generated
---------- ------------------
         1              <N+1>
📌 Key Notes
  • The value is N+1 (or higher if another log switch happened in between) — note it down, it is the reference for Sections 3.3 – 3.6
SECTION 3.3
🔢

Re-Check Received vs Applied & Cross-Check with Primary

Repeat the reconciliation from Section 1.9 on the standby server. The standby must have received and applied the sequence generated by the final log switch, and it must match the primary's last generated sequence from Section 3.2.

SQL*Plus — Standby Server
SELECT ARCH.THREAD#   AS "Thread",
       ARCH.SEQUENCE# AS "Last Seq Received",
       APPL.SEQUENCE# AS "Last Seq Applied",
       (ARCH.SEQUENCE# - APPL.SEQUENCE#) AS "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;
Expected Result — Standby Sequence ReconciliationEXPECTED RESULT
    Thread Last Seq Received Last Seq Applied Difference
---------- ----------------- ---------------- ----------
         1             <N+1>            <N+1>          0
Cross-Check — Primary vs Standby (Thread 1)CROSS-CHECK
Primary  : Last Seq Generated  (Section 3.2)    = <N+1>
Standby  : Last Seq Received   (V$ARCHIVED_LOG)  = <N+1>
Standby  : Last Seq Applied    (V$LOG_HISTORY)   = <N+1>

Standby received - Standby applied               = 0
Primary generated - Standby applied              = 0

Result: Yes - standby is fully in sync with the primary
📌 Key Notes
  • Difference = 0 and Last Seq Applied (standby) = Last Seq Generated (primary)
  • If the standby is still one sequence behind, wait a few seconds and re-run — do not proceed until both numbers match
SECTION 3.4
⚙️

Re-Check MRP & RFS Processes on the Standby

Confirm once more that managed recovery is running and that the redo receivers are connected after the log switch. MRP0 must be APPLYING_LOG on the new current sequence and the RFS processes must be IDLE.

SQL*Plus — Standby Server
SELECT PROCESS,
       STATUS,
       THREAD#,
       SEQUENCE#
FROM   V$MANAGED_STANDBY
WHERE  PROCESS IN ('MRP0','RFS')
ORDER  BY PROCESS;
Expected ResultEXPECTED RESULT
PROCESS   STATUS          THREAD#  SEQUENCE#
--------- ------------ ---------- ----------
MRP0      APPLYING_LOG          1      <N+2>
RFS       IDLE                  1      <N+2>
RFS       IDLE                  1          0
RFS       IDLE                  0          0
📌 Key Notes
  • After the log switch the primary is writing sequence N+2; with real-time apply, MRP0 and the active RFS process follow it
  • MRP0 missing, or in any state other than APPLYING_LOG, means managed recovery is not applying redo — stop and investigate before the switchover
SECTION 3.5
✔️

Re-Check Last Applied Sequence

Check the highest sequence applied on the standby. It must equal the sequence generated by the final log switch.

SQL*Plus — Standby Server
SELECT thread#, MAX(sequence#) AS last_applied
FROM   v$log_history
GROUP  BY thread#;

SELECT MAX(sequence#)
FROM   v$archived_log
WHERE  applied='YES';
Expected ResultEXPECTED RESULT
   THREAD# LAST_APPLIED
---------- ------------
         1        <N+1>

MAX(SEQUENCE#)
--------------
         <N+1>
📌 Key Notes
  • V$LOG_HISTORY is the authoritative value — it must show N+1
  • The APPLIED='YES' flag in V$ARCHIVED_LOG can trail by a sequence or two for a few seconds while apply catches up — re-run the query until it reaches N+1
SECTION 3.6
📚

Re-Check Archived Log Applied Status

List the most recent archived logs on the standby and confirm that the log generated by the final log switch is present and flagged as applied.

SQL*Plus — Standby Server
SELECT THREAD#,
       SEQUENCE#,
       FIRST_TIME,
       NEXT_TIME,
       APPLIED,
       NAME
FROM   V$ARCHIVED_LOG
WHERE  DEST_ID = 1
ORDER  BY SEQUENCE# DESC
FETCH FIRST 10 ROWS ONLY;
Expected Result — V$ARCHIVED_LOG (top rows)EXPECTED RESULT
   THREAD#  SEQUENCE# FIRST_TIM NEXT_TIME APPLIED   NAME
---------- ---------- --------- --------- --------- --------------------------------------------------
         1      <N+1> DD-MON-YY DD-MON-YY YES       <archive_dest>/1_<N+1>_<resetlogs_id>.arc
         1        <N> DD-MON-YY DD-MON-YY YES       <archive_dest>/1_<N>_<resetlogs_id>.arc
         1      <N-1> DD-MON-YY DD-MON-YY YES       <archive_dest>/1_<N-1>_<resetlogs_id>.arc
...
🚦 Go / No-Go Gate — Re-Validation
  • The top row must be sequence N+1 with APPLIED = YES, with no missing sequence numbers below it
  • GO only if all of these are true: primary generated = standby received = standby applied with Difference = 0 (3.2, 3.3) · MRP0 is APPLYING_LOG and RFS is IDLE (3.4) · last applied = N+1 (3.5) · latest archived log is APPLIED = YES (3.6) — then continue with the VERIFY check in Section 3.7
  • NO-GO if any check fails — do not run the switchover; review the lag and gap checks in Section 1.8 and the Broker state, resolve the issue and repeat Sections 3.1 – 3.6
SECTION 3.7
🧪

Switchover Readiness Check — ALTER DATABASE SWITCHOVER ... VERIFY

Before committing to the role change, ask the database itself whether the switchover would succeed. Run ALTER DATABASE SWITCHOVER TO STANDBYDB VERIFY; on the primary server as SYSDBA, using the DB_UNIQUE_NAME of the standby as the target. This command does not perform the switchover — no role change, no instance restart, no outage and nothing in the configuration is modified. It is a dry run: the primary asks the target standby to evaluate the conditions the real switchover depends on and reports whether the standby is ready.

SQL*Plus — Primary Server
sqlplus / as sysdba

ALTER DATABASE SWITCHOVER TO STANDBYDB VERIFY;
Expected Result — Ready for SwitchoverEXPECTED RESULT
Database altered.
📌 What VERIFY Does (and Does Not Do)
  • What it checks (among other conditions): whether Redo Apply (MRP0) is running on the target, whether the target is synchronized with the primary, and whether the target's release is 12.1 or later
  • What it does NOT do: it never converts the primary to a standby and never opens the standby as primary — the role change is still performed only by the Broker SWITCHOVER TO command in Section 3.9
  • Database altered. means the target is ready for switchover
  • ORA-16470: Redo Apply is not running on switchover target means the standby is not ready — start Redo Apply, then re-run the command
  • ORA-16475: succeeded with warnings, check alert log for more details means the target is ready, but there are warnings that may affect switchover performance — review them in the alert log (Section 3.8)
  • Because it changes nothing, the command can be repeated as often as needed. It complements — and does not replace — the Broker VALIDATE DATABASE checks in Sections 1.3 and 1.4
SECTION 3.8
📜

Check the Alert Log After VERIFY

The result of VERIFY is not complete until the alert logs have been read. Immediately after running the command, review the alert log on the primary server — and on the standby server — for the SWITCHOVER VERIFY messages. This is also where any warning behind an ORA-16475 is explained.

bash — Primary Server
# Last lines of the primary alert log
tail -100 /u01/app/oracle/diag/rdbms/primarydb/PRIMARYDB/trace/alert_PRIMARYDB.log

# Only the VERIFY messages
grep -i "switchover verify" /u01/app/oracle/diag/rdbms/primarydb/PRIMARYDB/trace/alert_PRIMARYDB.log | tail -20
bash — Standby Server
# Only the VERIFY messages on the target standby
grep -i "switchover verify" /u01/app/oracle/diag/rdbms/standbydb/PRIMARYDB/trace/alert_PRIMARYDB.log | tail -20
Expected Alert Log Messages (typical — wording can vary slightly by release)EXPECTED RESULT
Primary alert log:
SWITCHOVER VERIFY: Send VERIFY request to switchover target STANDBYDB
SWITCHOVER VERIFY COMPLETE

Standby alert log:
SWITCHOVER VERIFY BEGIN
SWITCHOVER VERIFY COMPLETE
🚦 Go / No-Go Gate Before the Switchover
  • GO only if the statement returned Database altered. and the alert logs show the VERIFY sequence completing with no errors and no SWITCHOVER VERIFY WARNING lines
  • A warning example: SWITCHOVER VERIFY WARNING: switchover target has dirty online redo logfiles that require clearing — the switchover can still work, but clearing the logs takes time and slows it down
  • NO-GO on any ORA- error — fix the cause, re-run VERIFY (Section 3.7) and read the alert log again before continuing
  • Only after the alert log is clean, continue with the switchover in Section 3.9, followed by Phase 4 (post-switchover validation) and Phase 5 (Broker validation)
SECTION 3.9
🔄

Execute the Switchover

With the final log switch, re-validation and SWITCHOVER ... VERIFY check (Sections 3.1 – 3.8) all green, run the switchover from dgmgrl on the primary server. The Broker converts the primary to a physical standby, opens the standby as the new primary, then restarts the old primary instance and mounts it as the new standby — all in a single command with no data loss.

dgmgrl — Primary Server
dgmgrl
connect
-- Username: sys
SWITCHOVER TO STANDBYDB;
Output — SWITCHOVEROUTPUT
DGMGRL for Linux: Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect
Username: sys
Password:
Connected to "PRIMARYDB"
Connected as SYSDBA.

DGMGRL> SWITCHOVER TO STANDBYDB;
Performing switchover NOW, please wait...
Operation requires a connection to database "STANDBYDB"
Connecting ...
Connected to "STANDBYDB"
Connected as SYSDBA.
New primary database "STANDBYDB" is opening...
Operation requires start up of instance "PRIMARYDB" on database "PRIMARYDB"
Starting instance "PRIMARYDB"...
Connected to an idle instance.
ORACLE instance started.
Connected to "PRIMARYDB"
Database mounted.
Connected to "PRIMARYDB"
Switchover succeeded, new primary is "standbydb"
DGMGRL> exit
⚡ Critical Step
  • Look for Switchover succeeded, new primary is "standbydb" — this is the confirmation that the role transition completed
  • The old primary instance is restarted by the Broker through the static connect identifier validated in Section 1.5
  • Run this command immediately after the alert-log go / no-go decision in Section 3.8 so that as little new redo as possible is generated between the final validation and the role change
  • Total outage is limited to the time the application connections are down — keep applications stopped until the new primary is verified
SECTION 3.10
🪞

Confirm the Role Change on the Old Primary

Connect to the old primary server and verify through V$DATABASE that it is now a PHYSICAL STANDBY in MOUNTED mode, with a SWITCHOVER_STATUS of NOT ALLOWED — the same state the standby was in before the cutover.

SQL*Plus — Old Primary Server (new standby)
sqlplus / as sysdba

set lines 300 pages 300

SELECT name, db_unique_name, database_role,
       protection_mode, protection_level,
       open_mode, switchover_status
FROM   v$database;
Output — V$DATABASEOUTPUT
NAME      DB_UNIQUE_NAME   DATABASE_ROLE    PROTECTION_MODE      PROTECTION_LEVEL     OPEN_MODE   SWITCHOVER_STATUS
--------- ---------------- ---------------- -------------------- -------------------- ----------- -----------------
PRIMARYDB PRIMARYDB        PHYSICAL STANDBY MAXIMUM PERFORMANCE  MAXIMUM PERFORMANCE  MOUNTED     NOT ALLOWED
📌 Key Notes
  • Roles are reversed: PRIMARYDB is now the standby and STANDBYDB is now the primary
  • Note that the database names (DB_UNIQUE_NAME) never change — only the roles do
Phase 4 — Post-Switchover Validation (New Standby Server)
SECTION 4.1
🔢

Sequence Reconciliation After Switchover

Re-run the received-vs-applied reconciliation on the new standby. A difference of zero proves that the redo generated by the new primary is being received and applied.

SQL*Plus — New Standby Server
SELECT ARCH.THREAD#   AS "Thread",
       ARCH.SEQUENCE# AS "Last Seq Received",
       APPL.SEQUENCE# AS "Last Seq Applied",
       (ARCH.SEQUENCE# - APPL.SEQUENCE#) AS "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;
Output — Sequence ReconciliationOUTPUT
    Thread Last Seq Received Last Seq Applied Difference
---------- ----------------- ---------------- ----------
         1            254569           254569          0
         1            254569           254569          0
📌 Key Notes
  • The captured output returns two identical rows for thread 1 — both show Difference = 0
  • The received/applied sequence (254569) is at or above the last sequence generated on the old primary after the final log switch (Section 3.2), i.e. no redo was lost
SECTION 4.2
⚙️

MRP & RFS Processes on the New Standby

Confirm that managed recovery has started on the new standby and that the RFS processes are receiving redo from the new primary.

SQL*Plus — New Standby Server
SELECT PROCESS,
       STATUS,
       THREAD#,
       SEQUENCE#
FROM   V$MANAGED_STANDBY
ORDER  BY PROCESS;
Output — V$MANAGED_STANDBY (trimmed)OUTPUT
PROCESS   STATUS          THREAD#  SEQUENCE#
--------- ------------ ---------- ----------
ARCH      CONNECTED             0          0
ARCH      CONNECTED             0          0
ARCH      CONNECTED             0          0
ARCH      CLOSING               1     254572
ARCH      CONNECTED             0          0
ARCH      CLOSING               1     254573
ARCH      CLOSING               1     254574
ARCH      CLOSING               1     254575
...
DGRD      ALLOCATED             0          0
DGRD      ALLOCATED             0          0
MRP0      APPLYING_LOG          1     254576
RFS       IDLE                  1     254576
RFS       IDLE                  1          0
RFS       IDLE                  0          0
RFS       IDLE                  0          0

37 rows selected.
📌 Key Notes
  • MRP0 is applying sequence 254576 — the log currently being written by the new primary
  • No manual ALTER DATABASE RECOVER MANAGED STANDBY DATABASE was needed — the Broker starts apply automatically after the switchover
SECTION 4.3
✔️

Last Applied Sequence

Check the highest sequence recorded in V$LOG_HISTORY and the highest archived log flagged as applied.

SQL*Plus — New Standby Server
SELECT thread#, MAX(sequence#) AS last_applied
FROM   v$log_history
GROUP  BY thread#;

SELECT MAX(sequence#)
FROM   v$archived_log
WHERE  applied='YES';
OutputOUTPUT
   THREAD# LAST_APPLIED
---------- ------------
         1       254575

MAX(SEQUENCE#)
--------------
        254572
📌 Key Notes
  • The APPLIED='YES' flag is updated once an archived log has been fully consumed — it can legitimately trail V$LOG_HISTORY by a few sequences during real-time apply
SECTION 4.4
📚

Archived Log Applied Status

List the most recent archived logs received from the new primary and verify that each of them is flagged as applied.

SQL*Plus — New Standby Server
SELECT THREAD#,
       SEQUENCE#,
       FIRST_TIME,
       NEXT_TIME,
       APPLIED,
       NAME
FROM   V$ARCHIVED_LOG
WHERE  DEST_ID = 1
ORDER  BY SEQUENCE# DESC
FETCH FIRST 10 ROWS ONLY;
Output — V$ARCHIVED_LOGOUTPUT
   THREAD#  SEQUENCE# FIRST_TIM NEXT_TIME APPLIED   NAME
---------- ---------- --------- --------- --------- ------------------------------------------------------------
         1     254575 DD-MON-YY DD-MON-YY YES       /oracle/archivelogs/1_254575_<resetlogs_id>.arc
         1     254574 DD-MON-YY DD-MON-YY YES       /oracle/archivelogs/1_254574_<resetlogs_id>.arc
         1     254573 DD-MON-YY DD-MON-YY YES       /oracle/archivelogs/1_254573_<resetlogs_id>.arc
         1     254572 DD-MON-YY DD-MON-YY YES       /oracle/archivelogs/1_254572_<resetlogs_id>.arc
         1     254569 DD-MON-YY DD-MON-YY YES       /oracle/archivelogs/1_254569_<resetlogs_id>.arc
         1     254568 DD-MON-YY DD-MON-YY YES       /oracle/archivelogs/1_254568_<resetlogs_id>.arc
         1     254567 DD-MON-YY DD-MON-YY YES       /oracle/archivelogs/1_254567_<resetlogs_id>.arc
         1     254566 DD-MON-YY DD-MON-YY YES       /oracle/archivelogs/1_254566_<resetlogs_id>.arc
         1     254565 DD-MON-YY DD-MON-YY YES       /oracle/archivelogs/1_254565_<resetlogs_id>.arc
         1     254564 DD-MON-YY DD-MON-YY YES       /oracle/archivelogs/1_254564_<resetlogs_id>.arc

10 rows selected.
📌 Key Notes
  • Every received log shows APPLIED = YES
  • The archived log file name embeds the resetlogs ID of the database incarnation — it stays constant across a switchover (no RESETLOGS is performed)
Phase 5 — Broker Validation After Role Reversal
SECTION 5.1
🧩

Broker Configuration — Roles Reversed

Open dgmgrl on the old primary server (now the standby) and confirm that the Broker configuration reflects the new roles: STANDBYDB as the primary and PRIMARYDB as the physical standby, with the configuration status back at SUCCESS.

dgmgrl — New Standby Server
dgmgrl
connect sys
show configuration
Output — show configurationOUTPUT
Connected to "PRIMARYDB"
Connected as SYSDBA.

DGMGRL> show configuration

Configuration - dg_primarydb

  Protection Mode: MaxPerformance
  Members:
  STANDBYDB - Primary database
    PRIMARYDB - Physical standby database

Fast-Start Failover:  Disabled

Configuration Status:
SUCCESS   (status updated 31 seconds ago)
📌 Key Notes
  • The members list is now inverted compared to Section 1.1 — the indented member is the standby
  • The protection mode (MaxPerformance) and the Broker configuration name are unchanged by the switchover
SECTION 5.2
🥇

New Primary — Verbose Properties

Review the properties of the new primary (STANDBYDB). Redo transport is on, shipping asynchronously to the new standby, and the log locations now live under the new primary's diagnostic destination.

dgmgrl — New Standby Server
SHOW DATABASE VERBOSE STANDBYDB;
Output — SHOW DATABASE VERBOSEOUTPUT
Database - STANDBYDB

  Role:               PRIMARY
  Intended State:     TRANSPORT-ON
  Instance(s):
    PRIMARYDB

  Properties:
    DGConnectIdentifier             = 'STANDBYDB'
    ObserverConnectIdentifier       = ''
    FastStartFailoverTarget         = ''
    PreferredObserverHosts          = ''
    LogShipping                     = 'ON'
    RedoRoutes                      = ''
    LogXptMode                      = 'ASYNC'
    DelayMins                       = '0'
    Binding                         = 'OPTIONAL'
    MaxFailure                      = '0'
    ReopenSecs                      = '300'
    NetTimeout                      = '30'
    RedoCompression                 = 'DISABLE'
    PreferredApplyInstance          = ''
    ApplyInstanceTimeout            = '0'
    ApplyLagThreshold               = '30'
    TransportLagThreshold           = '30'
    TransportDisconnectedThreshold  = '30'
    ApplyParallel                   = 'AUTO'
    ApplyInstances                  = '0'
    StandbyFileManagement           = ''
    ArchiveLagTarget                = '0'
    LogArchiveMaxProcesses          = '0'
    LogArchiveMinSucceedDest        = '0'
    DataGuardSyncLatency            = '0'
    LogArchiveTrace                 = '0'
    LogArchiveFormat                = ''
    DbFileNameConvert               = ''
    LogFileNameConvert              = ''
    ArchiveLocation                 = ''
    AlternateLocation               = ''
    StandbyArchiveLocation          = ''
    StandbyAlternateLocation        = ''
    InconsistentProperties          = '(monitor)'
    InconsistentLogXptProps         = '(monitor)'
    LogXptStatus                    = '(monitor)'
    SendQEntries                    = '(monitor)'
    RecvQEntries                    = '(monitor)'
    HostName                        = 'standby-db-server'
    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<standby-server-ip>)(PORT=1601))(CONNECT_DATA=(SERVICE_NAME=STANDBYDB_DGMGRL)(INSTANCE_NAME=PRIMARYDB)(SERVER=DEDICATED)))'
    TopWaitEvents                   = '(monitor)'
    SidName                         = '(monitor)'

  Log file locations:
    Alert log               : /u01/app/oracle/diag/rdbms/standbydb/PRIMARYDB/trace/alert_PRIMARYDB.log
    Data Guard Broker log   : /u01/app/oracle/diag/rdbms/standbydb/PRIMARYDB/trace/drcPRIMARYDB.log

Database Status:
SUCCESS
📌 Key Notes
  • HostName and StaticConnectIdentifier now resolve to the standby server — the host that was the standby before the cutover now runs the primary role
  • From this point the alert log of the new primary is the one to watch for application-side errors
SECTION 5.3
🥈

New Standby — Verbose Properties

Review the properties of the new standby (PRIMARYDB). It must be in APPLY-ON state with zero lag; the Broker also reports the average, active and maximum apply rates.

dgmgrl — New Standby Server
SHOW DATABASE VERBOSE PRIMARYDB;
Output — SHOW DATABASE VERBOSEOUTPUT
Database - PRIMARYDB

  Role:               PHYSICAL STANDBY
  Intended State:     APPLY-ON
  Transport Lag:      0 seconds (computed 1 second ago)
  Apply Lag:          0 seconds (computed 1 second ago)
  Average Apply Rate: 715.00 KByte/s
  Active Apply Rate:  7.05 MByte/s
  Maximum Apply Rate: 13.07 MByte/s
  Real Time Query:    OFF
  Instance(s):
    PRIMARYDB

  Properties:
    DGConnectIdentifier             = 'PRIMARYDB'
    ObserverConnectIdentifier       = ''
    FastStartFailoverTarget         = ''
    PreferredObserverHosts          = ''
    LogShipping                     = 'ON'
    RedoRoutes                      = ''
    LogXptMode                      = 'ASYNC'
    DelayMins                       = '0'
    Binding                         = 'optional'
    MaxFailure                      = '0'
    ReopenSecs                      = '300'
    NetTimeout                      = '30'
    RedoCompression                 = 'DISABLE'
    PreferredApplyInstance          = ''
    ApplyInstanceTimeout            = '0'
    ApplyLagThreshold               = '30'
    TransportLagThreshold           = '30'
    TransportDisconnectedThreshold  = '30'
    ApplyParallel                   = 'AUTO'
    ApplyInstances                  = '0'
    StandbyFileManagement           = ''
    ArchiveLagTarget                = '0'
    LogArchiveMaxProcesses          = '0'
    LogArchiveMinSucceedDest        = '0'
    DataGuardSyncLatency            = '0'
    LogArchiveTrace                 = '0'
    LogArchiveFormat                = ''
    DbFileNameConvert               = ''
    LogFileNameConvert              = ''
    ArchiveLocation                 = ''
    AlternateLocation               = ''
    StandbyArchiveLocation          = ''
    StandbyAlternateLocation        = ''
    InconsistentProperties          = '(monitor)'
    InconsistentLogXptProps         = '(monitor)'
    LogXptStatus                    = '(monitor)'
    SendQEntries                    = '(monitor)'
    RecvQEntries                    = '(monitor)'
    HostName                        = 'primary-db-server'
    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<primary-server-ip>)(PORT=1601))(CONNECT_DATA=(SERVICE_NAME=PRIMARYDB_DGMGRL)(INSTANCE_NAME=PRIMARYDB)(SERVER=DEDICATED)))'
    TopWaitEvents                   = '(monitor)'
    SidName                         = '(monitor)'

  Log file locations:
    Alert log               : /u01/app/oracle/diag/rdbms/primarydb/PRIMARYDB/trace/alert_PRIMARYDB.log
    Data Guard Broker log   : /u01/app/oracle/diag/rdbms/primarydb/PRIMARYDB/trace/drcPRIMARYDB.log

Database Status:
SUCCESS
📌 Key Notes
  • Transport lag and apply lag are both 0 seconds immediately after the role change
  • Apply rates (average / active / maximum) are useful baseline numbers for sizing future switchover windows
SECTION 5.4
🛡️

Validate the New Standby (Switchback Readiness)

Run VALIDATE DATABASE VERBOSE again, now against the new standby. The output confirms that the configuration is immediately ready for a switchback and that the standby redo log groups, redo sizes and transport/apply settings are symmetrical on both sides.

dgmgrl — New Standby Server
VALIDATE DATABASE VERBOSE PRIMARYDB;
Output — VALIDATE DATABASE VERBOSEOUTPUT
  Database Role:     Physical standby database
  Primary Database:  STANDBYDB

  Ready for Switchover:  Yes
  Ready for Failover:    Yes (Primary Running)

  Flashback Database Status:
    STANDBYDB:  Off
    PRIMARYDB  :  Off

  Capacity Information:
    Database   Instances        Threads
    STANDBYDB  1                1
    PRIMARYDB  1                1

  Managed by Clusterware:
    STANDBYDB:  NO
    PRIMARYDB  :  NO
    Validating static connect identifier for the primary database STANDBYDB...
    The static connect identifier allows for a connection to database "STANDBYDB".

  Temporary Tablespace File Information:
    STANDBYDB TEMP Files:  1
    PRIMARYDB TEMP Files:    1

  Data file Online Move in Progress:
    STANDBYDB:  No
    PRIMARYDB:   No

  Standby Apply-Related Information:
    Apply State:      Running
    Apply Lag:        0 seconds (computed 0 seconds ago)
    Apply Delay:      0 minutes

  Transport-Related Information:
    Transport On:     Yes
    Gap Status:       No Gap
    Transport Lag:    0 seconds (computed 0 seconds ago)
    Transport Status: Success

  Log Files Cleared:
    STANDBYDB Standby Redo Log Files:  Cleared
    PRIMARYDB Online Redo Log Files:     Not Cleared
    PRIMARYDB Standby Redo Log Files:    Available

  Current Log File Groups Configuration:
    Thread #  Online Redo Log Groups  Standby Redo Log Groups Status
              (STANDBYDB)             (PRIMARYDB)
    1         3                       4                       Sufficient SRLs

  Future Log File Groups Configuration:
    Thread #  Online Redo Log Groups  Standby Redo Log Groups Status
              (PRIMARYDB)             (STANDBYDB)
    1         3                       4                       Sufficient SRLs

  Current Configuration Log File Sizes:
    Thread #   Smallest Online Redo      Smallest Standby Redo
               Log File Size             Log File Size
               (STANDBYDB)               (PRIMARYDB)
    1          200 MBytes                200 MBytes

  Future Configuration Log File Sizes:
    Thread #   Smallest Online Redo      Smallest Standby Redo
               Log File Size             Log File Size
               (PRIMARYDB)               (STANDBYDB)
    1          200 MBytes                200 MBytes
Output — Apply & Transport Property SettingsOUTPUT
  Apply-Related Property Settings:
    Property        STANDBYDB Value          PRIMARYDB Value
    DelayMins       0                        0
    ApplyParallel   AUTO                     AUTO
    ApplyInstances  0                        0

  Transport-Related Property Settings:
    Property        STANDBYDB Value          PRIMARYDB Value
    LogShipping     ON                       ON
    LogXptMode      ASYNC                    ASYNC
    Dependency      <empty>                  <empty>
    DelayMins       0                        0
    Binding         OPTIONAL                 optional
    MaxFailure      0                        0
    ReopenSecs      300                      300
    NetTimeout      30                       30
    RedoCompression DISABLE                  DISABLE

DGMGRL> exit
📌 Key Notes
  • Both Ready for Switchover and Ready for Failover are Yes — the environment can be switched back at any time
  • Gap Status: No Gap and Transport Status: Success confirm a healthy redo stream
  • Sufficient SRLs: 3 online redo groups vs 4 standby redo groups per thread (N+1) with identical 200 MB sizes on both sides
  • Transport and apply properties are identical on both members, so the configuration behaves the same regardless of which side is primary
Phase 6 — New Primary Validation & Post-Cutover Tasks
SECTION 6.1
🧪

Apply Process Check (MRP0 & RFS)

On the new standby server, query V$MANAGED_STANDBY for the two key processes individually: MRP0 for managed recovery and RFS for the redo receivers.

SQL*Plus — New Standby Server
set lines 300 pages 300

SELECT PROCESS,
       STATUS,
       THREAD#,
       SEQUENCE#
FROM   V$MANAGED_STANDBY
WHERE  PROCESS = 'MRP0';

SELECT PROCESS,
       STATUS,
       THREAD#,
       SEQUENCE#
FROM   V$MANAGED_STANDBY
WHERE  PROCESS = 'RFS';
OutputOUTPUT
PROCESS   STATUS          THREAD#  SEQUENCE#
--------- ------------ ---------- ----------
MRP0      APPLYING_LOG          1     254576

PROCESS   STATUS          THREAD#  SEQUENCE#
--------- ------------ ---------- ----------
RFS       IDLE                  1     254576
RFS       IDLE                  1          0
RFS       IDLE                  0          0
RFS       IDLE                  0          0
SECTION 6.2
🥇

New Primary — Role & Last Sequence

Now validate on the new primary server. V$DATABASE must show the PRIMARY role in READ WRITE mode with a SWITCHOVER_STATUS of TO STANDBY, and the archived-log sequence must be advancing.

SQL*Plus — New Primary Server
sqlplus / as sysdba

set lines 300 pages 300
SELECT name, db_unique_name, database_role,
       protection_mode, protection_level,
       open_mode, switchover_status
FROM   v$database;

SELECT thread#, MAX(sequence#) AS "Last Seq Generated"
FROM   v$archived_log val, v$database vdb
WHERE  val.resetlogs_change# = vdb.resetlogs_change#
GROUP  BY thread#
ORDER  BY thread#;
OutputOUTPUT
NAME      DB_UNIQUE_NAME   DATABASE_ROLE    PROTECTION_MODE      PROTECTION_LEVEL     OPEN_MODE   SWITCHOVER_STATUS
--------- ---------------- ---------------- -------------------- -------------------- ----------- -----------------
PRIMARYDB STANDBYDB        PRIMARY          MAXIMUM PERFORMANCE  MAXIMUM PERFORMANCE  READ WRITE  TO STANDBY

   THREAD# Last Seq Generated
---------- ------------------
         1             254571
📌 Key Notes
  • The new primary is READ WRITE and ready to accept application connections
  • PROTECTION_LEVEL = MAXIMUM PERFORMANCE matches the configured protection mode — redo is shipping to the new standby
SECTION 6.3
🔁

Log Switch Test

Force log switches on the new primary and verify that the sequence advances and is shipped to the new standby. This end-to-end test proves that redo transport works in the reverse direction.

SQL*Plus — New Primary Server
ALTER SYSTEM SWITCH LOGFILE;
/

SELECT thread#, MAX(sequence#) AS "Last Seq Generated"
FROM   v$archived_log val, v$database vdb
WHERE  val.resetlogs_change# = vdb.resetlogs_change#
GROUP  BY thread#
ORDER  BY thread#;

SELECT NAME,
       DB_UNIQUE_NAME,
       DATABASE_ROLE,
       OPEN_MODE
FROM   V$DATABASE;
OutputOUTPUT
System altered.

System altered.

   THREAD# Last Seq Generated
---------- ------------------
         1             254575

NAME      DB_UNIQUE_NAME   DATABASE_ROLE    OPEN_MODE
--------- ---------------- ---------------- --------------------
PRIMARYDB STANDBYDB        PRIMARY          READ WRITE
📌 Key Notes
  • Two log switches advanced the sequence from 254571 to 254575
  • Verify the same sequence is received and applied on the new standby (re-run the Section 4.1 reconciliation)
SECTION 6.4
📤

Redo Destination on the New Primary

Check the archive destination that the Broker has configured on the new primary. LOG_ARCHIVE_DEST_2 must now point to the old primary (the new standby) using asynchronous transport.

SQL*Plus — New Primary Server
SHOW PARAMETER LOG_ARCHIVE_DEST_2
Output — LOG_ARCHIVE_DEST_2OUTPUT
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_2                   string      service="PRIMARYDB", ASYNC NOAFFIRM delay=0 optional compression=disable max_failure=0 reopen=300 db_unique_name="PRIMARYDB" net_timeout=30, valid_for=(online_logfile,all_roles)
📌 Key Notes
  • service="PRIMARYDB" + db_unique_name="PRIMARYDB" confirms redo is now flowing from standby server → primary server
  • This parameter is managed by the Broker — do not edit it manually
SECTION 6.5
🕒

Database Time Zone Alignment

After the cutover the database time zone of the new primary was found to be UTC. To align it with the required business time zone, set the database time zone and restart the instance — the change only takes effect after a restart. Finally verify the value with DBTIMEZONE.

SQL*Plus — New Primary Server
ALTER DATABASE SET TIME_ZONE='Asia/Kolkata';
OutputOUTPUT
Database altered.
SQL*Plus — Restart the Instance
shutdown immediate
STARTUP;
Output — STARTUPOUTPUT
Database closed.
Database dismounted.
ORACLE instance shut down.
ORACLE instance started.

Total System Global Area 1.9797E+10 bytes
Fixed Size                 12445592 bytes
Variable Size            2415919104 bytes
Database Buffers         1.7314E+10 bytes
Redo Buffers               54661120 bytes
Database mounted.
Database opened.
SQL*Plus — Verify
SELECT DBTIMEZONE FROM DUAL;
Output — DBTIMEZONEOUTPUT
DBTIMEZONE
------------
Asia/Kolkata
📌 Post-Cutover Task
  • ALTER DATABASE SET TIME_ZONE only takes effect after the database is restarted
  • The command fails with ORA-30079 if the database contains columns of type TIMESTAMP WITH LOCAL TIME ZONE — check this before the cutover window
  • Replace Asia/Kolkata with the region name that matches your business time zone (query V$TIMEZONE_NAMES for valid values)
  • Perform the restart in an agreed window — redo shipping to the standby resumes automatically once the primary is back up

✅ Final Outcome — Switchover & Role Reversal

The Data Guard switchover completed successfully. A final log switch, re-validation and a SWITCHOVER ... VERIFY readiness check (with alert-log review) were completed immediately before the cutover. All validation checks passed with zero transport and apply lag, no archive gap and an immediately usable switchback path.

✓
Planned Switchover Completed
Broker-driven switchover finished with Switchover succeeded, new primary is "standbydb" — no manual role-conversion commands were required.
✓
All Pre-Checks Passed
Configuration SUCCESS, both databases Ready for Switchover, static connect identifiers validated and TNS connectivity confirmed in both directions.
✓
Final Log Switch & Re-Validation Done
ALTER SYSTEM SWITCH LOGFILE was executed on the primary immediately before the cutover, then the last generated sequence, received-vs-applied cross-check, MRP0/RFS state, last applied sequence and applied-log status were all re-validated.
✓
Go / No-Go Gate Passed
The standby had received and applied the sequence generated by the final log switch — primary generated = standby applied — before the switchover command was issued.
✓
Switchover VERIFY Run & Alert Log Reviewed
ALTER DATABASE SWITCHOVER TO STANDBYDB VERIFY — a dry run that performs no role change — was executed on the primary and the primary and standby alert logs were reviewed for SWITCHOVER VERIFY messages before the real switchover was started.
✓
Zero Lag & No Archive Gap
Transport lag and apply lag at +00 00:00:00 with sequence difference 0 before the cutover, and 0 seconds lag with difference 0 immediately after the role change — no redo was lost.
✓
Roles Reversed in the Broker
STANDBYDB is the primary and PRIMARYDB is the physical standby; configuration status remains SUCCESS.
✓
Reverse Redo Shipping Active
LOG_ARCHIVE_DEST_2 on the new primary ships asynchronously to the new standby; MRP0 is APPLYING_LOG and RFS is IDLE.
✓
Switchback Ready
Both members still report Ready for Switchover: Yes and Ready for Failover: Yes with sufficient standby redo logs (3 ORL / 4 SRL, 200 MB).
✓
Database Time Zone Aligned
DBTIMEZONE corrected on the new primary and verified after the restart.
📌 Implementation Reference
  • Document Type: Sample Reference — Based on Real-World Implementation
  • All technical procedures, commands, and outcomes reflect actual cutover steps
  • All server identifiers, hostnames, IPs, database and customer names, application user names and timestamps replaced with generic placeholders
  • Oracle Version: 19c (19.3.0.0.0) — Protection Mode: Maximum Performance — Broker: Enabled