How to resolve ORA-13541

在尝试调整AWR报告的保留时限时,出现ORA-13541错误。

SQL> exec DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS(4320,60);
BEGIN DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS(4320,60); END;

*
ERROR at line 1:
ORA-13541: system moving window baseline size (691200) greater than retention
(259200)
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 89
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 137
ORA-06512: at line 1

试图查询ORA-13541的具体含义,但是发现oerr ora 13541并没有任何输出,同时在metalink上也查询不到任何一篇提及ORA-13541错误的文章。

只有从错误信息本身进行解读,我们的SQL动作是将AWR报告的保留时限从默认的8天改为3天。语句中的参数4320是retention,以分钟为单位,4320分钟等于3天。错误信息中的259200也是retention,但是却是以秒为单位,4320分钟=259200秒。那么691200也同样是秒,换算为天数是8天。此时再去检查AWR Baseline中的定义。

SQL> select moving_window_size from dba_hist_baseline;

MOVING_WINDOW_SIZE
------------------
                 8

那么重新解读一下错误信息,就是AWR Baseline中的MOVING_WINDOW_SIZE是8天,大于了想要修改的AWR Retention的3天。

尝试先将AWR Baseline的MOVING_WINDOW_SIZE修改为3天。可以在OEM的AWR Baselines链接里直接修改。

然后再次修改AWR Retention,成功。

SQL> exec DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS(4320,60);

PL/SQL procedure successfully completed.

Leave a Reply

Your email address will not be published. Required fields are marked *