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
| Parameter | Description |
|---|---|
| attribute | The 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. |
| value | The attribute value to match, including absolute mappings and regular expressions. |
| consumer_group | The 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 Name | Value | Description |
|---|---|---|
| FUNCTION | COMPACTION_HIGH | Corresponds to Mini Merge and DDL KV Merge tasks. |
| FUNCTION | COMPACTION_MID | Corresponds to Minor Merge tasks. |
| FUNCTION | COMPACTION_LOW | Corresponds to Major Merge tasks. |
| FUNCTION | DDL_HIGH | Corresponds to DDL MemTable dump operations. |
| FUNCTION | CLOG_HIGH | Corresponds to clog log commit tasks. |
| FUNCTION | OPT_STATS | Corresponds to statistics collection tasks. |
| FUNCTION | MVIEW | Corresponds 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