Tag: databases

Questions Related to databases

User system granted SELECT ANY TABLE to user A using WITH ADMIN OPTION. A then granted SELECT ANY TABLE to user B. Ian A left the company, and his account is dropped. What happens to B's privileges?

  1. B loses his privileges.

  2. B retains his privileges.

  3. B loses his privileges if A was dropped with the CASCADE REVOKE option.

  4. B retains his privileges if A was dropped with the NOCASCADE REVOKE option.


Correct Option: B

AI Explanation

To answer this question, we need to understand how privilege inheritance works in Oracle databases.

When user A is granted the SELECT ANY TABLE privilege with the WITH ADMIN OPTION, it means that A can not only select from any table but also grant the same privilege to other users.

When A grants the SELECT ANY TABLE privilege to user B, B inherits the privilege from A. This means that B retains the privilege independently of A's account status.

Therefore, even if A's account is dropped or revoked, user B will still retain the SELECT ANY TABLE privilege.

The correct answer is B. B retains his privileges.

Which of the following system privileges can allow the grantee to masquerade as another user and therefore should be granted judiciously?

  1. CREATE ANY JOB

  2. ALTER USER

  3. CREATE ANY PROCEDURE

  4. All of the above


Correct Option: D
  1. alter session enable role user_admin;

  2. alter session set role user_admin;

  3. alter role user_admin enable;

  4. set role user_admin;


Correct Option: D

Which of the following SQL statements allows user augustin to use the privileges associated with the password-protected role info_czar, which has been granted to him?

  1. set role all;

  2. alter user augustin default role all;

  3. alter session enable role info_czar;

  4. alter session enable info_czar identified by brozo


Correct Option: B

Which things should be considered while deciding the size of undo tablespace in your database ( choose three)

  1. The size of an undo block

  2. The size of the redo log files.

  3. The size of the database buffer cache.

  4. The value of the UNDO_RETENTION parameter.

  5. Undo blocks generated per second.


Correct Option: A,D,E

You suspect unauthorized data manipulation language (DML) operations on a particular table. You want to track users who performing the transactions and the values used in the transactions. Also you plan to transfer these values to another table for analysis. How would you achieve this?

  1. By auditing the all DML operations on table.

  2. By using external table.

  3. By using triggers.

  4. By using anonymous PL/SQL blocks


Correct Option: C

Which of the following is invalid db2 component :

  1. System Services

  2. Locking Services

  3. SQL Services

  4. Distributed DATA Facilities


Correct Option: C

AI Explanation

To answer this question, we need to understand the components of IBM DB2, a relational database management system. Let's go through each option to understand why it is correct or incorrect:

Option A) System Services - This option is a valid component of DB2. System Services provide the basic functions and utilities required for the operation of the DB2 system.

Option B) Locking Services - This option is a valid component of DB2. Locking Services manage the concurrent access to data by multiple users, ensuring data integrity and preventing conflicts.

Option C) SQL Services - This option is invalid. There is no such component called "SQL Services" in DB2.

Option D) Distributed DATA Facilities - This option is a valid component of DB2. Distributed Data Facilities enable the integration and management of data across multiple DB2 systems.

The correct answer is Option C) SQL Services. This option is incorrect because there is no such component in DB2 called "SQL Services".

Package is a

  1. Compiled form of application plan

  2. Compiled form of Database Requests

  3. Collection of Sql statements

  4. Collection of Application plansCollection of Application plans


Correct Option: B

AI Explanation

To answer this question, we need to understand what a package is in the context of computer programming.

Option A) Compiled form of application plan - This option is incorrect. A package is not specifically a compiled form of an application plan. An application plan is a high-level overview of the steps and logic involved in executing an application.

Option B) Compiled form of Database Requests - This option is correct. A package in this context refers to a compiled form of database requests or SQL statements. It is a collection of SQL statements that are pre-compiled and stored in a database for efficient execution.

Option C) Collection of SQL statements - This option is partially correct. A package does contain a collection of SQL statements, but it is more specifically the compiled form of those statements.

Option D) Collection of Application plans - This option is incorrect. A package is not a collection of application plans. As mentioned earlier, an application plan is a high-level overview of the steps and logic involved in executing an application.

Therefore, the correct answer is B) Compiled form of Database Requests.

Responsibility of OPTIMIZER is :

  1. Compiles the SQL statements

  2. Complies the list of packages into application plan

  3. Stored the application plan and packages into Directory

  4. Chooses the best access path from catalog tables


Correct Option: D
Explanation:

To answer this question, the user needs to know about the role of an optimizer in database management systems.

The optimizer is a component of a database management system (DBMS) that is responsible for generating the most efficient execution plan for a given SQL query.

Now let's go through each option and explain why it is right or wrong:

A. Compiles the SQL statements: This option is partially correct. The optimizer does not compile SQL statements, but it does analyze the query and generates an execution plan to execute the SQL statement.

B. Complies the list of packages into application plan: This option is incorrect. The job of the precompiler is to compile the list of packages into an application plan, not the optimizer.

C. Stored the application plan and packages into Directory: This option is incorrect. The job of the precompiler is to store the application plan and packages into a directory, not the optimizer.

D. Chooses the best access path from catalog tables: This option is correct. The optimizer analyzes the query and chooses the best access path from a set of possible access paths based on the metadata stored in the catalog tables.

Therefore, the correct answer is:

The Answer is: D

If an object is dropped , all Application plans that were using the object are marked by DB2 as invalid ( True or False)

  1. True

  2. False


Correct Option: A
Explanation:

To solve this question, the user needs to understand the concept of object dropping in DB2 and how it affects application plans.

When an object is dropped in DB2, all application plans that use that object are invalidated by DB2. This is because the object no longer exists and any references to it in the application plans are no longer valid. Therefore, the correct answer is:

The Answer is: A. True