删除trc文件:
ls -lrt|grep trc|head -150|awk '{print $8}'|xargs rm
ls -lrt *.trc|head -10|awk '{print $9}'|xargs rm
删除归档文件:
ls -lrt|head -10|awk '{print $9}'|xargs rm
archPath=/arch${1}
archPercent=`df -g|grep ${archPath}|awk '{print $4}'|sed 's/%//g'`
echo $(date)=${archPercent}%
cd $archPath
if [ ${archPercent} -gt 40 ] ; then
ls -ltr *.arc|head -30|awk '{print $9}'|xargs rm
echo "archivelog deleted at "$(date)
fi
删除监听日志文件:
tail -1000 listener.log>listener.log
log_file_dir=/oracle/product/9.2.0/network/log/
log_size_m=`du -sm $log_file_dir/listener.log|awk '{ print $1}'`
echo $(date)=${log_size_m}
cd $log_file_dir
if [ ${log_size_m} -gt 500 ] ; then
>listener.log
fi
杀oracle连接进程:
ps -ef|grep LOCAL=NO|awk '{print $2}'|xargs kill -9
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26078027/viewspace-1052782/ ,如需转载,请注明出处,否则将追究法律责任。