MCQs on Managing Users and Security | SQL Database Security

1. Creating and Managing Users in Oracle

  1. Which statement is used to create a new user in Oracle?
    a) CREATE USER
    b) ADD USER
    c) NEW USER
    d) CREATE ACCOUNT
  2. Which of the following is used to assign a password to a user in Oracle?
    a) PASSWORD
    b) IDENTIFIED BY
    c) SET PASSWORD
    d) USERPASSWORD
  3. Which command is used to alter the properties of a user in Oracle?
    a) MODIFY USER
    b) CHANGE USER
    c) ALTER USER
    d) UPDATE USER
  4. What is the default tablespace for a newly created user in Oracle?
    a) SYSTEM
    b) USERS
    c) TEMP
    d) DEFAULT
  5. What privilege is required to create a new user in Oracle?
    a) CREATE SESSION
    b) ALTER USER
    c) CREATE USER
    d) DBA

2. Role-Based Access Control

  1. What is the purpose of roles in Oracle?
    a) To provide access to tables
    b) To assign privileges to users
    c) To manage user authentication
    d) To track user activity
  2. Which command is used to create a role in Oracle?
    a) CREATE ROLE
    b) NEW ROLE
    c) ADD ROLE
    d) DEFINE ROLE
  3. Which of the following is used to assign a role to a user in Oracle?
    a) GRANT
    b) ASSIGN
    c) ADD ROLE
    d) SET ROLE
  4. What role is required for a user to be able to manage other users in Oracle?
    a) DBA
    b) SYSDBA
    c) RESOURCE
    d) ADMIN
  5. Which privilege does a user need to grant a role to another user?
    a) ALTER USER
    b) GRANT ANY ROLE
    c) CREATE ROLE
    d) GRANT ANY PRIVILEGE

3. Object Privileges and System Privileges

  1. What type of privilege allows a user to perform operations on a specific table in Oracle?
    a) Object privilege
    b) System privilege
    c) User privilege
    d) Admin privilege
  2. Which of the following is an example of an object privilege in Oracle?
    a) CREATE SESSION
    b) SELECT
    c) ALTER SYSTEM
    d) CREATE TABLE
  3. What is the purpose of system privileges in Oracle?
    a) To manage tables
    b) To manage users and roles
    c) To perform specific database operations
    d) To query data
  4. Which privilege allows a user to create tables in Oracle?
    a) CREATE TABLE
    b) CREATE SESSION
    c) CREATE DATABASE
    d) ALTER TABLE
  5. Which command is used to revoke a privilege from a user in Oracle?
    a) REMOVE PRIVILEGE
    b) REVOKE
    c) DROP PRIVILEGE
    d) CANCEL PRIVILEGE

4. Auditing and Security Best Practices

  1. Which command is used to enable auditing for a user in Oracle?
    a) AUDIT
    b) ENABLE AUDIT
    c) START AUDIT
    d) BEGIN AUDIT
  2. Which Oracle component is responsible for auditing database activities?
    a) Oracle Audit Trail
    b) Oracle Security Manager
    c) Oracle Data Guard
    d) Oracle Flashback
  3. Which of the following is a best practice for user security in Oracle?
    a) Grant all privileges to the DBA role
    b) Use complex passwords and change them regularly
    c) Assign roles based on job titles only
    d) Share user accounts to save time
  4. What is the purpose of the Oracle database audit trail?
    a) To store backup information
    b) To log all database transactions and activities
    c) To maintain user passwords
    d) To track database performance
  5. Which of the following is a recommended best practice for securing Oracle databases?
    a) Disable all database logs
    b) Use a default password for all users
    c) Implement role-based access control
    d) Allow users to share their login credentials

5. Understanding Oracle Virtual Private Database (VPD)

  1. What is the main function of the Oracle Virtual Private Database (VPD)?
    a) To allow multiple users to access a database simultaneously
    b) To enforce security policies and data access control
    c) To create virtual databases
    d) To back up data remotely
  2. In VPD, which object is used to define the security policies for data access?
    a) Policy function
    b) Database trigger
    c) Security role
    d) Data view
  3. Which feature of VPD allows the database to dynamically alter queries based on the user’s context?
    a) Fine-grained access control
    b) Row-level security
    c) Transparent data encryption
    d) Data partitioning
  4. Which of the following is true about Oracle Virtual Private Database?
    a) VPD can only be used with Oracle Enterprise Edition
    b) VPD restricts user access to specific rows in a table
    c) VPD is designed for network security only
    d) VPD requires a dedicated database instance
  5. Which PL/SQL function is used in Oracle to implement Virtual Private Database (VPD) policies?
    a) DBMS_RLS.ADD_POLICY
    b) DBMS_SECURITY.POLICY
    c) DBMS_ACCESS.GRANT_PRIVILEGE
    d) DBMS_ROLE.CREATE_POLICY
  6. What is the purpose of the DBMS_RLS package in Oracle?
    a) To manage database security logs
    b) To add and manage VPD policies
    c) To back up sensitive data
    d) To create roles and assign privileges
  7. In VPD, what does the security policy function do?
    a) It defines the role for a user
    b) It generates the SQL query based on the user’s access
    c) It logs all database access attempts
    d) It restricts access to database connections
  8. Which of the following is a benefit of using Oracle Virtual Private Database?
    a) It allows only specific users to access a table’s schema
    b) It encrypts data at rest automatically
    c) It provides row-level security based on the user context
    d) It increases the speed of data queries
  9. What is the main advantage of Oracle VPD over traditional database security?
    a) VPD allows administrators to create read-only tables
    b) VPD enables dynamic, user-specific query restrictions
    c) VPD encrypts all sensitive data automatically
    d) VPD provides full access control to the database schema
  10. Which Oracle feature is used to implement Virtual Private Database for controlling access to rows of data?
    a) Fine-grained access control
    b) Transparent data encryption
    c) Data Redaction
    d) Oracle Data Guard

Answer Table

QnoAnswer (Option with the text)
1a) CREATE USER
2b) IDENTIFIED BY
3c) ALTER USER
4b) USERS
5c) CREATE USER
6b) To assign privileges to users
7a) CREATE ROLE
8a) GRANT
9b) SYSDBA
10b) GRANT ANY ROLE
11a) Object privilege
12b) SELECT
13c) To perform specific database operations
14a) CREATE TABLE
15b) REVOKE
16a) AUDIT
17a) Oracle Audit Trail
18b) Use complex passwords and change them regularly
19b) To log all database transactions and activities
20c) Implement role-based access control
21b) To enforce security policies and data access control
22a) Policy function
23a) Fine-grained access control
24b) VPD restricts user access to specific rows in a table
25a) DBMS_RLS.ADD_POLICY
26b) To add and manage VPD policies
27b) It generates the SQL query based on the user’s access
28c) It provides row-level security based on the user context
29b) VPD enables dynamic, user-specific query restrictions
30a) Fine-grained access control

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top