Can I safely delete the contents of the .patch_storage subdirectory in NH_ORACLE_HOME?

Document ID : KB000035738
Last Modified Date : 14/02/2018
Show Technical Document Details

QUESTION

I need to free up disk space on an eHealth poller. I see a lot of duplicate files in several D:\oracle\Oracle.11.2\.patch_storage directories. Is it OK to delete the oldest of these directories?

ANSWER

It depends. Normally, this data is used in order to be able to rollback a patch. However, if you have installed a patchset (eg. 11.2.0.4), then the patches for the previous patchset (11.2.0.3) located in the .patch_storage directory are not needed anymore and can be removed. However, we do not recommend that you delete the directories manually yourself, as this would not be supported. Instead let Oracle do it for you.

The following instructions use the variable NH_ORACLE_HOME to indicate the home path to your Oracle application directory. Note that these instructions work for both Oracle 10g and 11g.

  1. Open a command line interface and move into the OPatch subdirectory

    Windows:   cd %NH_ORACLE_HOME%/OPatch
    Sol/Lin:  cd $NH_ORACLE_HOME/OPatch

  2. Run the following command to cleanup the ./patch_storage directories.

    Windows:   opatch util Cleanup
    Sol/Lin:   ./opatch util Cleanup

  3. When prompted if you want to proceed, enter 'y' to continue.

 

EXAMPLE

E:\oracle\Oracle.11.2\OPatch>opatch util Cleanup

Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation.  All rights reserved.

Oracle Home       : E:\oracle\ORACLE~1.2
Central Inventory : E:\Program Files\Oracle\Inventory
  from           : n/a
OPatch version    : 11.2.0.3.4
OUI version       : 11.2.0.4.0
Log file location : E:\oracle\ORACLE~1.2\cfgtoollogs\opatch\opatch2015-12-22_13-38-50PM_1.log

Invoking utility "cleanup"
OPatch will clean up 'restore.sh,make.txt' files and 'rac,scratch,backup' directories.
You will be still able to rollback patches after this cleanup.
Do you want to proceed? [y|n]
y
User Responded with: Y
Size of directory "E:\oracle\ORACLE~1.2\.patch_storage" before cleanup is 4575330012 bytes.
Size of directory "E:\oracle\ORACLE~1.2\.patch_storage" after cleanup is 188326505 bytes.

UtilSession: Backup area for restore has been cleaned up. For a complete list of files/directories deleted, Please refer log file.

OPatch succeeded.

 

ADDITIONAL INFORMATION

MetaLink Note 550522.1 -- How To Avoid Disk Full Issues Because OPatch Backups Take Big Amount Of Disk Space

(This link requires user access to Oracle Support)