Oracle RAC 19c RU 19.30 Rolling Patching Step-by-Step Guide (2 Node RAC)

Introduction

This article provides a step-by-step guide for applying Oracle RAC 19c RU 19.30 using the rolling patching approach. It covers pre-patching checks, OPatch upgrade, backup, patch application, post-patch validation, Datapatch execution, and final verification activities required for a successful Oracle RAC patching process.

Important Notes:
  • Take RMAN backup before patching.
  • Verify sufficient filesystem space.
  • Validate cluster health before starting.
  • Apply Grid patches before Database patches.
  • Run datapatch only after patching all nodes.
  • Perform patching during approved maintenance window.

Environment Details

Oracle Database Version 19c
Release Update 19.30
Cluster Type 2 Node RAC
Operating System Oracle Linux / RHEL
Grid Home /u01/app/19c/grid
Oracle Home /u01/app/oracle/product/19c/db_home1
Patching Method Rolling Patching

Step 1: Inactive Patch Cleanup

Before starting the patching activity, remove inactive patches from both Oracle Home and Grid Home.

For a detailed guide on identifying and removing inactive patches, refer to the following article:

Link : Steps to Delete Inactive Patches in Oracle

Step 2: Upgrade OPatch in Oracle Home and Grid Home on Both Nodes

Upgrade OPatch to the latest supported version before applying RU 19.30.

Oracle Home:
$ cd /u01/app/oracle/product/19c/db_home1
$ mv OPatch OPatch_bkp

$ cd /backup/grid_19_30/
$ cp -R OPatch  /u01/app/oracle/product/19c/db_home1

$ chmod -R 775 /u01/app/oracle/product/19c/db_home1/OPatch
$ cd /u01/app/oracle/product/19c/db_home1/OPatch $ ./opatch version
Grid Home:
$ cd /u01/app/19c/grid
$ mv OPatch OPatch_bkp

$ cd /backup/grid_19_30/
$ cp -R OPatch/ /u01/app/19c/grid

$ cd /u01/app/19c/grid/
$ chown -R grid:oinstall OPatch
$ chmod -R 775 OPatch
$ cd OPatch $ ./opatch version

Step 3: Take a TAR Backup of Oracle Home and Grid Home on Both Nodes

Node 1:

From Root User:
# tar -cvf /backup/home_backup/Grid_home1.tar /u01/app/19c/grid
From Oracle User:
$ tar -cvf /backup/home_backup/Oracle_home1.tar /u01/app/oracle/product/19c/db_home1

Node 2:

From Root User:
# tar -cvf /backup/home_backup/Grid_home2.tar /u01/app/19c/grid
From Oracle User:
$ tar -cvf /backup/home_backup/Oracle_home2.tar /u01/app/oracle/product/19c/db_home1

Step 4: Pre-Patching Health Check and Environment Assessment

From Grid User:

Listener Status:
$ srvctl status listener
Check OPatch Version:
$ /u01/app/19c/grid/OPatch/opatch lspatches
$ /u01/app/19c/grid/OPatch/opatch version
$ /u01/app/19c/grid/OPatch/opatch lsinv |grep applied
Check OPatch Information:
$ /u01/app/19c/grid/bin/kfod op=patches
$ /u01/app/19c/grid/bin/kfod op=patchlvl
$ /u01/app/19c/grid/bin/crsctl query crs activeversion -f
$ /u01/app/19c/grid/bin/crsctl status res -t
$ /u01/app/19c/grid/bin/crsctl status res -t -init
$ /u01/app/19c/grid/OPatch/opatch lspatches | sort -nr
$ /u01/app/19c/grid/OPatch/opatch lsinventory | grep -i applied
$ /u01/app/19c/grid/OPatch/opatch lsinventory | grep -E "applied|Oracle Home|description"

From Oracle User:

Check Database Status:
$ ps -ef | grep pmon
Check TNS Status:
$ ps -ef | grep tns
Check OPatch Version:
$ /u01/app/oracle/product/19c/db_home1/OPatch/opatch lspatches
$ /u01/app/oracle/product/19c/db_home1/OPatch/opatch version
$ /u01/app/oracle/product/19c/db_home1/OPatch/opatch lsinventory | grep -i applied
$ /u01/app/oracle/product/19c/db_home1/OPatch/opatch lsinventory | grep -E "applied|Oracle Home|description"
Check invalid object count:
SQL> select owner, object_type, count(*) from dba_objects where status='INVALID' group by owner, object_type;
Verify that all critical database objects are valid:
SQL> select count(*) from dba_objects where status='INVALID';
Check Oracle Wallet Status:
SQL> select * from v$encryption_wallet;

Step 5: Pre-Patching Validation Checks

Check Patch Conflicts:

Grid Home (Grid User):
$ /u01/app/19c/grid/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /backup/grid_19_30/38629535/38632161
$ /u01/app/19c/grid/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /backup/grid_19_30/38629535/38661284
$ /u01/app/19c/grid/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /backup/grid_19_30/38629535/38653268
$ /u01/app/19c/grid/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /backup/grid_19_30/38629535/38729293
$ /u01/app/19c/grid/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /backup/grid_19_30/38629535/36758186
Oracle Home (Oracle User):
$ /u01/app/oracle/product/19c/db_home1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /backup/grid_19_30/38629535/38632161
$ /u01/app/oracle/product/19c/db_home1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /backup/grid_19_30/38629535/38661284

Run OPatch System Space Check:

$ cat /backup/grid_19_30/patch_list_gihome.txt
/backup/grid_19_30/38629535/38632161
/backup/grid_19_30/38629535/38661284
/backup/grid_19_30/38629535/38653268
/backup/grid_19_30/38629535/38729293
/backup/grid_19_30/38629535/36758186

$ cat /backup/grid_19_30/patch_list_dbhome.txt
/backup/grid_19_30/38629535/38632161
/backup/grid_19_30/38629535/38661284
Grid Home (Grid User):
$ /u01/app/19c/grid/OPatch/opatch prereq CheckSystemSpace -phBaseFile /backup/grid_19_30/patch_list_gihome.txt
Oracle Home (Oracle User):
$ /u01/app/oracle/product/19c/db_home1/OPatch/opatch prereq CheckSystemSpace -phBaseFile /backup/grid_19_30/patch_list_dbhome.txt

Step 6: Patch Application Procedure

Stop Database Instance on Target Node:

$ srvctl status instance -d ORCLDB -i ORCLDB1

$ srvctl stop instance -d ORCLDB -i ORCLDB1

Prepare Grid Infrastructure for Patching - Root User:

# cd /u01/app/19c/grid/crs/install
# ./rootcrs.sh -prepatch 
Why rootcrs.sh -prepatch Is Required?

The rootcrs.sh -prepatch command prepares Oracle Grid Infrastructure for patching by placing the cluster in patch mode and stopping the required CRS services safely.

Running this command helps prevent file locking issues, ensures cluster resources are handled correctly, and allows OPatch to update Grid Infrastructure binaries without conflicts.

In short, rootcrs.sh -prepatch prepares the Oracle RAC cluster for a safe and successful Grid Home patching process.

Check Active Files and Executables:

Grid Home Active File Check - Grid User:
$ /u01/app/19c/grid/OPatch/opatch prereq CheckActiveFilesAndExecutables -phBaseDir /backup/grid_19_30/38629535/38632161
$ /u01/app/19c/grid/OPatch/opatch prereq CheckActiveFilesAndExecutables -phBaseDir /backup/grid_19_30/38629535/38661284
$ /u01/app/19c/grid/OPatch/opatch prereq CheckActiveFilesAndExecutables -phBaseDir /backup/grid_19_30/38629535/38653268
$ /u01/app/19c/grid/OPatch/opatch prereq CheckActiveFilesAndExecutables -phBaseDir /backup/grid_19_30/38629535/38729293
$ /u01/app/19c/grid/OPatch/opatch prereq CheckActiveFilesAndExecutables -phBaseDir /backup/grid_19_30/38629535/36758186
Oracle Home Active File Check - Oracle User:
$ /u01/app/oracle/product/19c/db_home1/OPatch/opatch prereq CheckActiveFilesAndExecutables -phBaseDir /backup/grid_19_30/38629535/38632161
$ /u01/app/oracle/product/19c/db_home1/OPatch/opatch prereq CheckActiveFilesAndExecutables -phBaseDir /backup/grid_19_30/38629535/38661284

Apply Grid Infrastructure Patches - Grid User:

Set Grid Environment Variables:
$ export ORACLE_HOME=/u01/app/19c/grid
$ export PERL5LIB=$ORACLE_HOME/perl/lib
$ export PATH=$ORACLE_HOME/perl/bin:$PATH
$ export PATH=/u01/app/19c/grid/bin:$PATH
$ export PATH=/u01/app/19c/grid/OPatch:$PATH
Apply Grid Home Patches:
$ cd /backup/grid_19_30/38629535/38632161
$ nohup /u01/app/19c/grid/OPatch/opatch apply -local -silent > 38632161_node1.log 2>&1 &
$ cd /backup/grid_19_30/38629535/38661284
$ nohup /u01/app/19c/grid/OPatch/opatch apply -local -silent > 38661284_node1.log 2>&1 &
$ cd /backup/grid_19_30/38629535/38653268
$ nohup /u01/app/19c/grid/OPatch/opatch apply -local -silent > 38653268_node1.log 2>&1 &
$ cd /backup/grid_19_30/38629535/38729293
$ nohup /u01/app/19c/grid/OPatch/opatch apply -local -silent > 38729293_node1.log 2>&1 &
$ cd /backup/grid_19_30/38629535/36758186
$ nohup /u01/app/19c/grid/OPatch/opatch apply -local -silent > 36758186_node1.log 2>&1 &
Why Grid Home Must Be Patched Before Oracle Database Home?

In an Oracle RAC environment, Grid Infrastructure manages cluster services, ASM, listeners, and database resources. Oracle Database Home depends on these Grid services for normal operation.

Therefore, Oracle recommends patching the Grid Home first, followed by the Oracle Database Home, to ensure version compatibility and cluster stability throughout the patching process.

Patching Grid Infrastructure first helps prevent version mismatches and ensures that all cluster components are running on the required patch level before the database binaries are updated.

Apply Database Home Patches - Oracle User:

Set Oracle Environment Variables:
$ export ORACLE_HOME=/u01/app/oracle/product/19c/db_home1
$ export PATH=/u01/app/oracle/product/19c/db_home1/bin:$PATH
$ export PATH=/u01/app/oracle/product/19c/db_home1/OPatch:$PATH
Apply Database Home Patches:
$ cd /backup/grid_19_30/38629535/38632161
$ nohup /u01/app/oracle/product/19c/db_home1/OPatch/opatch apply -local -silent > oracle_38632161_node1.log 2>&1 &
$ cd /backup/grid_19_30/38629535/38661284
$ nohup /u01/app/oracle/product/19c/db_home1/OPatch/opatch apply -local -silent > oracle_38661284_node1.log 2>&1 &

Step 7: Post-Patching Validation and Service Restoration

From Root User:

Run rootadd_rdbms.sh:
# /u01/app/19c/grid/rdbms/install/rootadd_rdbms.sh
Run rootcrs.sh -postpatch:
# nohup /u01/app/19c/grid/crs/install/rootcrs.sh -postpatch > post_patch_node1.log 2>&1 &
Why rootadd_rdbms.sh Is Required After Patching?

The rootadd_rdbms.sh script updates Oracle Clusterware with the patched Oracle Database Home information. It ensures that the database home is correctly registered with Grid Infrastructure and that cluster-managed database resources continue to function properly after patching.

Why rootcrs.sh -postpatch Is Required After Patching?

The rootcrs.sh -postpatch command completes the Grid Infrastructure patching process by bringing the cluster out of patch mode and restarting the required CRS services.

It also updates cluster configuration files, activates the newly patched Grid Home binaries, and verifies that Oracle Clusterware components are running correctly.

Verify Cluster Health:
# cd /u01/app/19c/grid/bin
# crsctl check crs

From Oracle User:

Start and Verify Database Services:
$ srvctl status instance -d ORCLDB -i ORCLDB1
$ srvctl start instance -d ORCLDB -i ORCLDB1
Check Applied Database Patches:
$ /u01/app/oracle/product/19c/db_home1/OPatch/opatch lsinventory | grep -i applied
Verify Oracle Home Inventory:
$ /u01/app/oracle/product/19c/db_home1/OPatch/opatch lsinventory | grep -E "applied|Oracle Home|description"
Verify PMON Processes:
$ ps -ef | grep pmon
Verify Listener Processes:
$ ps -ef | grep tns
Verify Database Components:
SQL> column comp_name format a50
SQL> column status format a20
SQL> select COMP_ID, COMP_NAME, VERSION, STATUS, MODIFIED from dba_registry;
Verify SQL Patch Registry:
SQL> COL ACTION_TIME FOR A35
SQL> COL DESCRIPTION FOR A70
SQL> SELECT PATCH_ID, PATCH_UID, ACTION, STATUS, ACTION_TIME, DESCRIPTION from dba_registry_sqlpatch;
Verify Oracle Wallet Status:
SQL> select * from v$encryption_wallet;

From Grid User:

Verify Listener Status:
$ srvctl status listener
Check Applied Grid Patches:
$ /u01/app/19c/grid/OPatch/opatch lsinventory | grep -i applied
Verify Grid Home Inventory:
$ /u01/app/19c/grid/OPatch/opatch lsinventory | grep -E "applied|Oracle Home|description"

Step 8: Final Post-Patching Activities and Validation

Repeat Patching Procedure on Node 2

  • Perform the same patching steps executed on Node 1.
  • Complete post-patching validation checks on Node 2.

From Oracle User:

Execute Datapatch:
$ cd /u01/app/oracle/product/19c/db_home1/OPatch
$ ./datapatch -verbose
Recompile Invalid Objects:
SQL> @?/rdbms/admin/utlrp.sql
Check invalid object count:
SQL> select owner, object_type, count(*) from dba_objects where status='INVALID' group by owner, object_type;
Verify that all critical database objects are valid:
SQL> select count(*) from dba_objects where status='INVALID';

Conclusion

Oracle RAC 19c RU 19.30 patching was successfully completed using the rolling patching method. After applying the patches on both nodes, Datapatch was executed, invalid objects were validated, and final health checks were performed to ensure the cluster was operating normally.

This procedure can be used as a reference for future Oracle RAC 19c Release Update patching activities.

Post a Comment

© Ayaan Israr - All rights reserved. Premium By Ayaan Israr