修改awr报告的保留时间和快照间隔
exec dbms_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, Automatic Storage 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> exec dbms_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是指保留快照的时间周期。单位是分钟。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24179204/viewspace-2127867/,如需转载,请注明出处,否则将追究法律责任。