The DBMS_RESOURCE_MANAGER_PRIVS
package maintains privileges associated with the Resource Manager.
See Also:
For more information on using the Database Resource Manager, see Oracle Database Administrator's Guide.This chapter contains the following topics:
Table 121-1 DBMS_RESOURCE_MANAGER_PRIVS Package Subprograms
Subprogram | Description |
---|---|
Grants the privilege to switch to resource consumer groups |
|
Performs a grant of a system privilege |
|
Revokes the privilege to switch to resource consumer groups. |
|
Performs a revoke of a system privilege |
This procedure grants the privilege to switch to a resource consumer group.
DBMS_RESOURCE_MANAGER_PRIVS.GRANT_SWITCH_CONSUMER_GROUP ( grantee_name IN VARCHAR2, consumer_group IN VARCHAR2, grant_option IN BOOLEAN);
If you grant permission to switch to a particular consumer group to a user, then that user can immediately switch their current consumer group to the new consumer group.
If you grant permission to switch to a particular consumer group to a role, then any users who have been granted that role and have enabled that role can immediately switch their current consumer group to the new consumer group.
If you grant permission to switch to a particular consumer group to PUBLIC
, then any user can switch to that consumer group.
If the grant_option
parameter is TRUE
, then users granted switch privilege for the consumer group may also grant switch privileges for that consumer group to others.
In order to set the initial consumer group of a user, you must grant the switch privilege for that group to the user.
See Also:
Chapter 120, "DBMS_RESOURCE_MANAGER"BEGIN DBMS_RESOURCE_MANAGER_PRIVS.GRANT_SWITCH_CONSUMER_GROUP ( 'scott', 'mail_maintenance_group', true); DBMS_RESOURCE_MANAGER.CREATE_PENDING_AREA(); DBMS_RESOURCE_MANAGER.set_consumer_group_mapping( dbms_resource_manager.oracle_user, 'scott','mail_maintenance_group'); DBMS_RESOURCE_MANAGER.SUBMIT_PENDING_AREA(); END; /
This procedure performs a grant of a system privilege to a user or role.
DBMS_RESOURCE_MANAGER_PRIVS.GRANT_SYSTEM_PRIVILEGE ( grantee_name IN VARCHAR2, privilege_name IN VARCHAR2 DEFAULT 'ADMINISTER_RESOURCE_MANAGER', admin_option IN BOOLEAN);
Currently, Oracle provides only one system privilege for the Resource Manager: ADMINISTER_RESOURCE_MANAGER
. Database administrators have this system privilege with the ADMIN
option. The grantee and the revokee can either be a user or a role. Users that have been granted the system privilege with the ADMIN
option can also grant this privilege to others.
This procedure revokes the privilege to switch to a resource consumer group.
DBMS_RESOURCE_MANAGER_PRIVS.REVOKE_SWITCH_CONSUMER_GROUP ( revokee_name IN VARCHAR2, consumer_group IN VARCHAR2);
If you revoke a user's switch privilege for a particular consumer group, then any subsequent attempts by that user to switch to that consumer group will fail.
If you revoke the initial consumer group from a user, then that user will automatically be part of the DEFAULT_CONSUMER_GROUP
consumer group when logging in.
If you revoke the switch privilege for a consumer group from a role, then any users who only had switch privilege for the consumer group through that role will not be able to switch to that consumer group.
If you revoke the switch privilege for a consumer group from PUBLIC
, then any users who could previously only use the consumer group through PUBLIC
will not be able to switch to that consumer group.