Introduction
A Release Update (RU) is Oracle's primary method for delivering both bug fixes and new features for Oracle Database versions 12.2 and later. Introduced to replace the older Patch Set Updates (PSUs) and Critical Patch Updates (CPUs), RUs are part of Oracle's shift toward a more predictable and modern patching model. In this article, we'll apply the Oracle RU 19.27 patch to both a primary and a standby database.
Data Guard Standby-First Patch Apply
Since Data Guard is configured, Oracle's standard recommendation is to apply the patch to the standby database first. Before doing so, always check the patch ReadMe to confirm the patch is Data Guard Standby-First Installable, not every patch supports this. See Oracle Doc 1265700.1 for details on this requirement.
Approach
- Apply the patch at the binary level on the standby.
- Apply the patch at the binary level on the primary.
- Confirm primary and standby are back in sync.
- Run datapatch (the SQL-level patch) on the primary, then verify sync once more.
Prerequisites
- Plan for roughly 120 minutes of database downtime.
- At least 15GB free in the
ORACLE_HOMEmount point, plus an additional 25GB for the patch download and binary backup. - Download the RU patch and the required OPatch utility:
Environment Used in This Guide
| Server | Primary | Standby |
|---|---|---|
| Hostname | Source | Target |
| IP | 192.168.80.51 | 192.168.80.111 |
| OS | OEL 9 | OEL 9 |
| SID | ORCLDC | ORCLDR |
| Current Patch Version | 19.24 | 19.24 |
Part 1: Apply the Patch on the Standby
Step 1: Copy the Patch and OPatch, Then Update OPatch
The patch itself often requires a newer OPatch version than what's currently installed, so we back up the existing OPatch directory and replace it before doing anything else.
[oracle@target patches]$ pwd
/u01/app/oracle/patches
[oracle@target patches]$ ls -lrth
total 2.2G
-rw-r--r--. 1 oracle oinstall 2.2G May 4 15:14 p37642901_190000_Linux-x86-64.zip
-rw-r--r--. 1 oracle oinstall 70M May 4 15:14 p6880880_190000_Linux-x86-64_V46.zip
[oracle@target patches]$
[oracle@target patches]$ unzip 19_27_p37642901_190000_Linux-x86-64.zip
[oracle@target patches]$ ls
p37642901_190000_Linux-x86-64.zip 37642901 p6880880_190000_Linux-x86-64_V46.zip PatchSearch.xml
[oracle@target patches]$
[oracle@target backup]$ cd $ORACLE_HOME
[oracle@target dbhome_1]$ OPatch/./opatch version
OPatch Version: 12.2.0.1.43
OPatch succeeded.
[oracle@target dbhome_1]$
[oracle@target dbhome_1]$ mv OPatch OPatch_bkp
[oracle@target patches]$ cd /u01/app/oracle/patches
[oracle@target patches]$ unzip p6880880_190000_Linux-x86-64_V46.zip -d $ORACLE_HOME
[oracle@target backup]$ cd $ORACLE_HOME
[oracle@target dbhome_1]$ OPatch/./opatch version
OPatch Version: 12.2.0.1.46
OPatch succeeded.
[oracle@target dbhome_1]$
Step 2: Check Sync Between Primary and Standby
Confirm both databases are fully caught up before taking the standby offline for patching, a lagging standby going into a patching window is a much harder problem to troubleshoot afterward.
Primary:
SQL> select name,db_unique_name,database_role,open_mode from v$database;
NAME DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE
--------- ------------------------------ ---------------- --------------------
ORCL ORCLDC PRIMARY READ WRITE
SQL>
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#, MAX(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
------------------------------ ---------------- ---------- ---------- ----------- -------------------- ----------
ORCLDC PRIMARY 1 267 267 04-MAY-2025 14:24:11 0
SQL>
Standby:
SQL> select name,db_unique_name,database_role,open_mode from v$database;
NAME DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE
--------- ------------------------------ ---------------- --------------------
ORCL ORCLDR PHYSICAL STANDBY MOUNTED
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
------------------------------ ---------------- ---------- ---------- ----------- ---------- -------------------- ----------- --------------
ORCLDR PHYSICAL STANDBY 1 267 267 0 04-MAY-2025 14:24:11 .43 26
SQL>
Step 3: Disable Log Shipment on the Primary
Pausing redo transport to the standby prevents it from receiving (and potentially half-applying) logs while its binaries are mid-patch.
SQL> show parameter log_archive_dest_state_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_2 string ENABLE
SQL> alter system set log_archive_dest_state_2=DEFER;
System altered.
SQL> show parameter log_archive_dest_state_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_2 string DEFER
Step 4: Stop MRP and Shut Down the Standby
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> shut immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.24.0.0.0
[oracle@target ~]$
Step 5: Back Up the ORACLE_HOME Binaries
This tar backup is your rollback path if the patch application fails or causes issues, always take it before touching the binaries.
[oracle@target backup]$ pwd
/u01/app/oracle/backup
[oracle@target backup]$
[oracle@target backup]$ env|grep ORA
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
ORACLE_SID=orcldr
ORA_INVENTORY=/u01/app/oraInventory
[oracle@target backup]$
[oracle@target backup]$
[oracle@target backup]$ tar -cvf /u01/app/oracle/backup/DB_HOME_19_24.tar /u01/app/oracle/product/19.0.0
[oracle@target backup]$ ls -lrth
total 11G
-rw-r--r--. 1 oracle oinstall 11G May 4 14:49 DB_HOME_19_24.tar
[oracle@target backup]$
Step 6: Check Currently Applied Patches
[oracle@target ~]$ cd $ORACLE_HOME/OPatch
[oracle@target OPatch]$
[oracle@target OPatch]$ ./opatch lsinventory| grep -i applied
Patch 36582781 : applied on Sun Sep 29 11:18:33 IST 2024
Patch 29585399 : applied on Thu Apr 18 12:51:33 IST 2019
[oracle@target OPatch]$
[oracle@target OPatch]$ ./opatch lspatches
36582781;Database Release Update : 19.24.0.0.240716 (36582781)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
OPatch succeeded.
[oracle@target OPatch]$
Step 7: Run the Patch Conflict Precheck
This checks whether the new patch conflicts with anything already installed in the Oracle Home, catching a bad conflict here is far better than discovering it mid-apply.
[oracle@target patches]$ ls
p37642901_190000_Linux-x86-64.zip 37642901 p6880880_190000_Linux-x86-64_V46.zip PatchSearch.xml
[oracle@target patches]$
[oracle@target patches]$ cd 37642901
[oracle@target 37642901]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.46
Copyright (c) 2025, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/oracle/product/19.0.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/19.0.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.46
OUI version : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2025-05-04_15-34-10PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
[oracle@target 37642901]$
Step 8: Apply the Patch
[oracle@target 37642901]$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.46
Copyright (c) 2025, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/19.0.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/19.0.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.46
OUI version : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2025-05-04_15-39-19PM_1.log
Verifying environment and performing prerequisite checks...
--------------------------------------------------------------------------------
Start OOP by Prereq process.
Launch OOP...
Oracle Interim Patch Installer version 12.2.0.1.46
Copyright (c) 2025, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/19.0.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/19.0.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.46
OUI version : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2025-05-04_15-41-51PM_1.log
Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 37642901
Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/19.0.0/dbhome_1')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '37642901' to OH '/u01/app/oracle/product/19.0.0/dbhome_1'
ApplySession: Optional component(s) not present in the Oracle Home or a higher version is found.
Patching component oracle.rdbms, 19.0.0.0.0...
...(remaining component patching output omitted for brevity)...
Patching component oracle.jdk, 1.8.0.201.0...
Patch 37642901 successfully applied.
Sub-set patch [36582781] has become inactive due to the application of a super-set patch [37642901].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2025-05-04_15-41-51PM_1.log
OPatch succeeded.
[oracle@target 37642901]$
Notice the note that patch 36582781 (the old 19.24 RU) has become inactive since 37642901 is a superset patch. This is expected, the new RU fully supersedes the old one at the binary level.
Step 9: Confirm the New Patch Is Applied
[oracle@target 37642901]$ cd $ORACLE_HOME/OPatch
[oracle@target OPatch]$
[oracle@target OPatch]$ ./opatch lsinventory| grep -i applied
Patch 37642901 : applied on Sun May 04 15:54:47 IST 2025
Patch 29585399 : applied on Thu Apr 18 12:51:33 IST 2019
[oracle@target OPatch]$
[oracle@target OPatch]$ ./opatch lspatches
37642901;Database Release Update : 19.27.0.0.250415 (37642901)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
OPatch succeeded.
[oracle@target OPatch]$
Step 10: Start the Standby and Restart MRP
[oracle@target ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sun May 4 17:21:14 2025
Version 19.27.0.0.0
Copyright (c) 1982, 2024, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
Total System Global Area 1459616616 bytes
Fixed Size 9177960 bytes
Variable Size 1224736768 bytes
Database Buffers 218103808 bytes
Redo Buffers 7598080 bytes
Database mounted.
SQL>
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL>
Step 11: Re-enable Log Shipment on the Primary
SQL> show parameter log_archive_dest_state_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_2 string DEFER
SQL> alter system set log_archive_dest_state_2=ENABLE;
System altered.
SQL> show parameter log_archive_dest_state_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_2 string ENABLE
Step 12: Verify Sync Between Primary and Standby
Primary:
SQL> select name,db_unique_name,database_role,open_mode from v$database;
NAME DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE
--------- ------------------------------ ---------------- --------------------
ORCL ORCLDC PRIMARY READ WRITE
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#, MAX(sequence#) applied_seq, MAX(next_time) last_app_timestamp from gv$archived_log where applied='YES' group by thread#) a,
SQL> (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
------------------------------ ---------------- ---------- ---------- ----------- -------------------- ----------
ORCLDC PRIMARY 1 268 268 04-MAY-2025 17:24:17 0
SQL>
Standby:
SQL> select name,db_unique_name,database_role,open_mode from v$database;
NAME DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE
--------- ------------------------------ ---------------- --------------------
ORCL ORCLDR PHYSICAL STANDBY MOUNTED
SQL>
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 SQL> 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
------------------------------ ---------------- ---------- ---------- ----------- ---------- -------------------- ----------- --------------
ORCLDR PHYSICAL STANDBY 1 268 268 0 04-MAY-2025 17:24:17 12.28 737
With the standby fully patched, at 19.27, and back in sync, we can move on to patching the primary.
Part 2: Apply the Patch on the Primary
The steps here largely mirror what we just did on the standby, with two differences worth noting: we run a fuller precheck (invalid objects, component registry) since this is the primary, and we run datapatch at the end, which we didn't need to do on the standby.
Step 1: Copy the Patch and OPatch to the Primary
[oracle@source patches]$ pwd
/u01/app/oracle/patches
[oracle@source patches]$ ls -lrth
total 2.2G
-rw-r--r--. 1 oracle oinstall 2.2G May 4 18:29 p37642901_190000_Linux-x86-64.zip
-rw-r--r--. 1 oracle oinstall 70M May 4 18:29 p6880880_190000_Linux-x86-64_V46.zip
[oracle@source patches]$
[oracle@source patches]$ unzip 19_27_p37642901_190000_Linux-x86-64.zip
[oracle@source patches]$ ls
p37642901_190000_Linux-x86-64.zip 37642901 p6880880_190000_Linux-x86-64_V46.zip PatchSearch.xml
[oracle@source patches]$
[oracle@source backup]$ cd $ORACLE_HOME
[oracle@source dbhome_1]$ OPatch/./opatch version
OPatch Version: 12.2.0.1.43
OPatch succeeded.
[oracle@source dbhome_1]$
[oracle@source dbhome_1]$ mv OPatch OPatch_bkp
[oracle@source patches]$ cd /u01/app/oracle/patches
[oracle@source patches]$ unzip p6880880_190000_Linux-x86-64_V46.zip -d $ORACLE_HOME
[oracle@source backup]$ cd $ORACLE_HOME
[oracle@source dbhome_1]$ OPatch/./opatch version
OPatch Version: 12.2.0.1.46
OPatch succeeded.
[oracle@source dbhome_1]
Step 2: Run a Full Precheck on the Primary
Since this is the primary, check both the CDB root and each PDB for invalid objects before proceeding, catching problems here is much easier than after patching.
SQL> select name,db_unique_name,database_role,open_mode from v$database;
NAME DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE
--------- ------------------------------ ---------------- --------------------
ORCL ORCLDC PRIMARY READ WRITE
SQL>
SQL> select BANNER_FULL from v$version;
BANNER_FULL
--------------------------------------------------------------------------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.24.0.0.0
SQL> col ACTION_TIME for a20
SQL> col ACTION for a10
SQL> col STATUS for a10
SQL> col DESCRIPTION for a60
SQL> select patch_uid,patch_id,SOURCE_VERSION, TARGET_VERSION, action, status,action_time,description from dba_registry_sqlpatch;
PATCH_UID PATCH_ID SOURCE_VERSION TARGET_VERSION ACTION STATUS ACTION_TIME DESCRIPTION
---------- ---------- --------------- --------------- ---------- ---------- -------------------- ------------------------------------------------------------
25751445 36582781 19.1.0.0.0 19.24.0.0.0 APPLY SUCCESS 22-JAN-25 12.15.07.4 Database Release Update : 19.24.0.0.240716 (36582781)
85121 AM
SQL> col comp_id for a10
SQL> col version for a11
SQL> col status for a10
SQL> col comp_name for a37
SQL> select comp_id,comp_name,version,status from dba_registry;
COMP_ID COMP_NAME VERSION STATUS
---------- ------------------------------------- ----------- ----------
CATALOG Oracle Database Catalog Views 19.0.0.0.0 VALID
CATPROC Oracle Database Packages and Types 19.0.0.0.0 VALID
RAC Oracle Real Application Clusters 19.0.0.0.0 OPTION OFF
JAVAVM JServer JAVA Virtual Machine 19.0.0.0.0 VALID
XML Oracle XDK 19.0.0.0.0 VALID
CATJAVA Oracle Database Java Packages 19.0.0.0.0 VALID
APS OLAP Analytic Workspace 19.0.0.0.0 VALID
XDB Oracle XML Database 19.0.0.0.0 VALID
OWM Oracle Workspace Manager 19.0.0.0.0 VALID
CONTEXT Oracle Text 19.0.0.0.0 VALID
ORDIM Oracle Multimedia 19.0.0.0.0 VALID
SDO Spatial 19.0.0.0.0 VALID
XOQ Oracle OLAP API 19.0.0.0.0 VALID
OLS Oracle Label Security 19.0.0.0.0 VALID
DV Oracle Database Vault 19.0.0.0.0 VALID
15 rows selected.
SQL> select count(*) from dba_objects where status='INVALID';
COUNT(*)
----------
0
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB READ WRITE NO
SQL>
SQL> alter session set container=ORCLPDB;
Session altered.
SQL> select comp_id,comp_name,version,status from dba_registry;
COMP_ID COMP_NAME VERSION STATUS
---------- ------------------------------------- ----------- ----------
CATALOG Oracle Database Catalog Views 19.0.0.0.0 VALID
CATPROC Oracle Database Packages and Types 19.0.0.0.0 VALID
RAC Oracle Real Application Clusters 19.0.0.0.0 OPTION OFF
JAVAVM JServer JAVA Virtual Machine 19.0.0.0.0 VALID
XML Oracle XDK 19.0.0.0.0 VALID
CATJAVA Oracle Database Java Packages 19.0.0.0.0 VALID
APS OLAP Analytic Workspace 19.0.0.0.0 VALID
XDB Oracle XML Database 19.0.0.0.0 VALID
OWM Oracle Workspace Manager 19.0.0.0.0 VALID
CONTEXT Oracle Text 19.0.0.0.0 VALID
ORDIM Oracle Multimedia 19.0.0.0.0 VALID
SDO Spatial 19.0.0.0.0 VALID
XOQ Oracle OLAP API 19.0.0.0.0 VALID
OLS Oracle Label Security 19.0.0.0.0 VALID
DV Oracle Database Vault 19.0.0.0.0 VALID
15 rows selected.
SQL> select count(*) from dba_objects where status='INVALID';
COUNT(*)
----------
0
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.24.0.0.0
[oracle@source ~]$ cd $ORACLE_HOME/OPatch
[oracle@source OPatch]$
[oracle@source OPatch]$ ./opatch lsinventory| grep -i applied
Patch 36582781 : applied on Sun Sep 29 11:18:33 IST 2024
Patch 29585399 : applied on Thu Apr 18 12:51:33 IST 2019
[oracle@source OPatch]$
[oracle@source OPatch]$ ./opatch lspatches
36582781;Database Release Update : 19.24.0.0.240716 (36582781)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
OPatch succeeded.
[oracle@source OPatch]
Step 3: Disable Log Shipment
SQL> show parameter log_archive_dest_state_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_2 string ENABLE
SQL> alter system set log_archive_dest_state_2=DEFER;
System altered.
SQL> show parameter log_archive_dest_state_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_2 string DEFER
Step 4: Stop MRP on the Standby
SQL> alter database recover managed standby database cancel;
Database altered.
Step 5: Run the Patch Conflict Precheck
[oracle@source patch]$ ls
p37642901_190000_Linux-x86-64.zip 37642901 p6880880_190000_Linux-x86-64_V46.zip PatchSearch.xml
[oracle@source patch]$ cd 37642901/
[oracle@source 37642901]$
[oracle@source 37642901]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.46
Copyright (c) 2025, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/oracle/product/19.0.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/19.0.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.46
OUI version : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2025-05-04_18-44-36PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
[oracle@source 37642901]$
Step 6: Stop the Database and Listener on the Primary
[oracle@source ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sun May 4 17:53:42 2025
Version 19.24.0.0.0
Copyright (c) 1982, 2024, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.24.0.0.0
SQL>
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.24.0.0.0
[oracle@source ~]$
[oracle@source ~]$
[oracle@source ~]$ lsnrctl stop
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 04-MAY-2025 17:54:34
Copyright (c) 1991, 2024, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=source.localdomain)(PORT=1521)))
The command completed successfully
[oracle@source ~]$
Step 7: Back Up the ORACLE_HOME Binaries
[oracle@source backup]$
[oracle@source backup]$ env|grep ORA
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
ORACLE_SID=orcldc
ORA_INVENTORY=/u01/app/oraInventory
[oracle@source backup]$
[oracle@source backup]$ tar -cvf /u01/app/oracle/backup/DB_HOME_19_24.tar /u01/app/oracle/product/19.0.0
[oracle@source backup]$ ls -lrth
total 11G
-rw-r--r--. 1 oracle oinstall 11G May 4 18:06 DB_HOME_19_24.tar
[oracle@source backup]$
Step 8: Apply the Patch
[oracle@source 37642901]$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.46
Copyright (c) 2025, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/19.0.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/19.0.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.46
OUI version : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2025-05-04_18-59-01PM_1.log
Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 37642901
Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/19.0.0/dbhome_1')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '37642901' to OH '/u01/app/oracle/product/19.0.0/dbhome_1'
ApplySession: Optional component(s) not present in the Oracle Home or a higher version is found.
Patching component oracle.rdbms, 19.0.0.0.0...
...(remaining component patching output omitted for brevity)...
Patching component oracle.jdk, 1.8.0.201.0...
Patch 37642901 successfully applied.
Sub-set patch [36582781] has become inactive due to the application of a super-set patch [37642901].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2025-05-04_18-59-01PM_1.log
OPatch succeeded.
[oracle@source 37642901]$
[oracle@source 37642901]$
Step 9: Confirm the New Patch Is Applied
[oracle@source OPatch]$ cd $ORACLE_HOME/OPatch
[oracle@source OPatch]$ ./opatch lspatches
37642901;Database Release Update : 19.27.0.0.250415 (37642901)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
OPatch succeeded.
[oracle@source OPatch]$
[oracle@source OPatch]$ ./opatch lsinventory| grep -i applied
Patch 37642901 : applied on Sun May 04 19:10:36 IST 2025
Patch 29585399 : applied on Thu Apr 18 12:51:33 IST 2019
[oracle@source OPatch]$
Step 10: Start the Database and Listener
[oracle@source ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sun May 4 19:42:21 2025
Version 19.27.0.0.0
Copyright (c) 1982, 2024, Oracle. All rights reserved.
Connected to an idle instance.
SQL>
SQL> startup
ORACLE instance started.
Total System Global Area 1459616616 bytes
Fixed Size 9177960 bytes
Variable Size 1207959552 bytes
Database Buffers 234881024 bytes
Redo Buffers 7598080 bytes
Database mounted.
Database opened.
SQL>
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB READ WRITE NO
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.27.0.0.0
[oracle@source ~]$ lsnrctl start
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 04-MAY-2025 19:50:18
Copyright (c) 1991, 2025, Oracle. All rights reserved.
Starting /u01/app/oracle/product/19.0.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/source/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=source.localdomain)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=source.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 04-MAY-2025 19:50:18
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/19.0.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/source/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=source.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
[oracle@source ~]$
Step 11: Re-enable Log Shipment
SQL> show parameter log_archive_dest_state_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_2 string DEFER
SQL> alter system set log_archive_dest_state_2=ENABLE;
System altered.
SQL> show parameter log_archive_dest_state_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_2 string ENABLE
Step 12: Start MRP on the Standby
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL>
Step 13: Verify Sync Between Primary and Standby
Primary:
SQL> select name,db_unique_name,database_role,open_mode from v$database;
NAME DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE
--------- ------------------------------ ---------------- --------------------
ORCL ORCLDC PRIMARY READ WRITE
SQL>
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#, MAX(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
------------------------------ ---------------- ---------- ---------- ----------- -------------------- ----------
ORCLDC PRIMARY 1 271 271 04-MAY-2025 19:57:10 0
SQL>
Standby:
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
------------------------------ ---------------- ---------- ---------- ----------- ---------- -------------------- ----------- --------------
ORCLDR PHYSICAL STANDBY 1 271 271 0 04-MAY-2025 19:57:10 1.62 97
SQL>
Step 14: Run Datapatch
This is the step that didn't apply to the standby. Datapatch updates the SQL-level objects (packages, views) inside each PDB and the CDB root to match the newly patched binaries, without this, the binaries and the database's internal SQL registry would be out of sync.
[oracle@source ~]$ cd $ORACLE_HOME/OPatch
[oracle@source OPatch]$ ./datapatch -verbose
SQL Patching tool version 19.27.0.0.0 Production on Sun May 4 20:59:47 2025
Copyright (c) 2012, 2025, Oracle. All rights reserved.
Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_19458_2025_05_04_20_59_47/sqlpatch_invocation.log
Connecting to database...OK
Gathering database info...done
Note: Datapatch will only apply or rollback SQL fixes for PDBs
that are in an open state, no patches will be applied to closed PDBs.
Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
(Doc ID 1585822.1)
Bootstrapping registry and package to current versions...done
Determining current state...done
Current state of interim SQL patches:
No interim patches found
Current state of release update SQL patches:
Binary registry:
19.27.0.0.0 Release_Update 250406131139: Installed
PDB CDB$ROOT:
Applied 19.24.0.0.0 Release_Update 240627235157 successfully on 22-JAN-25 12.15.07.485121 AM
PDB ORCLPDB:
Applied 19.24.0.0.0 Release_Update 240627235157 successfully on 22-JAN-25 12.53.22.669280 AM
PDB PDB$SEED:
Applied 19.24.0.0.0 Release_Update 240627235157 successfully on 22-JAN-25 12.53.22.669280 AM
Adding patches to installation queue and performing prereq checks...done
Installation queue:
For the following PDBs: CDB$ROOT PDB$SEED ORCLPDB
No interim patches need to be rolled back
Patch 37642901 (Database Release Update : 19.27.0.0.250415 (37642901)):
Apply from 19.24.0.0.0 Release_Update 240627235157 to 19.27.0.0.0 Release_Update 250406131139
No interim patches need to be applied
Installing patches...
Patch installation complete. Total patches installed: 3
Validating logfiles...done
Patch 37642901 apply (pdb CDB$ROOT): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/37642901/27123174/37642901_apply_ORCL_CDBROOT_2025May04_21_01_06.log (no errors)
Patch 37642901 apply (pdb PDB$SEED): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/37642901/27123174/37642901_apply_ORCL_PDBSEED_2025May04_21_07_51.log (no errors)
Patch 37642901 apply (pdb ORCLPDB): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/37642901/27123174/37642901_apply_ORCL_ORCLPDB_2025May04_21_07_52.log (no errors)
SQL Patching tool complete on Sun May 4 21:16:43 2025
Notice datapatch applies to CDB$ROOT, PDB$SEED, and ORCLPDB, all three containers separately, since each maintains its own SQL patch registry.
Step 15: Take the Post-Check
[oracle@source ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sun May 4 21:23:37 2025
Version 19.27.0.0.0
Copyright (c) 1982, 2024, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.27.0.0.0
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB READ WRITE NO
SQL>
SQL> select name,db_unique_name,database_role,open_mode from v$database;
NAME DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE
--------- ------------------------------ ---------------- --------------------
ORCL ORCLDC PRIMARY READ WRITE
SQL> select BANNER_FULL from v$version;
BANNER_FULL
--------------------------------------------------------------------------------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.27.0.0.0
SQL> set lines 333 pages 333
SQL> col ACTION_TIME for a20
SQL> col ACTION for a10
SQL> col STATUS for a10
SQL> col DESCRIPTION for a60
SQL> select patch_uid,patch_id,SOURCE_VERSION, TARGET_VERSION, action, status,action_time,description from dba_registry_sqlpatch;
PATCH_UID PATCH_ID SOURCE_VERSION TARGET_VERSION ACTION STATUS ACTION_TIME DESCRIPTION
---------- ---------- --------------- --------------- ---------- ---------- -------------------- ------------------------------------------------------------
25751445 36582781 19.1.0.0.0 19.24.0.0.0 APPLY SUCCESS 22-JAN-25 12.15.07.4 Database Release Update : 19.24.0.0.240716 (36582781)
85121 AM
27123174 37642901 19.24.0.0.0 19.27.0.0.0 APPLY SUCCESS 04-MAY-25 09.06.41.8 Database Release Update : 19.27.0.0.250415 (37642901)
92191 PM
SQL> col comp_id for a10
SQL> col version for a11
SQL> col status for a10
SQL> col comp_name for a37
SQL> select comp_id,comp_name,version,status from dba_registry;
COMP_ID COMP_NAME VERSION STATUS
---------- ------------------------------------- ----------- ----------
CATALOG Oracle Database Catalog Views 19.0.0.0.0 VALID
CATPROC Oracle Database Packages and Types 19.0.0.0.0 VALID
RAC Oracle Real Application Clusters 19.0.0.0.0 OPTION OFF
JAVAVM JServer JAVA Virtual Machine 19.0.0.0.0 VALID
XML Oracle XDK 19.0.0.0.0 VALID
CATJAVA Oracle Database Java Packages 19.0.0.0.0 VALID
APS OLAP Analytic Workspace 19.0.0.0.0 VALID
XDB Oracle XML Database 19.0.0.0.0 VALID
OWM Oracle Workspace Manager 19.0.0.0.0 VALID
CONTEXT Oracle Text 19.0.0.0.0 VALID
ORDIM Oracle Multimedia 19.0.0.0.0 VALID
SDO Spatial 19.0.0.0.0 VALID
XOQ Oracle OLAP API 19.0.0.0.0 VALID
OLS Oracle Label Security 19.0.0.0.0 VALID
DV Oracle Database Vault 19.0.0.0.0 VALID
15 rows selected.
SQL> select count(*) from dba_objects where status='INVALID';
COUNT(*)
----------
0
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB READ WRITE NO
SQL>
SQL> alter session set container=ORCLPDB;
Session altered.
SQL>
SQL> select comp_id,comp_name,version,status from dba_registry;
COMP_ID COMP_NAME VERSION STATUS
---------- ------------------------------------- ----------- ----------
CATALOG Oracle Database Catalog Views 19.0.0.0.0 VALID
CATPROC Oracle Database Packages and Types 19.0.0.0.0 VALID
RAC Oracle Real Application Clusters 19.0.0.0.0 OPTION OFF
JAVAVM JServer JAVA Virtual Machine 19.0.0.0.0 VALID
XML Oracle XDK 19.0.0.0.0 VALID
CATJAVA Oracle Database Java Packages 19.0.0.0.0 VALID
APS OLAP Analytic Workspace 19.0.0.0.0 VALID
XDB Oracle XML Database 19.0.0.0.0 VALID
OWM Oracle Workspace Manager 19.0.0.0.0 VALID
CONTEXT Oracle Text 19.0.0.0.0 VALID
ORDIM Oracle Multimedia 19.0.0.0.0 VALID
SDO Spatial 19.0.0.0.0 VALID
XOQ Oracle OLAP API 19.0.0.0.0 VALID
OLS Oracle Label Security 19.0.0.0.0 VALID
DV Oracle Database Vault 19.0.0.0.0 VALID
15 rows selected.
SQL> select count(*) from dba_objects where status='INVALID';
COUNT(*)
----------
0
SQL>
Zero invalid objects at both the CDB and PDB level, both databases now on 19.27, and the earlier sync checks confirmed both databases stayed aligned throughout, this confirms the patch was applied successfully across the entire Data Guard configuration.
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
Oracle DBA with hands-on experience managing production Data Guard, RAC, GoldenGate, and APEX environments. I write practical, tested installation and troubleshooting guides based on real deployment work.

Comments
Post a Comment