+3 votes
in Class 12 by kratos

What are privileges and roles?

1 Answer

+5 votes
by kratos
 
Best answer

The Privileges defines the access rights given to a user on a database object. There are two types of privileges.

  • System privileges – This allows the user to CREATE, ALTER, or DROP database objects.
  • Object privileges – This allows the user to ***, SELECT, INSERT, UPDATE, or DELETE data from database objects to which the privileges apply.

Few CREATE system privileges are listed below:

CREATE object – allows users to create the specified object in their own schema.
CREATE ANY object – allows users to create the specified object in any schema.

Few of the object privileges are listed below:

  • INSERT – allows users to insert rows into a table.
  • SELECT – allows users to select data from a database object.
  • UPDATE – allows user to update data in a table.
  • ** – allows user to ** a stored procedure or a function.

Roles:
Roles are a collection of privileges or access rights. When there are many users in a database it becomes difficult to grant or revoke privileges to users. Therefore, if roles are defined, one can grant or revoke privileges to users, thereby automatically granting or revoking privileges.

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

1. CONNECT – CREATE TABLE, CREATE VIEW, CREATE SYNONYM, CREATE SEQUENCE, CREATE SESSION, etc.

2. RESOURCE – CREATE PROCEDURE, CREATE SEQUENCE, CREATE TABLE, CREATE TRIG-GER, etc.

The primary usage of the RESOURCE role is to restrict access to database objects. DBA- ALL SYSTEM PRIVILEGES.

...