Home  >  Article  >  Database  >  How to query the latest compilation time record of a stored procedure in Oracle

How to query the latest compilation time record of a stored procedure in Oracle

下次还敢
下次还敢Original
2024-04-18 21:18:161121browse

The steps to query the latest compilation time of a stored procedure in Oracle: Use the query statement: SELECT max(timestamp) AS "Last compilation time". Get data from the dba_objects table. Filter object_type = 'PROCEDURE' to get only stored procedures. Use object_name = 'stored procedure name' to filter out specific stored procedures.

How to query the latest compilation time record of a stored procedure in Oracle

How to query the latest compile time record of Oracle stored procedures

Query statement:

<code class="sql">SELECT max(timestamp) AS "最近编译时间"
FROM dba_objects
WHERE object_type = 'PROCEDURE'
AND object_name = '存储过程名称';</code>

Example:

<code class="sql">SELECT max(timestamp) AS "最近编译时间"
FROM dba_objects
WHERE object_type = 'PROCEDURE'
AND object_name = 'GET_EMPLOYEE_DETAILS';</code>

Execution result:

Latest compilation time
2023-03-08 14:32:15

##Explanation:

  • dba_objects The table stores information about Oracle database objects, including stored procedures.
  • max(timestamp) The function returns the maximum value of the timestamp column in the table, which represents the most recent compilation time of the stored procedure.
  • object_type = 'PROCEDURE' The filter ensures that the query only returns stored procedures.
  • object_name = 'stored procedure name' Filter narrows the query scope to a specific stored procedure.

The above is the detailed content of How to query the latest compilation time record of a stored procedure in Oracle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn