视图: dba_hist_wr_control
修改awr相关参数 ,本次主要修改topnsql ,该值默认是30。
SYS@test>exec dbms_workload_repository.modify_snapshot_settings(topnsql => 100);
PL/SQL 过程已成功完成。
SYS@test>exec dbms_workload_repository.modify_snapshot_settings(topnsql => 10);
BEGIN dbms_workload_repository.modify_snapshot_settings(topnsql => 10); END;
*
第 1 行出现错误:
ORA-13530: TOPNSQL 10 无效, 必须在 (30, 50000) 范围内
ORA-06512: 在 "SYS.DBMS_WORKLOAD_REPOSITORY", line 174
ORA-06512: 在 "SYS.DBMS_WORKLOAD_REPOSITORY", line 222
ORA-06512: 在 line 1
SYS@test>exec dbms_workload_repository.modify_snapshot_settings(topnsql => 30);
PL/SQL 过程已成功完成。
SYS@test>exec dbms_workload_repository.modify_snapshot_settings(topnsql => 'DEFAULT');
PL/SQL 过程已成功完成。
SYS@test>
参考文档:
https://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_workload_repos.htm#ARPLS69140
Table 162-29 MODIFY_SNAPSHOT_SETTINGS Procedure Parameters
Parameter | Description |
---|---|
|
New retention time (in minutes). The specified value must be in the range of If If NOTE: The retention setting must be greater than or equal to the window size of the ' |
扫描二维码关注公众号,回复:
4090200 查看本文章
|
New interval setting between each snapshot, in units of minutes. The specified value must be in the range If If |
|
|
|
Database identifier in AWR for which to modify the snapshot settings. If |
This example changes the interval
setting to one hour and the retention
setting to two weeks for the local database:
EXECUTE DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS( interval => 60, retention => 20160);
If you query the DBA_HIST_WR_CONTROL
table after this procedure is executed, you will see the changes to these settings.
END。