删除oracle trace文件

##每天上午9点清理trace文件
0 2 * * * /home/oracle/scripts/delete_db_trace_file.sh

[oracle@yeemiao-oracle-9e96168-prd scripts]$ more delete_trace_file.sh
#!/bin/sh

file_cnt=`find /home/oracle/u01/app/oracle/diag/rdbms/hxl/hxl/trace -mmin +60 -name "*.trc"|wc -l`
if [ $file_cnt -gt 1 ]
then
  find /home/oracle/u01/app/oracle/diag/rdbms/hxl/hxl/trace -mmin +60 -name "*.trc"|xargs rm
fi


file_cnt=`find /home/oracle/u01/app/oracle/diag/rdbms/hxl/hxl/trace -mmin +60 -name "*.trm"|wc -l`
if [ $file_cnt -gt 1 ]
then
  find /home/oracle/u01/app/oracle/diag/rdbms/hxl/hxl/trace -mmin +60 -name "*.trm"|xargs rm
fi
原文地址:https://www.cnblogs.com/hxlasky/p/15108284.html