Resource Manager Enhancements In Oracle9i
Resource Manager was introduced in Oracle8i allowing users with differing processing needs to be allocated to different resource consumer groups, each with it's own limited allocation of system resources. The functionality of Resource Manager has been enhanced in Oracle9i to include the following features:- Active Session Pool
- Maximum Estimated Execution Time
- Automatic Consumer Group Switching
- UNDO_POOL
- Resource Plan Directive Interactions
- Modified Views
Active Session Pool
As new transactions start in a specific consumer group they take a share of the available resources. If too many transactions are active at once performance can suffer.The new Active Session Pool feature allows a maximum number of active sessions to be set for each resource consumer group. Once this figure is reached, all subsequent requests are queued until an active session completes or becomes inactive.The active session pool currently works on the First-In-First-Out (FIFO) basis, with a timeout period. If the request times out an error is issued that can be trapped by an application. Parallel operations are counted as single sessions by resource manager.
If there are multiple resource plan directives that refer to the same consumer group, the active session pool is the sum of all the incoming values. In this case the queue timeout is the minimum of all incoming timeout values.
The active session pool is defined using the following parameters of the
CREATE_PLAN_DIRECTIVE and
UPDATE_PLAN_DIRECTIVE procedures in the DBMS_RESOURCE_MANAGER package:[NEW_]ACTIVE_SESSION_POOL_P1- Defines the active session pool limit.[NEW_]QUEUING_P1- Defines the timeout period in seconds.
Maximum Estimated Execution Time
Sometimes you need to prevent long running operations from using up system resources. This can be done by specifying theMAX_ESTIMATED_EXEC_TIME parameter in the plan directive.
When a transaction is intiated resource manager makes an estimate of the processing time needed
to complete the transaction. If that time in seconds exceeds the value of this parameter the
transaction is aborted.If a resource consumer group has more than one plan directive assigned to it, the most restrictive
MAX_ESTIMATED_EXEC_TIME value is used.Automatic Consumer Group Switching
Oracle8i allowed resource intensive transactions to be manually switched between consumer groups to give them less priority. Oracle9i improves on this to allow the session to be automatically switched when it exceeds a specified threshold:SWITCH_GROUP- Defines the consumer group to switch to if the threshold is exceeded.SWITCH_TIME- Defines the threshold time.
If multiple plan directives are applied to a single consumer group the most restrictive
SWITCH_TIME
is used. If the plan directives have different SWITCH_GROUP values resource manager
decides which to use.When a transaction is switched to a new consumer group the active session pool of that group is not taken into account. This means the group may exceed it's active session pool limit until the session completes.
UNDO_POOL
TheUNDO_POOL parameter of a plan directive can be used to specify the maximum
amount of UNDO a resource consumer group can use. Once this threshold is met any transactions requiring
more UNDO will fail with the following error:This situation will persist until some UNDO is released from another transaction or the DBA increases the threshold. Once more UNDO is available transactions will proceed normally. This mechanism works regardless of whether UNDO is managed automatically or manually.ORA-30027: "Undo quota violation - failed to get %s (bytes)"
If processes die or are killed their undo is credited to the pool once recovery starts, regardless of how long recovery takes. That way users are not penalized during the recovery phase.
UNDO associated with recursive transactions is included with the top-level transaction and is not credited to the pool until the top-level transaction completes. Autonomous transactions are considered separately with their UNDO credited immediately on their completion.
Resource Plan Directive Interactions
If multiple resource plan directives are associated with a single resource consumer group the resulting actions will follow the following rules:- The minimum parallel degree limit of the incoming values will be used.
- The sum of the incoming active session pools will be used.
- The minimum incoming active session pool timout will be used.
- The smallest incoming switch time.
- The value TRUE overrides FALSE for the switch estimate.
- Resource manager chooses between multiple switch groups.
- If a session is switched to a new consumer group it executes regardless of the status of the active session pool in the new group.
- The most restrictive incoming maximum estimated execution time is used.
Modified Views
TheCURRENT_QUEUE_DURATION column has been added to the V$SESSION and V$MYSESSION views displaying the number of seconds the session has been queued or 0.The
QUEUE_LENGTH and CURRENT_UNDO_CONSUMPTION columns have been added to the V$RSRC_CONSUMER_GROUP view.
These dispay the current queue length and the UNDO consumption for the consumer group respectively.The
QUEUEING_MTH column on the DBA_RSRC_PLANS views indicates the queuing resource allocation method
for the plan.The
DBA_RESRC_PLAN_DIRECTIVES views has the QUEUEING_P1, SWITCH_GROUP, SWITCH_TIME, SWITCH_ESTIMATE, MAX_EST_EXEC_TIME and UNDO_POOL columns added to it.For more information see:
- Resource Manager (8i)
- Resource Manager Enhancements (10g)
- Resource Manager Enhancements (11g)
- DBMS_RESOURCE_MANAGER
- DBMS_RESOURCE_MANAGER_PRIVS
Back to the Top.
