统计grid软件产生的占用系统空间的trc,aud,LISTENER 日志文件文件大小和位置。
[root@caiqidb1 its]# cat chk.sh
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/soft
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
find /u01 -name "*trc" |awk -F "/" '{$NF="";print}'| sed 's#\s#\/#g'|uniq|while read line; do du -sh $line; done|grep G
find /u01 -name "*aud" |awk -F "/" '{$NF="";print}'| sed 's#\s#\/#g'|uniq|while read line;do du -sh $line ; done|grep G
ps -ef|grep tnsl|grep -v grep| awk '{print $9}'|while read line;do lsnrctl status $line|grep "Listener Log File"; done|awk '{print $4}'|while read line; do du -sh $(echo $line|awk -F "/" '{$NF="";print}' |sed 's#\s#\/#g'); done
执行效果
[root@caiqidb1 its]# sh chk.sh
1.3G /u01/app/grid/diag/crs/caiqidb1/crs/trace/
983M /u01/app/grid/diag/tnslsnr/caiqidb1/asmnet1lsnr_asm/alert/
63M /u01/app/grid/diag/tnslsnr/caiqidb1/listener/alert/
[root@caiqidb1 its]#