1. 首页
  2. IT资讯

定时删除udump里的trace文件

[oracle@shanxi ORCL]$ cat /home/oracle/admin/del_udump.sh
#!/bin/bash
#Author: chipengfei
#Date:2012-11-15
. /home/oracle/.bash_profile
log=/home/oracle/oracle_log/del_udump.log
# if database is open , the variable flag will not be empty
flag=`ps -ef | grep ora_ | grep -v ‘grep’`
if [ -z “$flag” ] ; then
exit
fi
now=`date “+%Y-%m-%d %H:%M:%S”`
echo “—————————-$now——————————-” >> $log
bg_list=`ps -ef | grep LOCAL | grep -v ‘grep’ | awk ‘{print $2}’`
filter=”
for i in $bg_list ; do
filter=”${filter}|_${i}.trc”
done
filter2=`echo $filter | sed ‘s/^|//’`
cd $ORACLE_BASE/admin/$ORACLE_SID/udump
ls | grep ‘.trc’ | egrep -v “${filter2}” >> $log
ls | grep ‘.trc’ | egrep -v “${filter2}” | xargs -n 5 rm -rf

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27042095/viewspace-750057/,如需转载,请注明出处,否则将追究法律责任。

主题测试文章,只做测试使用。发布者:布吉卡,转转请注明出处:http://www.cxybcw.com/195830.html

联系我们

13687733322

在线咨询:点击这里给我发消息

邮件:1877088071@qq.com

工作时间:周一至周五,9:30-18:30,节假日休息

QR code