---sysaux表空间占用率很高是awr太多?
select * from dba_hist_wr_control;
---30分钟收集一次,并保留8天时间(单位:分钟) interval设置0 表示关闭捕获快照
exec dbms_workload_repository.modify_snapshot_settings(interval=>30,retention=>8*24*60);
ORA-13541: system moving window baseline size (691200) greater than retention (432000)
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 174
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 222
ORA-06512: at line 1
----查看移动窗口基线大小 MOVING_WINDOW_SIZE=8
select * from dba_hist_baseline;
---修改移动窗口基线大小
exec dbms_workload_repository.modify_baseline_window_size(5);
----再执行就不报错了
exec dbms_workload_repository.modify_snapshot_settings(interval=>30,retention=>5*24*60);
---手动创建一个快照
exec dbms_workload_repository.create_snapshot();
----创建baseline
exec dbms_workload_repository.create_baseline(56,59,'solgle-db-1');
ORA-13506: operation failed due to invalid snapshot range (56, 59)
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 281
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 319
ORA-06512: at line 1
----查看所有快照
select * from sys.wrh$_active_session_history order by sample_time desc;
----以某段快照为例,创建基线
exec dbms_workload_repository.create_baseline(2240,2246,'solgle-db-1');
---手工删除某阶段快照
exec dbms_workload_repository.drop_snapshot_range(low_snap_id=>2248,high_snap_id=>2249,dbid=>1369758280);
----删除baseline
exec dbms_workload_repository.drop_baseline(baseline_name=>'solgle-db-1',cascade=>true);