Showing posts with label Oracle Database 19c. Show all posts
Showing posts with label Oracle Database 19c. Show all posts

Tuesday, February 10, 2026

Oracle Data Guard DR Activation: Opening a Standby Database in READ WRITE Mode


Opening a DR Database in READ WRITE Mode in Oracle

Complete Step-by-Step Guide with Warnings & DR Flow Diagram

In an Oracle Disaster Recovery (DR) setup using Data Guard, the standby database is designed to protect the business from outages—not to be casually opened in READ WRITE mode.

Opening a DR database in READ WRITE mode is a critical operation that effectively promotes the standby to a new primary. This blog explains when, why, and how to do it correctly, with required checks, warnings, and a clear DR activation flow.


Understanding the DR Standby Database

  • Primary database runs in READ WRITE
  • DR database runs as PHYSICAL STANDBY
  • Redo is shipped and applied continuously
  • Standby remains in MOUNT or READ ONLY mode

Note: A physical standby cannot be opened READ WRITE unless it is activated.

When Should DR Be Opened in READ WRITE Mode?

  • Actual primary database outage
  • Declared Disaster Recovery event
  • Approved failover / cutover
  • Business-approved DR drill (with rebuild planned)

DR Activation Flow Diagram (Primary → Standby → New Primary)

PRIMARY DATABASE (Production)
        |
        | Redo Transport
        v
PHYSICAL STANDBY (DR)
(MOUNT / READ ONLY)
        |
        | ALTER DATABASE ACTIVATE STANDBY DATABASE
        v
NEW PRIMARY DATABASE
(READ WRITE)

Step 1: Confirm You Are on the DR Database

Verify database role before making any changes:

SELECT name, open_mode, database_role FROM v$database;

Expected output:

DATABASE_ROLE = PHYSICAL STANDBY
OPEN_MODE     = MOUNTED or READ ONLY

Step 2: Verify DR Is Fully in Sync (BEFORE Activation)

Synchronization checks must be done before activation.

Check redo apply status

SELECT process, status FROM v$managed_standby;

Ensure MRP0 is applying redo.

Check transport and apply lag

SELECT name, value, unit
FROM v$dataguard_stats
WHERE name IN ('transport lag','apply lag');

Ideal result:

transport lag = 0 seconds
apply lag     = 0 seconds

Step 3: Stop Managed Recovery

Redo apply must be stopped explicitly:

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

🚨 Critical Warning: Point-of-No-Return Command

⚠️ EXTREME CAUTION REQUIRED

ALTER DATABASE ACTIVATE STANDBY DATABASE;

This command permanently converts the standby database into a PRIMARY. After execution:

  • Data Guard is irreversibly broken
  • Redo shipping cannot resume
  • Synchronization checks no longer apply
  • Restore points cannot revert the role
  • Flashback cannot recreate a standby
  • A full standby rebuild is mandatory

There is NO rollback for this command. Execute only with business approval and confirmed DR conditions.

Step 4: Activate the Standby Database

ALTER DATABASE ACTIVATE STANDBY DATABASE;

Step 5: Restart the Database

SHUTDOWN IMMEDIATE;
STARTUP;

Step 6: Open the Database in READ WRITE Mode

ALTER DATABASE OPEN;

Verify final status:

SELECT name, open_mode, database_role FROM v$database;

Expected:

DATABASE_ROLE = PRIMARY
OPEN_MODE     = READ WRITE

Important Note: No Sync or Restore Point Checks After Activation

After activation, the database is no longer a standby. There is no primary–standby relationship, so synchronization queries are not meaningful. Restore points cannot restore Data Guard and Flashback cannot revert the role. To restore DR protection, you must rebuild a new standby database.

Post-Activation Validation Checks

SELECT instance_name, status FROM v$instance;
SELECT switchover_status FROM v$database;
SHOW PARAMETER db_unique_name;

Key Takeaways

  • Physical standby cannot open READ WRITE without activation
  • ACTIVATE STANDBY DATABASE is a one-way command
  • Complete all sync checks before activation
  • After DR usage, rebuild standby to restore DR protection

Final Thoughts

Opening a DR database in READ WRITE mode is not just a technical task—it’s a business decision. Treat DR activation as a controlled emergency, not a routine command.

Oracle EBS Database Patching on Linux x86-64: Applying CPU (DB RU) + OJVM (Oct 2025)

Oracle EBS Database Patching on Linux x86-64: Applying CPU (DB RU) + OJVM (Oct 2025) Like a Pro

If you manage an Oracle E-Business Suite (EBS) environment, one thing is non-negotiable: quarterly security patching. Oracle releases Critical Patch Updates (CPU) every quarter, and for the Database tier these typically arrive as Release Updates (RU). Along with the RU, Oracle also delivers OJVM (Oracle JavaVM) patches which address Java-related vulnerabilities and database JVM fixes.

In this post, I’m documenting a practical, DBA-friendly approach to applying Oct 2025 CPU patches for Oracle Database 19c on Linux x86-64 for an EBS system—keeping it simple, safe, and production-ready.


1) What we are patching and why

CPU / DB RU (Release Update)

The Database RU is Oracle’s quarterly cumulative patch that includes:

  • Security fixes (CVE fixes)
  • Critical defect fixes
  • Stability improvements

OJVM Patch

OJVM patches fix vulnerabilities and issues related to the Java VM inside the database. In many environments, DB RU and OJVM are applied together as part of the quarterly patch cycle.


2) Key patches for Oct 2025 (Oracle Database 19c)

From Oracle’s Patch Availability Document (Oct 2025 CPU PAD – DB-only), the main patch paths for 19c are:

Option A: Combo Patch (DB RU + OJVM together)

  • Combo RU + OJVM 19.29.0.0.251021 – Patch 38273545

This is often the easiest path because RU and OJVM are packaged together.

Option B: Apply DB RU and OJVM separately

  • DB RU 19.29.0.0.251021 – Patch 38291812
  • OJVM RU 19.29.0.0.251021 – Patch 38194382

This approach is common when DB RU is already applied and OJVM is pending, your change window is split, or you have sequencing constraints.

Optional but commonly required in many enterprises

  • OPatch requirement: OPatch 12.2.0.1.48+
  • JDK patch (if mandated): JDK8u471 Patch 38245243

3) My patching mindset for EBS systems

EBS is not just a database; it’s an application ecosystem. Even if we are patching only the Database home, the discipline remains the same:

  • Do conflict checks (avoid surprises)
  • Have a rollback plan
  • Take a reliable backup
  • Run datapatch cleanly
  • Validate in DBA_REGISTRY_SQLPATCH
  • Do a basic EBS smoke test (login + concurrent manager, if applicable)

4) Pre-checks before you touch anything

Check current DB & patch level

select * from v$version;

select patch_id, patch_type, action, status,
       to_char(action_time,'DD-MON-YYYY HH24:MI') action_time
from dba_registry_sqlpatch
order by action_time desc;

Check OPatch version

$ORACLE_HOME/OPatch/opatch version

Run conflict check (recommended)

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /path/to/unzipped_patch

Backup (minimum expectation)

  • RMAN backup / snapshot / cold backup as per your org standards
  • Backup inventory metadata if required

5) Patching Steps (DB RU + OJVM) — the clean runbook

Below is the cleanest standard process for most EBS environments.

Method 1: Combo Patch (DB RU + OJVM together)

Patch: 38273545

Step 1 — Stage the patch

mkdir -p /u01/stage/CPU_OCT2025_19c
cd /u01/stage/CPU_OCT2025_19c
unzip p38273545_190000_Linux-x86-64.zip

Step 2 — Shutdown the database

sqlplus / as sysdba <<EOF
shutdown immediate;
exit;
EOF

Step 3 — Apply patch using OPatch

cd /u01/stage/CPU_OCT2025_19c/<patch_dir>
$ORACLE_HOME/OPatch/opatch apply

Step 4 — Startup database

sqlplus / as sysdba <<EOF
startup;
exit;
EOF

Step 5 — Run datapatch

cd $ORACLE_HOME/OPatch
./datapatch -verbose

Step 6 — Validate success

select patch_id, patch_type, action, status,
       to_char(action_time,'DD-MON-YYYY HH24:MI') action_time
from dba_registry_sqlpatch
order by action_time desc;

Method 2: Apply DB RU and OJVM separately

Use this method if you are applying:

  • DB RU: 38291812
  • OJVM RU: 38194382

Phase A — Apply DB RU

  1. Shutdown DB
  2. OPatch apply DB RU
  3. Startup DB
  4. Run datapatch

Phase B — Apply OJVM RU

  1. Shutdown DB
  2. OPatch apply OJVM
  3. Startup DB
  4. Run datapatch again

Why datapatch twice?

Because each patch updates SQL components differently, and Oracle expects SQL patch registration after each change.


6) Post-patching validation checklist (what I always verify)

OPatch inventory

$ORACLE_HOME/OPatch/opatch lsinventory | egrep "38273545|38291812|38194382|19\.29"

SQL patch registry

select patch_id, patch_type, action, status,
       to_char(action_time,'DD-MON-YYYY HH24:MI') action_time
from dba_registry_sqlpatch
order by action_time desc;

Component status

select comp_id, comp_name, version, status
from dba_registry;

Optional but useful checks

  • Invalid objects count (before vs after)
  • Listener status
  • Basic EBS login smoke test (if apps involved)
  • Concurrent manager sanity (if your change plan includes it)

7) Common issues and quick DBA fixes

OPatch too old

Symptom: Patch fails at start
Fix: Upgrade OPatch to the required version first.

Conflict with one-off patches

Symptom: Conflict detected
Fix: Use MOS Conflict Checker and request merged patch if needed.

datapatch errors

Symptom: SQL patch not registered / failures
Fix: Review datapatch logs, ensure DB/PDB state is correct, and rerun datapatch after fixing root cause.


Conclusion

Applying CPU + OJVM patches on an EBS database is not hard—but it must be disciplined. For Oct 2025 on 19c Linux x86-64, you can either:

  • Go with the Combo patch for simplicity, or
  • Apply DB RU then OJVM separately for flexible scheduling

Either way, the real success factor is: conflict check + clean datapatch + solid validation.