Experience: is what you get soon after you need it.

Experience: is what you get soon after you need it.

Rasul Allah (sal Allahu alaihi wa sallam) said: "Restore the trusts of those who trust you, and deal not falsely with him who deals falsely with you." [Abu Dawud, Tirmidhi]

Search This Blog

Tuesday, November 1, 2011

Cleanup patch_storage directories / reclaim space from oracle install directories

Today we had a space constraint issue on one of our database servers.

As usual cleaned up un necessary trace files and did some house keeping stuff.

and realized my oracle binaries disk is keep growing as we go. So on further looking found the the patch_storage directory is taking almost 5 gig and The same server houses three different databases in three different homes. which boils down 4 g each since we apply patches to all the oracle homes without discriminating others. Don't jump to the conclusion why the heck we are using three different homes for three different database and for multiple reasons we have answers for that so lets ignore that fact for a moment and lets continue.

myunixhost(MYDBNAME) /icm01/u0002/stage/OPatch/OPatch
>cd $ORACLE_HOME/.patch_storage
du -h .
4.5G .

And as per support doc

How To Avoid Disk Full Issues Because OPatch Backups Take Big Amount Of Disk Space. [ID 550522.1]
It clearly explains how to cleanup these backup directories.


>/icm01/u0002/stage/OPatch/OPatch/opatch util -help
Invoking OPatch 11.2.0.1.6



/icm01/u0002/stage/OPatch/OPatch/opatch util cleanup
Invoking OPatch 11.2.0.1.6

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

UTIL session

Oracle Home : /icm01/u0001/app/oracle/product/11.2.0/dbhome_mydbname
Central Inventory : /icm01/u0001/oraInventory
from : /var/opt/oracle/oraInst.loc
OPatch version : 11.2.0.1.6
OUI version : 11.2.0.1.0
Log file location : /icm01/u0001/app/oracle/product/11.2.0/dbhome_mydbname/cfgtoollogs/opatch/opatch2011-11-01_10-49-32AM.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

Size of directory "/icm01/u0001/11.2.0/grid/.patch_storage" before cleanup is 4599166008 bytes.
Size of directory "/icm01/u0001/11.2.0/grid/.patch_storage" after cleanup is 2795551876 bytes.

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

OPatch succeeded.


Now.

$ORACLE_HOME/.patch_storage
du -h .
244M .