Cleaning Up the Oracle Patch Storage Directory

Muhammet Günay
2 min readJul 27, 2024

--

Oracle databases use patches for updates, security, performance and bug fixes. However, each patch application can leave unnecessary files on the system this will result in less disk space.. In this article I will show you how to clean up the Oracle patch storage directory. This cleaning process does not affect the current patch. It can be used before proceeding with the patching process.

From version 12.2.0.1.37, OPatch includes a proper clean up for inactive patches.

Steps for Cleanup

[oracle@smac ~]$ cd $ORACLE_HOME
[oracle@smac dbhome_1]$ pwd
/u01/app/oracle/product/19.0.0/dbhome_1

[oracle@smac dbhome_1]$ du -sh .patch_storage
2.8G .patch_storage

[oracle@smac dbhome_1]$ cd $ORACLE_HOME/OPatch
[oracle@smac OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.43

OPatch succeeded.

List Inactive Patches:


[oracle@smac OPatch]$ ./opatch util listorderedinactivepatches

Oracle Interim Patch Installer version 12.2.0.1.43
Copyright (c) 2024, 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.43
OUI version : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2024-07-27_14-39-20PM_1.log

Invoking utility "listorderedinactivepatches"
List Inactive patches option provided

The oracle home has the following inactive patch(es) and their respective overlay patches:

The number of RU chains is 1

***** There are 1 inactive RU patches in chain 1
-Inactive RU/BP 29517242:Database Release Update : 19.3.0.0.190416 (29517242), installed on: Thu Apr 18 10:21:17 EET 2019, with no overlays
-Active RU/BP 36582781:Database Release Update : 19.24.0.0.240716 (36582781), installed on: Sat Jul 27 14:07:15 EET 2024, with no overlays

OPatch succeeded.

Delete Inactive Patches:

[oracle@smac OPatch]$ ./opatch util deleteinactivepatches

Run Opatch Clean-Up

The OPatch utility has its own cleaning tool to remove unnecessary files.

$ORACLE_HOME/OPatch/opatch util cleanup

“Source:

OPatch 12.2.0.1.37+ Introduces a New Feature to Delete Inactive Patches in the ORACLE_HOME/.patch_storage Directory (Doc ID 2942102.1)”

I hope this helped you! If you need more help, feel free to contact me on linkedin

Best regards!

--

--