Security Roles   «Prev  Next»
Lesson 3 Creating roles
Objective Create DBA role.

Creating Roles for Database Security

As a database administrator, you can appreciate the power of roles in implementing database security. There are three steps involved in using roles:
  1. Creating the role
  2. Granting privileges to the role
  3. Granting the role to users
You create a role by using the SQL command CREATE ROLE. The syntax for the role is described in the following MouseOver.

CREATE ROLE rolename
  1. The CREATE ROLE keywords are required.
  2. The rolename is an identifying name for the role.

SQL>  Create role select_data_role;
SQL> Grant select on emp to select_data_role;
SQL> Grant select on dept to select_data_role;
SQL> Grant select on bonus to select_data_role;

The name of the role must be unique within the database.

Creating a role with Security Manager

Creating Security-manager Role.
The next lesson shows how to grant privileges to a role and grant a role to a user.