Managing database access involves controlling who can connect to the database and what actions they are allowed to perform on database objects (tables, views, procedures, etc.).
| Component | Description |
|---|---|
| Authentication | Verifying the identity of users or applications attempting to access the database. |
| Authorization | Granting or denying permissions to authenticated users for database operations. |
| Privileges and Roles | Using granular permissions and role-based access to manage user rights efficiently. |
| Auditing | Tracking user activities for security monitoring and compliance. |
Confirms the identity of the user connecting to the database.
Common methods:
Once authenticated, the database server checks what the user is authorized to do.
Controls access at multiple levels:
Basic permissions granted to users or roles to perform actions like:
SELECT – read dataINSERT – add new dataUPDATE – modify existing dataDELETE – remove dataEXECUTE – run stored procedures or functionsALTER – modify database objectsGranting Access:
GRANT SELECT, INSERT ON employees TO user_john;
Revoking Access:
REVOKE INSERT ON employees FROM user_john;
Enables access control at a more detailed level than just tables.
Examples:
Supported in DBMS like Oracle (VPD – Virtual Private Database), SQL Server, PostgreSQL.
Logging who accessed what and when.
Useful for:
| Topic | Purpose | Example Command |
|---|---|---|
| Authentication | Verify user identity | Database login process |
| Authorization | Grant or deny permissions | GRANT SELECT ON table TO user; |
| Privileges | Define specific operations allowed | INSERT, UPDATE, DELETE, EXECUTE |
| Role-Based Access | Manage access via roles | GRANT role TO user; |
| Fine-Grained Control | Row/column level restrictions | Row-level security policies |
| Auditing | Track and log database activity | Enable audit trails |
Open this section to load past papers