You can use Oracle Database Resource Manager to limit the number of parallel servers that parallel statements from lower priority consumer groups can use for parallel statement processing. Using Oracle Database Resource Manager you can map parallel statement sessions to different consumer groups that each have specific limits on the number of the parallel servers that can be used. Every consumer group has its own individual parallel statement queue. When these limits for consumer groups are specified, parallel statements from a consumer group are queued when its limit would be exceeded.
This limitation becomes useful when a database has high priority and low priority consumer groups. Without limits, a user may issue a large number of parallel statements from a low-priority consumer group that uses all parallel servers. When a parallel statement from a high priority consumer group is issued, the resource allocation directives can ensure that the high priority parallel statement is dequeued first. By limiting the number of parallel servers a low-priority consumer group can use, you can ensure that there are always some parallel servers available for a high priority consumer group.
To limit the parallel servers used by a consumer group, use the
parallel_server_limit parameter with the
CREATE_PLAN_DIRECTIVE procedure or the
new_parallel_server_limit parameter with the
UPDATE_PLAN_DIRECTIVE procedure in the
DBMS_RESOURCE_MANAGER package. The
parallel_server_limit parameter specifies the maximum percentage of the Oracle RAC-wide parallel server pool that is specified by
PARALLEL_SERVERS_TARGET that a consumer group can use.
For multitenant container database (CDB) resource plans, the parallel server limit applies to pluggable databases (PDBs). For PDB resource plans or non-CDB resource plans, this limit applies to consumer groups.
For example, on an Oracle RAC database system, the initialization parameter
PARALLEL_SERVERS_TARGET is set to 32 on two nodes so there are a total of 32 x 2 = 64 parallel servers that can be used before queuing begins. You can set up the consumer group PQ_LOW to use 50% of the available parallel servers (
parallel_server_limit = 50) and low priority statements can then be mapped to the PQ_LOW consumer group. This scenario limits any parallel statements from the PQ_LOW consumer group to 64 x 50% = 32 parallel servers, even though there are more inactive or unused parallel servers. In this scenario, after the statements from the PQ_LOW consumer group have used 32 parallel servers, statements from that consumer group are queued.
It is possible in one database to have some sessions with the parallelism degree policy set to
MANUAL and some sessions set to
AUTO. In this scenario, only the sessions with parallelism degree policy set to
AUTO can be queued. However, the parallel servers used in sessions where the parallelism degree policy is set to
MANUAL are included in the total of all parallel servers used by a consumer group.
For information about limiting parallel resources for users, refer to "When Users Have Too Many Processes" and "When to Limit the Number of Resources for a User using a Consumer Group".