Database Languages – DCL (Data Control Language) with Oracle Examples

Database Languages – DCL (Data Control Language)

Oracle SQL examples for managing user privileges and access control.

DCL (Data Control Language) is used to control access and permissions on database objects. It focuses on security and authorization rather than data or structure.

1. What is DCL?

  • Grant or revoke privileges to/from users.
  • Control access to tables, views, sequences, etc.
  • Requires DBA or owner privileges.

2. Common DCL Commands

CommandPurposeOracle Example
GRANTGive privileges to users
GRANT SELECT, INSERT ON student TO user1;
REVOKERemove privileges from users
REVOKE INSERT ON student FROM user1;

3. Oracle Examples in Detail

GRANT Example

GRANT SELECT, UPDATE, DELETE ON employee TO hr_user;

REVOKE Example

REVOKE UPDATE, DELETE ON employee FROM hr_user;

4. Key Points

  • DCL commands do not modify data.
  • Used to control access and security.
  • Requires proper privileges (DBA or object owner).
  • Often combined with roles in Oracle.

5. Summary

DCL (Data Control Language) manages user access and privileges in a database. The main commands are GRANT and REVOKE, which ensure data security and controlled access to database objects.

DCL, Data Control Language, Oracle SQL, GRANT, REVOKE, database security, privileges, access control, DBMS tutorial

কোন মন্তব্য নেই:

একটি মন্তব্য পোস্ট করুন