当前位置: 代码迷 >> 综合 >> 修改awr报告的保留时间和快照间隔
  详细解决方案

修改awr报告的保留时间和快照间隔

热度:23   发布时间:2024-01-17 11:16:09.0
修改awr报告的保留时间和快照间隔?


execdbms_workload_repository.modify_snapshot_settings(interval=>60,retention=>7*2*24*60);



有时遇到系统遇到复杂问题,处理周期长,需要保留系统的快照周期,便于分析问题,这时,需要延长延长快照时间周期
默认一般是一周时间,我们这里更改为2周的快照周期。
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 -64bit Production
With the Partitioning, Real Application Clusters, AutomaticStorage Management, OLAP,
Advanced Analytics and Real Application Testing options


SQL> select * from dba_hist_wr_control; 


    DBID
----------
SNAP_INTERVAL
---------------------------------------------------------------------------
RETENTION
---------------------------------------------------------------------------
TOPNSQL         CON_ID
---------- ----------
824967682
00000 01:00:00.0
00007 00:00:00.0
DEFAULT     0



SQL> execdbms_workload_repository.modify_snapshot_settings(interval=>60,retention=>7*2*24*60);

PL/SQL procedure successfully completed.

SQL> select * from dba_hist_wr_control; 


    DBID
----------
SNAP_INTERVAL
---------------------------------------------------------------------------
RETENTION
---------------------------------------------------------------------------
TOPNSQL         CON_ID
---------- ----------
824967682
00000 01:00:00.0
00014 00:00:00.0
DEFAULT     0




SQL> 

interval   快照间隔,单位是分钟
retention 快照保留周期,单位是分钟
?
当然,如果想要更改快照周期,只需要将interval更改为自己需要的周期即可,一般较短的为30分钟即可,这里的时间默认是分钟
retention是指保留快照的时间周期。单位是分钟。

  相关解决方案