Skip to main content
Version: V1.0.0

SET_CONSUMER_GROUP_MAPPING

The SET_CONSUMER_GROUP_MAPPING procedure is used to add, delete, or modify entries that map sessions to resource groups based on session login and runtime attributes.

Syntax

DBMS_RESOURCE_MANAGER.SET_CONSUMER_GROUP_MAPPING(
attribute IN VARCHAR2,
value IN VARCHAR2,
consumer_group IN VARCHAR2 DEFAULT NULL);

Parameters

ParameterDescription
attributeThe attribute to be added or modified. In the current version, only the USER (the username of the database), COLUMN, and FUNCTION attribute values are supported. Due to the nature of seekdb's background tasks, such as compaction and dump operations, which are not user-specific and can consume CPU and I/O resources from other users and tasks, you can specify FUNCTION mappings for different background tasks. This allows the resources used by these background tasks to be limited to their corresponding resource groups.
valueThe attribute value to match, including absolute mappings and regular expressions.
consumer_groupThe name of the consumer group to map to. If NULL, the mapping will be deleted.

Usage

If no mapping exists for the specified attribute and value, a new mapping to the specified consumer group will be created. If a mapping already exists for the specified attribute and value, the consumer group associated with the mapping will be updated to the specified consumer group. If the consumer_group parameter is NULL, any existing mapping for the specified attribute and value will be deleted.

The following table lists the predefined FUNCTION resource group mapping rules in seekdb. You can use the DBMS_RESOURCE_MANAGER.SET_CONSUMER_GROUP_MAPPING procedure to modify or delete these mapping rules.

Attribute NameValueDescription
FUNCTIONCOMPACTION_HIGHCorresponds to Mini Merge and DDL KV Merge tasks.
FUNCTIONCOMPACTION_MIDCorresponds to Minor Merge tasks.
FUNCTIONCOMPACTION_LOWCorresponds to Major Merge tasks.
FUNCTIONDDL_HIGHCorresponds to DDL MemTable dump operations.
FUNCTIONCLOG_HIGHCorresponds to clog log commit tasks.
FUNCTIONOPT_STATSCorresponds to statistics collection tasks.
FUNCTIONMVIEWCorresponds to the I/O and CPU resource usage operations for incremental refresh of materialized views and MLOG Purge.

Examples

CALL DBMS_RESOURCE_MANAGER.SET_CONSUMER_GROUP_MAPPING(
attribute => 'COLUMN' ,
value => 't2.c3 = 3 for user1',
consumer_group => 'group1');
Query OK, 0 rows affected