(M8S2-POWERPOINT) - Data Control Language (DCL)
(M8S2-POWERPOINT) - Data Control Language (DCL)
(M8S2-POWERPOINT) - Data Control Language (DCL)
OBJECTIVES
■At the end of the chapter, the learner should be able to:
• Differentiate system privileges from object privileges
• Grant privileges on tables
• Grant roles
• Distinguish between privileges and roles
Database
administrator
Users
• Database security:
- System security
- Data security
• System privileges: Performing a particular action within the
database
• Object privileges: Manipulating the content of the database
objects
• Schemas: Collection of objects such as tables, views, and
sequences
Database Systems 1
•More than 100 privileges are available.
•The database administrator has high-level system privileges
for tasks such as:
• Creating new users
• Removing users
• Removing tables
• Backing up tables
Database Systems 1
• The database administrator (DBA) creates users with the CREATE USER statement.
Database Systems 1
• After a user is created, the DBA can grant specific system privileges to that user.
GRANT privilege [, privilege...]
TO user [, user| role, PUBLIC...];
• An application developer, for example, may have the following system privileges:
• CREATE SESSION
• CREATE TABLE
• CREATE SEQUENCE
• CREATE VIEW
• CREATE PROCEDURE
Database Systems 1
The DBA can grant specific system privileges to a user.
Database Systems 1
Give a user authority to pass along system privileges:
Database Systems 1
Users
Manager
Privileges
Database Systems 1
• Create a role:
CREATE ROLE manager;
Database Systems 1
• The DBA creates your user account and initializes your password.
• You can change your password by using the ALTER USER statement.
Database Systems 1
Object
privilege Table View Sequence
ALTER
DELETE
INDEX
INSERT
REFERENCES
SELECT
UPDATE
• Object privileges vary from object to object.
• An owner has all the privileges on the object.
• An owner can give specific privileges on that owner’s object.
Database Systems 1
• Grant query privileges on the EMPLOYEES table:
GRANT select
ON employees
TO demo;
Database Systems 1
• Give a user authority to pass along privileges:
GRANT select, insert
ON departments
TO demo
WITH GRANT OPTION;
• Allow all users on the system to query data from Alice’s DEPARTMENTS table:
GRANT select
ON alice.departments
TO PUBLIC;
Database Systems 1
Data Dictionary View Description
Database Systems 1
Revoke the SELECT and INSERT privileges given to the demo user on the
DEPARTMENTS table.
Database Systems 1
In this lesson, you should have learned about statements that control
access to the database and database objects.
Statement Action
Introduction to Programming