Database Reference
In-Depth Information
that all subroutines require a parameter that specifies the name of the baseline and, optionally, a parameter that
specifies after how many days the baseline is automatically dropped (the default value, NULL , indicates that there's no
expiration). For example, the following call shows how to create a baseline named TEST that expires after 30 days:
dbms_workload_repository.create_baseline(
start_snap_id => 738,
end_snap_id => 739,
baseline_name => 'TEST',
expiration => 30
);
The baselines stored in AWR are visible in the dba_hist_baseline and, in a 12.1 multitenant environment, cdb_
hist_baseline views:
SQL> SELECT start_snap_id, start_snap_time, end_snap_id, end_snap_time
2 FROM dba_hist_baseline
3 WHERE baseline_name = 'TEST'
4 AND baseline_type = 'STATIC';
START_SNAP_ID START_SNAP_TIME END_SNAP_ID END_SNAP_TIME EXPIRATION
------------- ------------------------- ----------- ------------------------- ----------
738 22-APR-14 04.06.58.230 PM 739 22-APR-14 04.12.50.933 PM 30
To display the metrics associated with a baseline (this also works for the moving window baseline), the
dbms_workload_repository package provides the select_baseline_metric function. The following query illustrates
how to display the metrics associated with the TEST baseline:
SQL> SELECT metric_name, metric_unit, minimum, average, maximum
2 FROM table(dbms_workload_repository.select_baseline_metric('TEST'))
3 ORDER BY metric_name;
METRIC_NAME METRIC_UNIT MINIMUM AVERAGE MAXIMUM
------------------------ ----------------------- ------- ---------- ----------
Active Parallel Sessions Sessions 0 0 0
Active Serial Sessions Sessions 0 1.42857143 7
Average Active Sessions Active Sessions 0 .413742101 3.49426268
...
...
User Transaction Per Sec Transactions Per Second 0 6.98898086 49.2425504
VM in bytes Per Sec bytes per sec 0 0 0
VM out bytes Per Sec bytes per sec 0 0 0
To rename baselines, the dbms_workload_repository package provides the rename_baseline procedure. As
parameters, the procedure requires the old and the new name. For example, the following call shows how to rename
the baseline from TEST to TEST1 :
dbms_workload_repository.rename_baseline(
old_baseline_name => 'TEST',
new_baseline_name => 'TEST1'
);
Search WWH ::




Custom Search