Managing Baseline Templates
Baseline templates enable you to automatically create baselines to capture specified time periods in the future. This section describes how to manage baseline templates and contains the following topics:
See Also:
"Baseline Templates" for information about baseline templates
User Interfaces for Managing Baseline Templates
The primary interface for managing baseline templates is Oracle Enterprise Manager Cloud Control (Cloud Control). Whenever possible, manage baseline templates using Cloud Control.
If Cloud Control is unavailable, then manage baseline templates using the DBMS_WORKLOAD_REPOSITORY
package in the command-line interface. The DBA role is required to invoke the DBMS_WORKLOAD_REPOSITORY
procedures.
See Also:
Oracle Database 2 Day + Performance Tuning Guide for more information about managing baseline templates using Cloud Control
Creating a Single Baseline Template
You can use a single baseline template to create a baseline during a single, fixed time interval in the future. For example, you can create a single baseline template to generate a baseline that is captured on April 2, 2012 from 5:00 p.m. to 8:00 p.m.
To create a single baseline template using command-line interface, use the CREATE_BASELINE_TEMPLATE
procedure as shown in the following example:
BEGIN DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE_TEMPLATE (start_time => '2012-04-02 17:00:00 PST', end_time => '2012-04-02 20:00:00 PST', baseline_name => 'baseline_120402', template_name => 'template_120402', expiration => 30, dbid => 3310949047); END; /
In this example, a baseline template named template_120402
is created that will generate a baseline named baseline_120402
for the time period from 5:00 p.m. to 8:00 p.m. on April 2, 2012 on the database with a database ID of 3310949047
. The baseline will expire after 30 days.
See Also:
Oracle Database PL/SQL Packages and Types Reference for information about the DBMS_WORKLOAD_REPOSITORY
package
Creating a Repeating Baseline Template
You can use a repeating baseline template to automatically create baselines that repeat during a particular time interval over a specific period in the future. For example, you can create a repeating baseline template to generate a baseline that repeats every Monday from 5:00 p.m. to 8:00 p.m. for the year 2012.
To create a repeating baseline template using command-line, use the CREATE_BASELINE_TEMPLATE
procedure as shown in the following example:
BEGIN DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE_TEMPLATE (day_of_week => 'monday', hour_in_day => 17, duration => 3, expiration => 30, start_time => '2012-04-02 17:00:00 PST', end_time => '2012-12-31 20:00:00 PST', baseline_name_prefix => 'baseline_2012_mondays_', template_name => 'template_2012_mondays', dbid => 3310949047); END; /
In this example, a baseline template named template_2012_mondays
is created that will generate a baseline on every Monday from 5:00 p.m. to 8:00 p.m. beginning on April 2, 2012 at 5:00 p.m. and ending on December 31, 2012 at 8:00 p.m. on the database with a database ID of 3310949047
. Each of the baselines will be created with a baseline name with the prefix baseline_2012_mondays_
and will expire after 30 days.
See Also:
Oracle Database PL/SQL Packages and Types Reference for information about the DBMS_WORKLOAD_REPOSITORY
package
Dropping a Baseline Template
Periodically, you may want to remove baselines templates that are no longer used to conserve disk space.
To drop a baseline template using command-line, use the DROP_BASELINE_TEMPLATE
procedure as shown in the following example:
BEGIN DBMS_WORKLOAD_REPOSITORY.DROP_BASELINE_TEMPLATE (template_name => 'template_2012_mondays', dbid => 3310949047); END; /
In this example, the baseline template named template_2012_mondays
is dropped from the database instance with the database identifier of 3310949047
.
Tip:
To determine which baseline template to drop, use the DBA_HIST_BASELINE_TEMPLATE
view to review the existing baseline templates.
See Also:
Oracle Database PL/SQL Packages and Types Reference for information about the DBMS_WORKLOAD_REPOSITORY
package