In Oracle mode, you can grant a role to a user by using an SQL statement.
Prerequisites
To grant a role to a user, you must have the ADMIN OPTION or GRANT ANY ROLE privilege and the role to be granted. For information about how to view your privileges, see View user privileges. If you do not have the required privilege, contact the administrator to obtain the privilege. For information about how to grant privileges to a user, see Modify user privileges. For information about how to view your roles, see View roles.
Syntax and examples
The SQL statement is as follows:
GRANT role_name TO grantee_user [WITH ADMID OPTION];
where
role_namespecifies the name of the role to be granted to a user. When you grant multiple roles to a user at the same time, separate role names with commas (,).You can grant a role to multiple users at the same time, or grant multiple roles to one or more users at the same time.
WITH ADMIN OPTIONspecifies that the granted role can be granted to other users, and revoking the role does not automatically revoke the granted role from other users.
For example, grant the role1 role to the user2 user:
obclient> GRANT role1 TO user2;
Query OK, 0 rows affected
For more information about the GRANT statement, see GRANT.