BEGIN
DBMS_WORKLOAD_REPOSITORY.rename_baseline(
old_baseline_name => 'test4_bl',
new_baseline_name => 'test5_bl');
END;
/
Baselines are dropped using the DROP_BASELINE procedure.
BEGIN
DBMS_WORKLOAD_REPOSITORY.drop_baseline(baseline_name => 'test1_bl');
DBMS_WORKLOAD_REPOSITORY.drop_baseline(baseline_name => 'test2_bl');
DBMS_WORKLOAD_REPOSITORY.drop_baseline(baseline_name => 'test3_bl');
DBMS_WORKLOAD_REPOSITORY.drop_baseline(baseline_name => 'test5_bl');
END;
/
Baseline Templates
The time period spanned by a baseline template can lie in the future or it can encompass a past timeline. No matter which timeframe you choose, the manageability infrastructure automatically generates a task and creates a baseline right away.Each night, the MMON (Memory Monitor background process) task checks to see whether the end time has passed for any baseline templates you created. If it discovers that a template for baseline generation contains a completed time range, it will create the baseline for the period specified by the baseline template. Besides it will delete the expired Baseline Templates,the information refer to the DBA_HIST_BASELINE_TEMPLATE view.You can create two types of baseline templates—a single baseline template or a repeating baseline template.
You can schedule the creation of an AWR baseline for a contiguous future time period such as a known heavy usage period. Using the single AWR baseline template, you can then automatically capture a baseline of the performance during the period you specify. The following example shows how to create a single baseline template using the CREATE_BASELINE_TEMPLATE procedure:
BEGIN
DBMS_WORKLOAD_REPOSITORY.create_baseline_template(
start_time => TO_DATE('01-DEC-2008 00:00', 'DD-MON-YYYY HH24:MI'),
end_time => TO_DATE('01-DEC-2008 05:00', 'DD-MON-YYYY HH24:MI'),
baseline_name => '01_dec_008_00_05_bl',
template_name => '01_dec_008_00_05_tp',
expiration => 100);
END;
/
The optional expiration parameter specifies that this baseline will expire in 100 days. The value you set for the expiration parameter specifies the length of time for which the database will maintain a baseline. If you don’t specify an expiration time period (NULL), the baseline will never expire. The baseline_name and template_name parameters are self-explanatory. The start_ time and end_time parameters specify the beginning and ending snapshot time periods. You can also specify a DBID parameter, but its value defaults to NULL if you omit it, as in this case.
You can create a repeating baseline template to schedule the creation of an AWR baseline for a known period such as around 3:00 P.M. every Friday evening for an entire year. The database will automatically create a new baseline every Friday and you can have the database also automatically remove older baselines after a specified expiration time. Here’s how you create a repeating baseline template using the CREATE_BASELINE_TEMPLATE procedure again:
BEGIN
DBMS_WORKLOAD_REPOSITORY.create_baseline_template(
day_of_week => 'MONDAY',
hour_in_day => 0,
duration => 5,
start_time => SYSDATE,
end_time => ADD_MONTHS(SYSDATE, 6),
baseline_name_prefix => 'monday_morning_bl_',
template_name => 'monday_morning_tp',
expiration => NULL,
DBID => 12345);
END;
/
The following is a brief explanation of the values of the various parameters in the CREATE_BASELINE_TEMPLATE procedure: