incident产生大量跟踪文件,导致空间不足,如何对其进行清理

11g Oracle提供了ADRCI命令行工具,adrci位置在$ORACLE_HOME/bin目录下,可针对其批量删除

调用adrci
[oracle@orclskts ~]$ adrci
ADR base = "/u01/app/oracle"
adrci>

查看目录
adrci> show home
ADR Homes:
diag/rdbms/orcl/orclsk
diag/rdbms/orclsk/orclsk
diag/rdbms/orclsk/orclskdg
diag/rdbms/dummy/orclskdg
diag/rdbms/orclskdg/orclskdg
diag/rdbms/orclskdg/orclsk
diag/rdbms/sktest/sktest
diag/clients/user_oracle/host_1038707304_80
diag/tnslsnr/orclskts/listener
adrci>

--查询异常事件
adrci> show incident
。。。
--查询问题
adrci> show problem

ADR Home = e:\app\administrator\diag\clients\user_administrator\host_1291490615_76:
*************************************************************************
0 rows fetched

ADR Home = e:\app\administrator\diag\clients\user_administrator\host_1365461356_76:
*************************************************************************
0 rows fetched

ADR Home = e:\app\administrator\diag\clients\user_administrator\host_3751953470_76:
*************************************************************************
0 rows fetched

ADR Home = e:\app\administrator\diag\clients\user_system\host_1365461356_76:
*************************************************************************
0 rows fetched

ADR Home = e:\app\administrator\diag\clients\user_system\host_3751953470_76:
*************************************************************************
0 rows fetched

ADR Home = e:\app\administrator\diag\rdbms\orcl\orcl:
*************************************************************************
PROBLEM_ID PROBLEM_KEY LAST_INCIDENT LASTINC_TIME
----------- ------------------------------------- -------------- ----------------------------------
9 ORA 1578 1985898 2023-12-25 10:31:13.878000 +08:00
41 ORA 7445 [_intel_new_memcpy()+5352] 1961594 2023-12-21 22:02:21.908000 +08:00
7 ORA 7445 [_intel_new_memcpy()+5381] 1961650 2023-12-20 22:02:01.615000 +08:00
62 ORA 7445 [kgscFindCursor()+149] 1961588 2023-12-20 10:00:11.080000 +08:00
3 ORA 7445 [_intel_new_memcpy()+5366] 1961684 2023-12-19 22:02:42.841000 +08:00
2 ORA 600 [kgh_heap_sizes:ds] 1961723 2023-12-18 22:02:30.934000 +08:00
48 ORA 7445 [_intel_new_memcpy()+5371] 1961722 2023-12-18 22:02:30.190000 +08:00

adrci> set base E:\app\Administrator;
adrci> show home
ADR Homes:
diag\clients\user_administrator\host_1291490615_76
diag\clients\user_administrator\host_1365461356_76
diag\clients\user_administrator\host_3751953470_76
diag\clients\user_system\host_1365461356_76
diag\clients\user_system\host_3751953470_76
diag\diagtool\user_administrator\host_3751953470_76
diag\rdbms\orcl\orcl
diag\tnslsnr\189服务器\listener
diag\tnslsnr\oracledb\listener
diag\tnslsnr\win-ubbj6srg1lf\listener
adrci>
adrci> purge -age 14400 -type incident
DIA-48448: This command does not support multiple ADR homes

--这一步很重要,否则如上找不到
adrci> set home diag\rdbms\orcl\orcl
--删除10天前的incident 14400=60min*24*100 单位是分钟
adrci> purge -age 14400 -type incident
退出
adrci>exit
清空警告日志,60*24=1440 按分钟算的,一天,清空一天以前警告日志
adrci> purge -age 1440 -type alert
清空跟踪日志,1440是按分钟算的,一天,清空一天以前跟踪日志
adrci> purge -age 1440 -type trace

帮助
adrci> help purge
查看trace
adrci> show tracefile
adrci> purge -age 8760 -type TRACE

也可以清理其他相关的文件
adrci> purge -age 60 -type utscdmp
adrci> purge -age 60 -type trace
adrci> purge -age 60 -type cdump
adrci> purge -age 60 -type utscdmp

查看日志保留策略
默认SHORTP_POLICY为720小时(即30天),LONGP_POLICY为8760小时(即365天)
adrci> show control
默认SHORTP_POLICY为720小时(即30天),LONGP_POLICY为8760小时(即365天)
#设置SHORTP_POLICY 15天 LONGP_POLICY 90天
adrci> set control (SHORTP_POLICY = 360)
adrci> set control (LONGP_POLICY = 2160)

posted @ 2024-06-21 15:19  ritchy  阅读(66)  评论(0编辑  收藏  举报