概述:使用adrci工具删除oracle的监听告警日志,在日常维护中监听的警告日志有可能占用磁盘的空间大需要进行清理。
[grid@hostname ~]$ adrci
ADRCI: Release 12.1.0.2.0 - Production on Tue Nov 20 08:58:12 2018
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
ADR base = "/u01/app/grid"
adrci> show homes
ADR Homes:
diag/rdbms/_mgmtdb/-MGMTDB
diag/diagtool/user_grid/adrci_xxx
diag/clients/user_root/host_xxx
diag/clients/user_grid/host_xxx
diag/asm/+asm/+ASM1
diag/asm/user_grid/host_xxx
diag/asmtool/user_oracle/host_xxx
diag/asmtool/user_grid/host_315454942_82
diag/tnslsnr/hostname/mgmtlsnr
diag/tnslsnr/hostname/listener
diag/tnslsnr/hostname/listener_scan1
diag/crs/hostname/crs
adrci> set homepath diag/tnslsnr/hostname/listener
adrci> help purge
Usage: PURGE [[-i <id1> | <id1> <id2>] |
[-age <mins> [-type ALERT|INCIDENT|TRACE|CDUMP|HM|UTSCDMP]]]:
Purpose: Purge the diagnostic data in the current ADR home. If no
option is specified, the default purging policy will be used.
Options:
[-i id1 | id1 id2]: Users can input a single incident ID, or a
range of incidents to purge.
[-age <mins>]: Users can specify the purging policy either to all
the diagnostic data or the specified type. The data older than <mins>
ago will be purged
[-type ALERT|INCIDENT|TRACE|CDUMP|HM|UTSCDMP]: Users can specify what type of
data to be purged.
Examples:
purge
purge -i 123 456
purge -age 60 -type incident
adrci> purge -age 1440 -type alert
adrci> exit
[root@hostname alert]# du -sh
12G .
[root@hostname alert]# du -sh
2.9G .
[root@hostname alert]# du -sh
203M .
[root@hostname alert]# du -sh
203M .
[root@hostname alert]# du -sh
203M .
[root@hostname alert]# du -sh
203M .
[root@hostname alert]# pwd
/u01/app/grid/diag/tnslsnr/hostname/listener/alert
清除后对应的监听告警日志从原先的12G减小到了203M。