How to query the latest compilation time of stored procedures in Oracle? Connect to Oracle database. Execute the following SQL query: SELECT OBJECT_NAME, LAST_COMPILEDFROM USER_OBJECTSWHERE OBJECT_TYPE = 'PROCEDURE' AND OBJECT_NAME = '<stored procedure name>';View the LAST_COMPILED field in the query results, which displays the most recent compile time of the stored procedure.
How to query the latest compilation time of stored procedures in Oracle
Oracle database provides a database called A data dictionary view of USER_OBJECTS
, which stores various information about database objects, including the compile time of the stored procedure. To query the most recent compile time of a stored procedure, you can use the following steps:
<code class="sql">SELECT OBJECT_NAME, LAST_COMPILED FROM USER_OBJECTS WHERE OBJECT_TYPE = 'PROCEDURE' AND OBJECT_NAME = '<存储过程名称>';</code>
where'<stored procedure name>'
is the query The name of the stored procedure at compile time.
LAST_COMPILED
field in the query results will display the most recent compilation time of the stored procedure. The timestamp format is YYYY-MM-DD HH24:MI:SS.FF
, where: For example, the following query results show the most recent compilation time of the stored procedure named GET_CUSTOMER
:
<code class="sql">OBJECT_NAME LAST_COMPILED ------------------- ---------------------------------------- GET_CUSTOMER 2023-03-06 10:15:34.233</code>
means that the GET_CUSTOMER
stored procedure was compiled in 2023 Compiled at 10:15:34.233 on March 6th.
The above is the detailed content of How to query the latest compilation time of a stored procedure in Oracle. For more information, please follow other related articles on the PHP Chinese website!