Академический Документы
Профессиональный Документы
Культура Документы
1 of 3
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-stat...
APPLIES TO:
Oracle Exadata Storage Server Software - Version 11.2.1.2.0 and later
Oracle Database - Enterprise Edition - Version 11.2.0.0 and later
Information in this document applies to any platform.
***Checked for relevance on 24-Oct-2013***
PURPOSE
The purpose of this document is to provide a step-by-step guide for configuring Resource Manager when OLTP and reports (or other
long-running, low-priority operations) are sharing a database. In this scenario, the reports can contend with OLTP for resources, degrading
OLTP performance. This document provides a script for configuring Resource Manager to protect OLTP performance from the negative
effects of long-running, resource-intensive workloads.
DETAILS
When a database is shared by both OLTP and reports, it is likely that these workloads will contend for resources. You should consider using
Resource Manager to guard against unacceptable performance impacts to your OLTP workload.
How do you know if you really need Resource Manager to manage your mixed workloads?
Most databases are configured to have ample resources for typical workload levels. In these cases, Resource Manager serves as a
safeguard for unexpected surges in workload. These surges can be caused by:
Bad SQL execution plans
Ad-hoc queries
Spikes in workload caused by special events such as end-of-quarter reporting
A database can benefit from Resource Manager when the CPU load is high. You can detect performance degradation due to high CPU loads
in several ways:
Monitoring CPU utilization from the O/S or Enterprise Manager.
Long log file syncs, even though I/O latencies are low.
Configuring Resource Manager
The following script can be used to configure and enable a Resource Plan that prioritizes OLTP over long-running operations, such as
reports.
Note that this is a simple, single-level plan that does not require you to map sessions to consumer groups. We recommend that you start
with a simple plan and add complexity only as necessary.
begin
dbms_resource_manager.create_pending_area;
dbms_resource_manager.create_plan(
plan => 'oltp_plan',
comment => 'Plan that prioritizes short-running operations');
-- Sessions start in this consumer group.
-- If a query, transaction, or PL/SQL procedure consumes more than a minute
-- of CPU, the session is switched to the batch consumer group for the
-- duration of that operation
dbms_resource_manager.create_plan_directive(
plan => 'oltp_plan',
group_or_subplan => 'other_groups',
comment => 'Sessions start in this consumer group',
mgmt_p1 => 70,
switch_time => 60,
switch_group => 'batch_group',
switch_for_call => TRUE);
dbms_resource_manager.create_plan_directive(
plan => 'oltp_plan',
9/8/2015 8:38 PM
Document 1358709.1
2 of 3
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-stat...
You can now enable the plan by setting the Oracle parameter "resource_manager_plan" to "oltp_plan". For example,
alter system set resource_manager_plan = 'oltp_plan' sid='*';
Maintenance Windows
By default, the "default_maintenance_plan" resource plan is enabled during the maintenance window. If you did not create a resource plan
for your database, the "default_maintenance_plan" provides effective management of automated maintenance tasks.
Once you create a resource plan for your database, Oracle recommends that
1. Your resource plan contains a directive for maintenance tasks. You should create the maintenance task directive for the
"ora$autotask_sub_plan" subplan in 11g and for the "ora$autotask" consumer group in 12c. Outside of the maintenance windows,
automated tasks do not run and this allocation will be reallocated to the other consumer groups.
2. You enable a single resource plan both during and outside the maintenance windows. Enable the resource plan using the
"resource_manager_plan" parameter. Then, disable the default_maintenance_plan from the maintenance windows, using the script
below. Your resource plan will then be used both during and outside the maintenance windows.
begin
dbms_scheduler.set_attribute_null(
name => 'SUNDAY_WINDOW',
attribute => 'RESOURCE_PLAN');
dbms_scheduler.set_attribute_null(
name => 'MONDAY_WINDOW',
attribute => 'RESOURCE_PLAN');
dbms_scheduler.set_attribute_null(
name => 'TUESDAY_WINDOW',
attribute => 'RESOURCE_PLAN');
dbms_scheduler.set_attribute_null(
name => 'WEDNESDAY_WINDOW',
attribute => 'RESOURCE_PLAN');
dbms_scheduler.set_attribute_null(
name => 'THURSDAY_WINDOW',
attribute => 'RESOURCE_PLAN');
dbms_scheduler.set_attribute_null(
name => 'FRIDAY_WINDOW',
attribute => 'RESOURCE_PLAN');
dbms_scheduler.set_attribute_null(
name => 'SATURDAY_WINDOW',
attribute => 'RESOURCE_PLAN');
end;
/
9/8/2015 8:38 PM
Document 1358709.1
3 of 3
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-stat...
For Exadata cells on versions 11.2.2.2 and below, use the following CellCLI command:
alter iormplan active;
REFERENCES
NOTE:1339769.1
NOTE:1339803.1
NOTE:1337265.1
NOTE:1338988.1
9/8/2015 8:38 PM