it is safe to remove all sub directories in .patch_storage that are no longer present in opatch inventory. directory names will be prefaced with patchid.
tested in 12.1.0.2 EE but should also work fine in 12.2, 18.x, and 19.x
run cleanup script to get list of directories safe for removal.
oracle> cd $ORACLE_HOME/.patch_storage
(/opt/oracle/product/12.1.0.2/grid/.patch_storage)
oracle>
> for i in `ls -d [0-9]*_[A-S][a
>
>
> iPATCH_STATUS=`$ORACLE_HOME/OPatch/opatch lsinventory | grep "$iPATCH.*applied" |
> if [[ -n $iPA
> then echo $iPATCH_STATUS, so keep `du -sh $i | tr '\t' ' '`
> else echo `du -sh $i | tr '\t' ' '` can be removed, because $iPATCH is n
>
> done
As of Wed Oct 31 13:33:23 PDT 2018 in rh51477:/srv/oracle/product/12.1.0.2/grid/.patch_storage:
71M 19769480_Dec_15_2014_06_54_52 can be removed, because 19769480 is not in the lsinventory output.
65M 20299023_Mar_16_2015_22_21_54 can be removed, because 20299023 is not in the lsinventory output.
7.3M 20831110_Jul_11_2015_00_45_40 can be removed, because 20831110 is not in the lsinventory output.
33M 21359755_Oct_21_2015_02_52_58 can be removed, because 21359755 is not in the lsinventory output.
1.8M 21436941_Aug_13_2015_04_00_40 can be removed, because 21436941 is not in the lsinventory output.
62M 21948354_Dec_20_2015_23_39_33 can be removed, because 21948354 is not in the lsinventory output.
54M 22291127_Apr_6_2016_03_46_21 can be removed, because 22291127 is not in the lsinventory output.
81M 23054246_Jul_5_2016_07_07_59 can be removed, because 23054246 is not in the lsinventory output.
36M 24006101_Oct_1_2016_12_33_50 can be removed, because 24006101 is not in the lsinventory output.
37M 24732082_Dec_21_2016_07_15_01 can be removed, because 24732082 is not in the lsinventory output.
59M 25171037_Mar_7_2017_12_37_23 can be removed, because 25171037 is not in the lsinventory output.
56M 25755742_Jun_29_2017_09_56_57 can be removed, because 25755742 is not in the lsinventory output.
1.8G 26392164_Aug_31_2017_23_39_16 can be removed, because 26392164 is not in the lsinventory output.
1.2G 26392192_Oct_2_2017_09_28_19 can be removed, because 26392192 is not in the lsinventory output.
1.7M 26609783_Aug_10_2017_05_36_42 can be removed, because 26609783 is not in the lsinventory output.
97M 26713565_Sep_29_2017_06_57_50 can be removed, because 26713565 is not in the lsinventory output.
2.7G 26910974_Nov_8_2017_12_45_39 can be removed, because 26910974 is not in the lsinventory output.
1.5G 26925218_Dec_1_2017_19_38_05 can be removed, because 26925218 is not in the lsinventory output.
40M 26925311_Dec_6_2017_01_18_05 can be removed, because 26925311 is not in the lsinventory output.
Patch 26983807 was applied on Thu Jan 18 2018, so keep 1.8M 26983807_Nov_8_2017_07_59_12
3.0G 27338013_Feb_14_2018_10_26_39 can be removed, because 27338013 is not in the lsinventory output.
1.5G 27338020_Mar_27_2018_11_48_03 can be removed, because 27338020 is not in the lsinventory output.
29M 27338041_Mar_16_2018_02_05_00 can be removed, because 27338041 is not in the lsinventory output.
Patch 27547329 was applied on Mon Aug 27 2018, so keep 169M 27547329_Jun_22_2018_10_43_01
Patch 27762253 was applied on Mon Aug 27 2018, so keep 1.5G 27762253_Jul_16_2018_08_24_16
Patch 27762277 was applied on Mon Aug 27 2018, so keep 3.0G 27762277_Jul_16_2018_08_23_19
tested in 12.1.0.2 EE but should also work fine in 12.2, 18.x, and 19.x
run cleanup script to get list of directories safe for removal.
oracle> cd $ORACLE_HOME/.patch_storage
(/opt/oracle/product/12.1.0.2/grid/.patch_storage)
oracle>
> for i in `ls -d [0-9]*_[A-S][a
>
>
> iPATCH_STATUS=`$ORACLE_HOME/OPatch/opatch lsinventory | grep "$iPATCH.*applied" |
> if [[ -n $iPA
> then echo $iPATCH_STATUS, so keep `du -sh $i | tr '\t' ' '`
> else echo `du -sh $i | tr '\t' ' '` can be removed, because $iPATCH is n
>
> done
As of Wed Oct 31 13:33:23 PDT 2018 in rh51477:/srv/oracle/product/12.1.0.2/grid/.patch_storage:
71M 19769480_Dec_15_2014_06_54_52 can be removed, because 19769480 is not in the lsinventory output.
65M 20299023_Mar_16_2015_22_21_54 can be removed, because 20299023 is not in the lsinventory output.
7.3M 20831110_Jul_11_2015_00_45_40 can be removed, because 20831110 is not in the lsinventory output.
33M 21359755_Oct_21_2015_02_52_58 can be removed, because 21359755 is not in the lsinventory output.
1.8M 21436941_Aug_13_2015_04_00_40 can be removed, because 21436941 is not in the lsinventory output.
62M 21948354_Dec_20_2015_23_39_33 can be removed, because 21948354 is not in the lsinventory output.
54M 22291127_Apr_6_2016_03_46_21 can be removed, because 22291127 is not in the lsinventory output.
81M 23054246_Jul_5_2016_07_07_59 can be removed, because 23054246 is not in the lsinventory output.
36M 24006101_Oct_1_2016_12_33_50 can be removed, because 24006101 is not in the lsinventory output.
37M 24732082_Dec_21_2016_07_15_01 can be removed, because 24732082 is not in the lsinventory output.
59M 25171037_Mar_7_2017_12_37_23 can be removed, because 25171037 is not in the lsinventory output.
56M 25755742_Jun_29_2017_09_56_57 can be removed, because 25755742 is not in the lsinventory output.
1.8G 26392164_Aug_31_2017_23_39_16 can be removed, because 26392164 is not in the lsinventory output.
1.2G 26392192_Oct_2_2017_09_28_19 can be removed, because 26392192 is not in the lsinventory output.
1.7M 26609783_Aug_10_2017_05_36_42 can be removed, because 26609783 is not in the lsinventory output.
97M 26713565_Sep_29_2017_06_57_50 can be removed, because 26713565 is not in the lsinventory output.
2.7G 26910974_Nov_8_2017_12_45_39 can be removed, because 26910974 is not in the lsinventory output.
1.5G 26925218_Dec_1_2017_19_38_05 can be removed, because 26925218 is not in the lsinventory output.
40M 26925311_Dec_6_2017_01_18_05 can be removed, because 26925311 is not in the lsinventory output.
Patch 26983807 was applied on Thu Jan 18 2018, so keep 1.8M 26983807_Nov_8_2017_07_59_12
3.0G 27338013_Feb_14_2018_10_26_39 can be removed, because 27338013 is not in the lsinventory output.
1.5G 27338020_Mar_27_2018_11_48_03 can be removed, because 27338020 is not in the lsinventory output.
29M 27338041_Mar_16_2018_02_05_00 can be removed, because 27338041 is not in the lsinventory output.
Patch 27547329 was applied on Mon Aug 27 2018, so keep 169M 27547329_Jun_22_2018_10_43_01
Patch 27762253 was applied on Mon Aug 27 2018, so keep 1.5G 27762253_Jul_16_2018_08_24_16
Patch 27762277 was applied on Mon Aug 27 2018, so keep 3.0G 27762277_Jul_16_2018_08_23_19