๐งผ Cleaning Up Inactive Patches in Oracle RAC
In Oracle RAC environments, patches accumulate over time, many of which become inactive due to rollback, superseding, or failed attempts. These inactive patches can clutter the patch inventory, slow down operations, and introduce inconsistencies across nodes. This post explains how to clean them up safely using opatch util deleteinactivepatches
, and why it's essential to run this under both Grid Infrastructure and Oracle RDBMS users.
$ORACLE_HOME/OPatch/opatch util deleteinactivepatches -silent
๐ What Does This Command Do?
This command removes all inactive patches from the Oracle inventory. These include:
- Rolled-back patches
- Superseded interim or PSU patches
- Obsolete metadata left from earlier patch attempts
-silent
flag allows it to run without user input.
⚙️ Importance in RAC Setup
Oracle RAC requires consistent patch levels across all cluster nodes. An unclean patch inventory can:
- Cause mismatched metadata errors
- Slow down opatchauto validations
- Increase cluster-wide patching time
- grid user — for Grid Infrastructure Home
- oracle user — for RDBMS Oracle Home
๐ Mandatory Cleanup Steps (Grid + Oracle Users)
Follow these steps in both Grid and Oracle environments:
sudo su -
su - grid
# ๐ Check inactive patches
$ORACLE_HOME/OPatch/opatch util listorderedinactivepatches
# ๐ Check OPatch config
cat $ORACLE_HOME/OPatch/config/opatch.properties
# ➤ Ensure this line exists:
# RETAIN_INACTIVE_PATCHES=1
# This setting keeps the latest patch and one one-off for rollback safety.
# ๐งน Delete inactive patches
$ORACLE_HOME/OPatch/opatch util deleteinactivepatches -silent
exit
# Repeat the same steps for Oracle RDBMS home
su - oracle
# ๐ Check inactive patches
$ORACLE_HOME/OPatch/opatch util listorderedinactivepatches
# ๐ Check OPatch config
cat $ORACLE_HOME/OPatch/config/opatch.properties
# ➤ Ensure this line exists:
# RETAIN_INACTIVE_PATCHES=1
# ๐งน Delete inactive patches
$ORACLE_HOME/OPatch/opatch util deleteinactivepatches -silent
๐ Note: Both users must perform the cleanup on their respective Oracle Homes to maintain RAC consistency.
๐ Best Practices
- ✅ Set
RETAIN_INACTIVE_PATCHES=1
inopatch.properties
- ✅ Always validate patch success before cleanup
- ✅ Backup Oracle Home and Central Inventory as a precaution
- ✅ Automate cleanup via post-patch scripts or Ansible
๐ Conclusion
Using opatch util deleteinactivepatches
as both grid and oracle users ensures a clean and consistent environment for future patching. It's a must-have step in your Oracle RAC patch lifecycle, and doing it right helps avoid inventory bloat, improves performance, and simplifies maintenance. Add it to your post-patch checklist today! ✅
Comments
Post a Comment