Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Semestr2 / 1 - Oracle / Oracle selected docs / Database concepts.pdf
Скачиваний:
29
Добавлен:
12.05.2015
Размер:
6.96 Mб
Скачать

How the Database Resource Manager Works

How the Database Resource Manager Works

The Database Resource Manager controls the distribution of resources among various sessions by controlling the execution schedule inside the database. By controlling which sessions to run and for how long, the Database Resource Manager can ensure that resource distribution matches the plan directive and hence, the business objectives.

Sessions belonging to consumer groups with higher CPU resource allocation are allowed to use more CPU time than sessions belonging to groups or sub plans with lower allocation.

Caution: On UNIX platforms, do not use the nice statement to alter the operating-system run priorities of processes. Use of this statement can lead to instability and unpredictable behavior of the Oracle Server. See "Interaction with Operating-System Resource Control" on page 9-17 for details.

Resource Control

The basic objective of the Database Resource Manager is to maximize system throughput in a way that conforms to business objectives. Consequently, it does not try to enforce CPU allocation percentage limits as long as consumer groups are getting the resources they need.

Example of Resource Control

Consider the plan in Table 9–1. If this plan is activated on a system with a single CPU, any one of the consumer groups can consume up to 100% of CPU resources, providing other groups do not have enough active sessions to consume their allocation. Therefore, with no active sessions in the SHIPPING and BILLING groups, the ONLINE group sessions can use 100% of CPU resources, even though their allocation limit is set to 85%.

Similarly, if the database is hosted on system with three CPUs and each group has only one active session, each session runs on one of the three CPUs; in this case, resource allocation is actually 33.33%, no matter how allocation limits are set. However, if all the consumer groups have enough active sessions to consume all available CPU resources, then the Database Resource Manager enforces the allocation guidelines specified by the plan directive.

Database Resource Management 9-5

How the Database Resource Manager Works

Effectiveness of the Database Resource Manager

The effect of the Database Resource Manager is noticeable only in busy environments with high system utilization.

On multiprocessor systems, processor affinity scheduling at the operating system level can distort CPU allocation on under utilized systems. On a system with multiple CPUs, if one of the CPUs has resources available while others are fully utilized, the operating system attempts to migrate processes from the busy processor's run queue to an under utilized processor. However this does not happen immediately.

On a fully loaded system with enough processes, processor affinity increases performance; this is because invalidating the current CPU cache and loading the new one can be quite expensive. Because most platforms support processor affinity, enough processes must be run to ensure full system utilization.

Database Integration

The Database Resource Manager is fully integrated into the database security system. The supplied PL/SQL package DBMS_RESOURCE_MANAGER lets the database administrator create, update, and delete resource plans and resource consumer groups. The administrator defines a user's default consumer group and what privileges the user has (using the DBMS_RESOURCE_MANAGER_PRIVS package). A user or session can switch resource consumer groups (using DBMS_ SESSION.SWITCH_CURRENT_CONSUMER_GROUP) to change execution priority, if the user has been granted the privilege to switch to that consumer group. In addition, users or sessions can be moved from group to group by the database administrator on a production system, dynamically changing the way CPU resources are used.

It is very simple to use the Database Resource Manager in an environment where each application user logs on to the database using a different database username. It is also not very difficult to implement it where applications use generic database login. Because Database Resource Manager actually controls resource utilization at the session level, it is possible to prioritize one session over another, even if both the sessions belong to the same database user. Therefore, it is possible to switch a session to the desired consumer group because of the user's application role, using the DBMS_SESSION.SWITCH_CURRENT_CONSUMER_GROUP procedure, as follows:

9-6 Oracle9i Database Concepts

Соседние файлы в папке Oracle selected docs