Skip to main content

Posts

Showing posts from January, 2019

Command to find patch folders that can be deleted from .patch_storage

According to this Doc, I can remove the patch folder in .patch_storage if the patch is not listed in opatch inventory. How To Avoid Disk Full Issues Because OPatch Backups Take Big Amount Of Disk Space. (Doc ID 550522.1) The following two scripts work the same way, they list the patch number that has zero match in opatch inventory. #1: $ORACLE_HOME/OPatch/opatch lsinventory>dropit; for patch in `ls|cut -d "_" -f 1|grep [0-9]`;   do echo $patch:`grep -c $patch dropit`; done|awk -F":" '{if ($2==0) print $0}' #2 ls $ORACLE_HOME/.patch_storage|cut -d "_" -f 1|grep [0-9] > patchstorage.txt; $ORACLE_HOME/OPatch/opatch lsinventory>opatchinventory.txt; for patch in `cat patchstorage.txt`; do echo $patch:`grep -c $patch opatchinventory.txt`; done|awk -F":" '{if ($2==0) print $0}' sample output: 19872484:0 20299018:0 20831113:0 21436941:0 23854735:0 #3: this will display the ls command of those pat