Grant a Role To Users

GRANT manager TO SAM, STARK;
Grant succeeded.

SQL | Creating Roles

A role is created to ease the setup and maintenance of the security model. It is a named group of related privileges that can be granted to the user. When there are many users in a database it becomes difficult to grant or revoke privileges to users. Therefore, if you define roles:

  1. You can grant or revoke privileges to users, thereby automatically granting or revoking privileges.
  2. You can either create Roles or use the system roles pre-defined.

Some of the privileges granted to the system roles are as given below:

System Roles  Privileges Granted to the Role
Connect Create table, Create view, Create synonym, Create sequence, Create session, etc.
Resource Create Procedure, Create Sequence, Create Table, Create Trigger etc. The primary usage of the Resource role is to restrict access to database objects.
DBA All system privileges

Similar Reads

Creating and Assigning a Role

First, the (Database Administrator)DBA must create the role. Then the DBA can assign privileges to the role and users to the role....

Grant Privileges To a Role

GRANT create table, create view TO manager; Grant succeeded....

Grant a Role To Users

GRANT manager TO SAM, STARK; Grant succeeded....

Revoke Privilege from a Role

REVOKE create table FROM manager;...

Drop a Role

DROP ROLE manager;...

Contact Us