使用adrci清理日志:
[orauat@rhdbuat ~]$ adrci
ADRCI: Release 12.1.0.2.0 - Production on Fri Feb 25 15:11:26 2022
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
ADR base = "/u01/oracle/ebsdb/12.1.0/admin/UAT_rhdbuat"
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> show alert -tail
DIA-48449: Tail alert can only apply to single ADR home
adrci> show alert -tail
DIA-48449: Tail alert can only apply to single ADR home
adrci> select value from v$diag_info where name='DiagAlert';
DIA-48202: Illegal Identifier [4] [V$DIAG_INFO]
DIA-48202: Illegal Identifier [4] [V$DIAG_INFO]
ADR Home = /u01/oracle/ebsdb/12.1.0/admin/UAT_rhdbuat/diag/tnslsnr/rhdbuat/uat:
*************************************************************************
0 rows fetched
ADR Home = /u01/oracle/ebsdb/12.1.0/admin/UAT_rhdbuat/diag/rdbms/uat/UAT:
*************************************************************************
0 rows fetched
adrci> exit
[orauat@rhdbuat ~]$ adrci
ADRCI: Release 12.1.0.2.0 - Production on Fri Feb 25 15:32:54 2022
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
ADR base = "/u01/oracle/ebsdb/12.1.0/admin/UAT_rhdbuat"
adrci> show homes;
ADR Homes:
diag/tnslsnr/rhdbuat/uat
diag/rdbms/uat/UAT
adrci> show alert -tail
DIA-48449: Tail alert can only apply to single ADR home
adrci> puge purge -age 60 -type alert
DIA-48415: Syntax error found in string [puge purge ] at column [11]
adrci> purge -age 60 -type alert;
DIA-48448: This command does not support multiple ADR homes
adrci> set home /u01/oracle/ebsdb/12.1.0/admin/UAT_rhdbuat/diag/tnslsnr/rhdbuat/uat;
DIA-48447: The input path [/u01/oracle/ebsdb/12.1.0/admin/UAT_rhdbuat/diag/tnslsnr/rhdbuat/uat] does not contain any ADR homes
adrci> show home;
ADR Homes:
diag/tnslsnr/rhdbuat/uat
diag/rdbms/uat/UAT
adrci> set home diag/tnslsnr/rhdbuat/uat
adrci> purge -age 60 -type alert
adrci> purge -age 60 -type trace
adrci> show home
ADR Homes:
diag/tnslsnr/rhdbuat/uat
adrci> purge -age 60 -type trace
清理完成之后查看对应alert目录的大小,如下图所示:
微信图片_20220225182252.png
接着清理trace日志:
alter system trace_enable=false
删除/u01/UAT/ebsdb/12.1.0/admin/TEST_testdb/diag/tnslsnr/testdb/uat/trace/=test.log
alter system trace_enable=true;重新启动数据库
image.png