awr快照保留时间修改
============== awr快照保留时间修改 =============
1、查询当前awr报告保留时间
col SNAP_INTERVAL for a20
col RETENTION for a20
SQL> select * from dba_hist_wr_control;
DBID SNAP_INTERVAL RETENTION TOPNSQL
---------- -------------------- -------------------- ----------
890208719 +00000 01:00:00.0 +00008 00:00:00.0 DEFAULT
SNAP_INTERVAL=+00000 01:00:00.0 表示采样间隔是1小时
RETENTION=+00008 00:00:00.0 表示采样数据保留期限是8天
2、修改awr采样时间间隔和保留周期
SQL>execute dbms_workload_repository.modify_snapshot_settings(interval => 60,retention => 20160);
说明:修改采样间隔为1小时。 60min
修改采样数据保留期限为14天。 60*24*14=20160。
3、查询awr采样规则
SQL> select * from dba_hist_wr_control;
DBID SNAP_INTERVAL RETENTION TOPNSQL
---------- -------------------- -------------------- ----------
890208719 +00000 01:00:00.0 +00014 00:00:00.0 DEFAULT

浙公网安备 33010602011771号