ALTER ROLE

Purpose

Use the ALTER ROLE statement to change the authorization needed to enable a role.

See Also:

Prerequisites

You must either have been granted the role with the ADMIN OPTION or have ALTER ANY ROLE system privilege.

Before you alter a role to IDENTIFIED GLOBALLY, you must:

The one exception to this rule is that you should not revoke the role from the user who is currently altering the role.

To specify the CONTAINER clause, you must be connected to a multitenant container database (CDB). To specify CONTAINER = ALL, the current container must be the root. To specify CONTAINER = CURRENT, the current container must be a pluggable database (PDB).

Syntax

alter_role::=

Description of the illustration alter_role.eps

Semantics

The keywords, parameters, and clauses in the ALTER ROLE statement all have the same meaning as in the CREATE ROLE statement.

Specify GLOBALLY with AS to map a directory group to a global role when using centrally managed users. The directory group is identified by its domain name.

Restriction on Altering a Role

You cannot alter a NOT IDENTIFIED role to any of the IDENTIFIED types if it is granted to another role.

Notes on Altering a Role:

For more information, refer to CREATE ROLE and to the examples that follow.

Examples

Changing Role Identification: Example

The following statement changes the role warehouse_user (created in “Creating a Role: Example”) to NOT IDENTIFIED:

ALTER ROLE warehouse_user NOT IDENTIFIED;

Changing a Role Password: Example

This statement changes the password on the dw_manager role (created in “Creating a Role: Example”) to data:

ALTER ROLE dw_manager
   IDENTIFIED BY data;

Users granted the dw_manager role must subsequently use the new password data to enable the role.

Application Roles: Example

The following example changes the dw_manager role to an application role using the hr.admin package:

ALTER ROLE dw_manager IDENTIFIED USING hr.admin;