Name
GRANT (System Privilege or Role)
Synopsis
GRANT {privilege
|role
][,[privilege
|role
] ...} TO {username
|role_name
| PUBLIC[,[username
|role_name
| PUBLIC] ...} [WITH ADMIN OPTION]
Grants a system privilege or role to one or more users or roles.
Keywords
- privilege
Specifies a system privilege to be granted.
- role
Specifies a role to be granted.
- TO username
Specifies the name of a user who is granted a privilege or role.
- TO role_name
Specifies the name of a role that is granted a privilege or role.
- PUBLIC
Specifies that the granted privilege or role is to be granted to all users, including those not yet created.
- WITH ADMIN OPTION
Specifies that the grantee of the privilege or role can grant the privilege or role to others, and may alter or drop the role.
Note
You must have the GRANT ANY PRIVILEGE privilege or have been granted the privilege or role WITH ADMIN OPTION to issue this command.
Example
The following example grants the account_admin role to scott and debby:
GRANT account_admin TO scott,debby
The following example grants CREATE USER and DROP USER privileges to the dba_assist role:
GRANT create user, drop user TO dba_assist
Get Oracle Database Administration: The Essential Refe now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.