You can extend an existing user ID to act as a role. If an original user has login privileges, the user-extended role retains the login privileges.
When converting a user to act as a role, you can appoint administrators for the role, and indicate whether they are also to be members of the role. If you do not specify any administrators, the global role administrator (any user granted the MANAGE ROLES system privilege) becomes the default administrator of the role.
However, if at least one role administrator is specified during conversion, global role administrators will be unable to manage the role because the SYS_MANAGE_ROLES_ROLE system privilege is not automatically granted to the role with administrative rights. For this reason, it is strongly recommended that you either do not define any role administrators when creating a role (add them after creation), or explicitly grant the SYS_MANAGE_ROLES_ROLE system privilege with administrative rights only along with any role administrators during the creation process.
Role administrators can be added and removed after conversion. When converting a user to act as a role, if the specified user ID does not already exist, the statement fails
Convert Condition | Statement |
---|---|
Global role administrator only; no role administrators |
CREATE ROLE FOR USER userID |
Role administrators with no role membership; no global role administrator |
CREATE ROLE FOR USER userID WITH ADMIN ONLY admin_name [,...] |
Role administrators with role membership; no global role administrator* |
CREATE ROLE FOR USER userID WITH ADMIN admin_name [,...] |
Role administrators with no role membership; global role administrator* |
CREATE ROLE FOR USER userID WITH ADMIN ONLY SYS_MANAGE_ROLES_ROLE, admin_name [,...] |
This statement extends user Sales1 to act as a role. Since no role administrators are specified, any user with the MANAGE ROLES system privilege can administrator the role.
CREATE ROLE FOR USER Sales1
This statement extends the user Marketing1 to act as a role, with Jane and Bob acting as role administrators. It also allows global role administrators to manage the role.
CREATE ROLE FOR USER Marketing1 WITH ADMIN ONLY SYS_MANAGE_ROLES_ROLE, jane, bob