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

来源:互联网 发布:获取网络时间 编辑:程序博客网 时间:2024/05/28 15:46
修改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是指保留快照的时间周期。单位是分钟。

0 0
原创粉丝点击