Introduction
- 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
Link : Steps to Delete Inactive Patches in Oracle
Step 2: Upgrade OPatch in Oracle Home and Grid Home on Both Nodes
$ 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
$ 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:
# tar -cvf /backup/home_backup/Grid_home1.tar /u01/app/19c/gridFrom 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/gridFrom 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:
$ srvctl status listenerCheck OPatch Version:
$ /u01/app/19c/grid/OPatch/opatch lspatches $ /u01/app/19c/grid/OPatch/opatch version $ /u01/app/19c/grid/OPatch/opatch lsinv |grep appliedCheck 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 pmonCheck TNS Status:
$ ps -ef | grep tnsCheck 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:
$ /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/36758186Oracle 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
$ /u01/app/19c/grid/OPatch/opatch prereq CheckSystemSpace -phBaseFile /backup/grid_19_30/patch_list_gihome.txt
$ /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
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:
$ /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
$ /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:
$ 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:$PATHApply 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 &
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:
$ 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:$PATHApply 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.shRun rootcrs.sh -postpatch:
# nohup /u01/app/19c/grid/crs/install/rootcrs.sh -postpatch > post_patch_node1.log 2>&1 &
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.
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.
# cd /u01/app/19c/grid/bin # crsctl check crs
From Oracle User:
$ srvctl status instance -d ORCLDB -i ORCLDB1Check Applied Database Patches:
$ srvctl start instance -d ORCLDB -i ORCLDB1
$ /u01/app/oracle/product/19c/db_home1/OPatch/opatch lsinventory | grep -i appliedVerify 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 pmonVerify Listener Processes:
$ ps -ef | grep tnsVerify 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 listenerCheck Applied Grid Patches:
$ /u01/app/19c/grid/OPatch/opatch lsinventory | grep -i appliedVerify 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:
$ cd /u01/app/oracle/product/19c/db_home1/OPatch $ ./datapatch -verboseRecompile Invalid Objects:
SQL> @?/rdbms/admin/utlrp.sqlCheck 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.
