Home > Database > Oracle > 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

下次还敢
Release: 2024-04-18 21:18:16
Original
1152 people have browsed it

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>
Copy after login

Example:

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

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template