1.创建基线

SQL> exec dbms_workload_repository.create_baseline(start_snap_id=>,end_snap_id=>,baseline_name=>'peak baseline',dbid=>,expiration=>);

2.删除基线

SQL> exec dbms_workload_repository.drop_baseline(baseline_name => 'peak mondays');

3.重命名基线

SQL> exec dbms_workload_repository.rename_baseline(old_baseline_name=>'peak baseline',new_baseline_name=>'peak mondays',dbid=>);

4.查看基线统计信息

SQL> exec dbms_workload_repository.select_baseline_metrics(baseline_name=>'peak mondays',dbid=>,instance_num=>);

5.修改移动基线的窗口大小

SQL> exec dbms_workload_repository.modify_baseline_window_size(window_size=>,dbid=>);

6.查看基线

SQL> select dbid,baseline_id,baseline_name,baseline_type,start_snap_id,start_snap_time,end_snap_id,end_snap_time,moving_window_size,creation_time,expiration,template_name,last_time_computed from dba_hist_baseline;

      DBID BASELINE_ID BASELINE_NAME        BASELINE_TYPE START_SNAP_ID START_SNAP_TIME           END_SNAP_ID END_SNAP_TIME             MOVING_WINDOW_SIZE CREATION_TIME             EXPIRATION TEMPLATE_NAME   LAST_TIME_COMPUTED
---------- ----------- -------------------- ------------- ------------- ------------------------- ----------- ------------------------- ------------------ ------------------------- ---------- -------------- -------------------
peak baseline STATIC -NOV- 12.00.57.896 PM -NOV- 02.00.01.146 PM -NOV-
SYSTEM_MOVING_WINDOW MOVING_WINDOW -OCT- 04.00.39.626 PM -NOV- 02.31.07.474 PM -JUL-
SQL>
04-13 15:53