How I Clean Up Old (Inactive) Patches in Oracle Using OPatch
Environment: Oracle 19c on Windows (same steps apply to Linux)
Solution: Use OPatch utility commands to safely list and delete inactive patches while retaining the minimum recommended count.
If you have been consistently installing RUs on your Oracle Database, one of the things that will occur to you after some time is your Oracle Home being crammed with outdated patches.
They're not active anymore, but they're still lingering. I ran into the same situation recently while checking one of our 19c environments. There were multiple old RUs lying around, and I thought it's a good time to clean things up a bit.
Here's how I usually handle deleting inactive patches using OPatch.
Prerequisites
- Oracle 19c installed (Windows or Linux)
- OPatch version 12.2.0.1.37 or higher
- Access to OS user with ORACLE_HOME permissions
- Preferably a scheduled maintenance window
Step 1: Check Your OPatch Version
Before doing anything, I always make sure OPatch is up to date. Some of these utilities won't work properly on older versions.
cd D:\oracle\product\19.3.0\dbhome_1\OPatch
opatch version
Make sure it's 12.2.0.1.37 or higher. In my case, it was 12.2.0.1.45 — good to go.
Step 2: Check What's Actually Inactive
Next step is to see what patches are inactive. This command is quite handy:
D:\oracle\product\19.3.0\dbhome_1\OPatch>opatch util listorderedinactivepatches
Sample output:
Oracle Interim Patch Installer version 12.2.0.1.45
Copyright (c) 2025, Oracle Corporation. All rights reserved.
Oracle Home : D:\oracle\product\19.3.0\dbhome_1
OPatch version : 12.2.0.1.45
Invoking utility "listorderedinactivepatches"
***** There are 2 inactive RU patches in chain 1
-Inactive RU/BP 35046439: 19.19.0.0.230418, installed on: Fri Jul 28 10:22:30 GST 2023
-Inactive RU/BP 36521936: 19.24.0.0.240716, installed on: Thu Oct 24 11:31:40 GST 2024
-Active RU/BP 37486199: 19.26.0.0.250121, installed on: Sat May 17 10:22:50 GST 2025
OPatch succeeded.
So clearly:
- 2 old patches are inactive
- 1 is the current active RU
Pretty typical scenario after a couple of patch cycles.
Step 3: Important — Don't Delete Everything
Oracle recommends keeping at least 2 inactive patches in the Oracle Home. If something goes wrong and you need to rollback or investigate, having older patches helps. So don't just go and delete everything blindly.
Step 4: Clean Up the Old Ones
To remove inactive patches, use:
D:\oracle\product\19.3.0\dbhome_1\OPatch>opatch util deleteinactivepatches
Sample output:
Invoking utility "deleteinactivepatches"
***** There are 2 inactive RU patches in chain 1
***** 1 inactive patches will be deleted
-To be deleted : 35046439 (19.19.0.0.230418)
-To be retained : 36521936 (19.24.0.0.240716)
-Active RU/BP : 37486199 (19.26.0.0.250121)
Do you want to proceed? [y|n]
Notice something interesting — even though there were 2 inactive patches, OPatch decided to delete only 1. That's because it automatically ensures the minimum required patches are retained.
Confirm with:
y
Result:
Deleted RU/BP patch: 35046439
OPatch succeeded.
Things I Always Keep in Mind
- Prefer doing this during a maintenance window
- On critical systems, take a quick backup of Oracle Home first
- Always check logs if something looks off:
%ORACLE_HOME%\cfgtoollogs\opatch
- Verified OPatch version is 12.2.0.1.37 or higher
- Listed inactive patches using
listorderedinactivepatches - Safely deleted oldest patch using
deleteinactivepatches - OPatch automatically retained the minimum required inactive patches
Final Thoughts
This is one of those small maintenance activities that's easy to ignore, but it helps keep your environment clean. Inactive patches don't harm directly, but over time they add clutter and confusion — especially when you're troubleshooting or auditing patch levels.
Related posts: