清理.patch_storage目录
清理.patch_storage目录
今天发现RAC环境安装数据库程序文件和CLUSTER程序文件使用率99%,FREE 0.11G,于是进去使用
df -sg * 查看发现安装CLUSTER的文件目录grid用了差不多60G,是什么原因造成这个目录那么大呢。进入目录里面,寻找下一级目录最大的文件,
用df -g * 发现这里的目录,最大的也是3G多,所有目录加起来也不过10G多的样子,怎么上一级目录就显示50G呢,很奇怪。网上找各种原因,有的说是删除的文件没有释放出来,UMOUNT 目录,再MOUNT,重启系统都无效。后咨询系统工程师,df -sg * 是不会显示前缀为的. 目录的大小的。
ls -la 列出前缀为的. 目录,发现有个.patch_storage目录,
df -sg .patch_storage 这个目录占了差不多40G,从而导致整个盘都使用光了。
这个目录是用来干嘛的呢,查MOS 这样描述的
When applying interim patches or Security Patch Update (SPU) (formerly Critical Patch Update (CPU)) patches, OPatch takes a big amount of disk space under $ORACLE_HOME/.patch_storage to store a backup of the affected libraries and modules that have been updated. It even could happen that a disk becomes full in the middle of the patching process.
可以用opatch util cleanup清理
$ opatch util cleanup Invoking OPatch 11.2.0.3.4 Oracle Interim Patch Installer version 11.2.0.3.4 Copyright (c) 2007, Oracle Corporation. All rights reserved. UTIL session Oracle Home : /adwl/oragrid/gird Central Inventory : /adwl/oragrid/oraInventory from : /adwl/oragrid/gird/oraInst.loc OPatch version : 11.2.0.3.4 OUI version : 11.2.0.2.0 Log file location : /adwl/oragrid/gird/cfgtoollogs/opatch/opatch2013-07-10_11-11-53AM_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 "/adwl/oragrid/gird/.patch_storage" before cleanup is 438057972 bytes. Size of directory "/adwl/oragrid/gird/.patch_storage" after cleanup is 198415929 bytes. UtilSession: Backup area for restore has been cleaned up. For a complete list of files/directories deleted, Please refer log file. OPatch succeeded.