Creating Roles

A role is a group of privileges. The privileges can be assigned to a role, and then the role can be granted to multiple users and roles. When adding or deleting a privilege from a role, all users and roles assigned that role automatically receive or lose that privilege. A user or role can have multiple roles. A role can have a password. The roles can help you manage multiple privileges assigned to multiple users.

Creating Roles

To create a role, you must have the CREATE ROLE system privilege.


GRANT CREATE ROLE TO store;
GRANT CREATE USER TO store WITH ADMIN OPTION;

You create a role using the CREATE ROLE statement. The default is to do both.


CREATE ROLE firstRole;
CREATE ROLE secondRole IDENTIFIED by password;

GRANT SELECT, INSERT, UPDATE, DELETE ON employee TO firstRole;
GRANT SELECT, INSERT, UPDATE, DELETE ON products TO firstRole;
GRANT firstRole TO secondRole;
Home »
Oracle »
User, Privilege, Role » 

Roles:
  1. Creating Roles
  2. Granting Roles to a User
  3. Checking Roles Granted to a User
  4. Checking System Privileges Granted to a Role
  5. Checking Object Privileges Granted to a Role
  6. Default Roles
  7. Revoking a Role
  8. Dropping a Role
Related: