GRANT DATA ROLE

Purpose

Use GRANT DATA ROLE to grant one or more data roles to end users, data roles, or application identities.

Prerequisites

To execute this command, you must have the GRANT ANY DATA ROLE system privilege.

You can use the DBA_DATA_ROLE_GRANTS data dictionary view to query existing data role grants together with their properties, like start time and end time.

Note that data roles that are externally mapped cannot be granted to other end users or data roles within the database. They should be granted to application users or roles through the external identity provider.

Note that there are two distinct usages for data role grants:

You can use the same GRANT DATA ROLE statement for one usage or the other. Both usages may not be combined in a single statement. That is, the list of grantees can either be all application identities or no application identities. If a mixture of application identities and data roles or end users are specified, an error is raised (as data roles granted to application identity cannot be granted to other data roles or end users).

Syntax

Description of the illustration grant_data_role.gif

data_role_list

Description of the illustration data_role_list.gif

grantee_list

Description of the illustration grantee_list.gif

grantee

Description of the illustration grantee.gif

Semantics

Example

The following SQL statement illustrates granting of the data role manager_role to the end user marvin:

GRANT DATA ROLE manager_role TO marvin;

The following SQL statement illustrates granting of the data role employee_role to the data role manager_role:

GRANT DATA ROLE employee_role TO manager_role;