Join To Consumer Group
Published by : Obay Salah , November 19, 2024
We mentioned in the previous step that the user is granted the privilege to join a Consumer Group via the procedure GRANT_SWITCH_CONSUMER_GROUP.
We cited an example with the user OBAY, who was granted the privilege to join the NEW_GROUP. However, at this moment, user OBAY has not joined the NEW_GROUP; they have only been granted the privilege to join it.
The Resource Manager can add the user to the group using the procedure SET_INITIAL_CONSUMER_GROUP, where the user and the group are specified within the procedure.
However, the Resource Manager cannot add a user to a group if they do not have the privilege to join that group. Attempting to do so will result in failure unless the user is first granted the privilege to join the group.
DECLARE USER VARCHAR2(200); CONSUMER_GROUP VARCHAR2(200); BEGIN USER := 'OBAY'; CONSUMER_GROUP := 'NEW_GROUP'; SYS.DBMS_RESOURCE_MANAGER.SET_INITIAL_CONSUMER_GROUP ( USER, CONSUMER_GROUP ); COMMIT; END;
Now it can be confirmed that the user OBAY has joined the CONSUMER GROUP named NEW_GROUP.
SELECT INITIAL_RSRC_CONSUMER_GROUP FROM DBA_USERS WHERE USERNAME='OBAY';
Comments
no comment yet!