AWR默认创建频率为1小时,保留8天
查看AWR创建频率和保留时间:
col SNAP_INTERVAL for a25
col retention for a35
col src_dbname for a35
set linesize 200
select * from dba_hist_wr_control;
DBID SNAP_INTERVAL RETENTION TOPNSQL CON_ID SRC_DBID SRC_DBNAME
---------- ------------------------- ----------------------------------- ---------- ---------- ---------- -----------------------------------
1659867117 +00000 01:00:00.0 +00008 00:00:00.0 DEFAULT 0 1659867117 eifdb
SNAP_INTERVAL表示创建频率是1小时
RETENTION表示保留时间是8天
修改AWR创建频率和保留时间
exec dbms_workload_repository.modify_snapshot_settings(interval=>30,retention=>30*24*60);
interval表示创建频率,单位是分钟
retention表示保留时间,单位是分钟
col SNAP_INTERVAL for a25
col retention for a35
col src_dbname for a35
set linesize 200
select * from dba_hist_wr_control;
DBID SNAP_INTERVAL RETENTION TOPNSQL CON_ID SRC_DBID SRC_DBNAME
---------- ------------------------- ----------------------------------- ---------- ---------- ---------- -----------------------------------
1659867117 +00000 00:30:00.0 +00030 00:00:00.0 DEFAULT 0 1659867117 eifdb