Tuesday, May 21, 2013

opatch util and Old patch storage cleanup

MetaLink Note 550522 has the answer and tells you: it depends. Normally, this data is used in order to be able to rollback a patch. However, if you have installed a patchset (eg. 10.2.0.4), then the patches for the previous patchset (10.2.0.3) which are located in the .patch_storage directory are not needed anymore and can be removed. 


Recently I have Oracle Cluster Infrastructure (11.2.0.3) patchset install on top of my old 11.2.0.1 RAC Infrastructure. The Old patches applied to this cluster is no longer needed. There are 1.8G can be reclaimed. Following are the process. 


Here the new CRS Home is /u01/app/oracle/11.2.0.3/grid
The old CRS Home is /u01/app/oracle/11.2.0/grid




[grid@qoda-n2 OPatch]$ pwd
/u01/app/

[root@qoda-n2 app]# du -h |grep G |grep -v K


3.3G    ./11.2.0.3/grid
3.3G    ./11.2.0.3
1.8G    ./11.2.0/grid/.patch_storage/9413827_Oct_25_2010_07_07_18
2.6G    ./11.2.0/grid/.patch_storage
1.2G    ./11.2.0/grid/bin
5.7G    ./11.2.0/grid
5.7G    ./11.2.0
8.9G    .

Go to new CRS Home 
[grid@qoda-n2 OPatch]$ pwd
/u01/app/11.2.0.3/grid/OPatch

[grid@qoda-n2 OPatch]$ ./opatch util Cleanup -oh /u01/app/11.2.0/grid
Invoking OPatch 11.2.0.1.7

Oracle Interim Patch Installer version 11.2.0.1.7
Copyright (c) 2011, Oracle Corporation.  All rights reserved.

UTIL session

Oracle Home       : /u01/app/11.2.0/grid
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.2.0.1.7
OUI version       : 11.2.0.1.0
Log file location : /u01/app/11.2.0/grid/cfgtoollogs/opatch/opatch2013-05-21_10-35-47AM.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 "/u01/app/11.2.0/grid/.patch_storage" before cleanup is 2708420951 bytes.
Size of directory "/u01/app/11.2.0/grid/.patch_storage" after cleanup is 1853977297 bytes.

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


As it suggested, there are only 900 M storage have been removed. We will need to remove the rest through manual process. 






No comments:

Post a Comment