Multiple choice technology databases

Which table should you query to determine when your procedure was last compiled?

  1. USER_PROCEDURES

  2. USER_PROCS

  3. USER_OBJECTS

  4. USER_PLSQL_UNITS

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

USER_OBJECTS is the standard dictionary view containing LAST_DDL_TIME, which shows when any schema object (including procedures) was last compiled or modified. USER_PROCEDURES and USER_PROCS are not standard Oracle views. USER_PLSQL_UNITS may exist in some versions but USER_OBJECTS is the canonical source for compilation timestamps.

AI explanation

To determine when your procedure was last compiled, you should query the USER_OBJECTS table.

Let's analyze each option to understand why the correct answer is C:

Option A) USER_PROCEDURES - This option is incorrect because the USER_PROCEDURES table does not provide information about when a procedure was last compiled. It contains information about procedures owned by the current user, but not the compilation timestamp.

Option B) USER_PROCS - This option is incorrect because there is no standard Oracle table named USER_PROCS. It is not a valid table in the Oracle database.

Option C) USER_OBJECTS - This option is correct because the USER_OBJECTS table contains information about all objects owned by the current user, including procedures. It includes a LAST_DDL_TIME column that represents the timestamp of the last DDL (Data Definition Language) operation performed on the object, which includes the compilation of a procedure.

Option D) USER_PLSQL_UNITS - This option is incorrect because the USER_PLSQL_UNITS table stores information about PL/SQL units, such as packages, functions, and procedures. However, it does not specifically provide information about when a procedure was last compiled.

The correct answer is C) USER_OBJECTS. This table should be queried to determine when your procedure was last compiled because it includes the necessary information in the LAST_DDL_TIME column.