配置計劃任務定期清理資料庫trc檔案

winnzheng發表於2023-09-20


#add trc log clear

0 14 * * * find /u01/app/oracle/admin/MESRPT/adump -mtime +1 -name "*.aud"|xargs rm -fr "*.aud"

5 14 * * * find /u01/app/oracle/diag/rdbms/rptdb/RPTDB1/trace -mtime +1 -name "*.trm"|xargs rm -fr "*.trm"

10 14 * * * find /u01/app/oracle/diag/rdbms/rptdb/RPTDB1/trace -mtime +1 -name "*.trc"|xargs rm -fr "*.trc"

15 14 * * * find /u01/app/11.2.0/grid/log/diag/tnslsnr/zhrptdb01/listener_scan1/alert -mtime +1 -name "*.xml"|xargs rm -fr "*.xml"



#add trc log clear

0 14 * * * find /u01/app/oracle/admin/MESRPT/adump -mtime +1 -name "*.aud"|xargs rm -fr "*.aud"

5 14 * * * find /u01/app/oracle/diag/rdbms/rptdb/RPTDB2/trace -mtime +1 -name "*.trm"|xargs rm -fr "*.trm"

10 14 * * * find /u01/app/oracle/diag/rdbms/rptdb/RPTDB2/trace -mtime +1 -name "*.trc"|xargs rm -fr "*.trc"

15 14 * * * find /u01/app/11.2.0/grid/log/diag/tnslsnr/zhrptdb02/listener_scan1/alert -mtime +1 -name "*.xml"|xargs rm -fr "*.xml"



#auto delete trc&trm

0 15 * * * find  /u01/app/oracle/diag/rdbms/fdc/fdc2/trace  -mtime +1 -name "*.trc" -exec rm -rf {} \;

3 15 * * * find  /u01/app/oracle/diag/rdbms/fdc/fdc2/trace  -mtime +1 -name "*.trm" -exec rm -rf {} \;

5 15 * * * find  /u01/app/oracle/diag/rdbms/eda/eda2/trace  -mtime +1 -name "*.trc" -exec rm -rf {} \;

7 15 * * * find  /u01/app/oracle/diag/rdbms/eda/eda2/trace  -mtime +1 -name "*.trm" -exec rm -rf {} \;

8 15 * * * find  /u01/app/oracle/diag/rdbms/apc/apc2/trace  -mtime +1 -name "*.trc" -exec rm -rf {} \;

9 15 * * * find  /u01/app/oracle/diag/rdbms/apc/apc2/trace  -mtime +1 -name "*.trm" -exec rm -rf {} \;

10 15 * * * find  /u01/app/grid/diag/tnslsnr/zhrddb02/listener/alert/  -mtime +1 -name "*.xml" -exec rm -rf {} \;

11 15 * * * find  /u01/app/grid/diag/tnslsnr/zhrddb02/listener_scan1/alert/  -mtime +1 -name "*.xml" -exec rm -rf {} \;

12 15 * * * find  /u01/app/grid/diag/tnslsnr/zhrddb02/asmnet1lsnr_asm/alert/  -mtime +5 -name "*.xml" -exec rm -rf {} \;


0 14 * * * find /u01/app/grid/diag/asm/+asm/+ASM2/trace -mtime +2 -name "+ASM2*"|xargs rm -fr "+ASM2*"

5 14 * * * find /u01/app/grid/diag/crs/zhrddb02/crs/trace -mtime +2 -name "*.trm"|xargs rm -fr "*.trm"

10 14 * * * find /u01/app/grid/diag/crs/zhrddb02/crs/trace -mtime +2 -name "*.trc"|xargs rm -fr "*.trc"

15 14 * * * find /u01/app/grid/admin/_mgmtdb/adump -mtime +2 -name "*.aud"|xargs rm -fr "*.aud"

20 14 * * * find /u01/app/grid/diag/rdbms/_mgmtdb/-MGMTDB/incident -mtime +2 -name "incdir*"|xargs rm -fr "incdir*"


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70031606/viewspace-2984814/,如需轉載,請註明出處,否則將追究法律責任。

相關文章