Methods to view stored procedure execution records in Oracle include: using the V$SYSSTAT table to query execution times and timestamps; using the V$SQL_WORKAREA table to obtain current execution information; viewing session log files, you need to open the tracking session And check after closing.
How to view stored procedure execution records in Oracle
In Oracle database, you can view storage through the following methods Process execution records:
1. Use the V$SYSSTAT table
The V$SYSSTAT table stores data about system statistics, including the number of execution times of the stored procedure. To query the execution record of a stored procedure, please use the following SQL statement:
<code class="sql">SELECT * FROM V$SYSSTAT WHERE NAME = 'user_procedure_executions';</code>
This statement will return the number of times the stored procedure has been executed, the last execution timestamp and other information.
2. Use the V$SQL_WORKAREA table
The V$SQL_WORKAREA table stores information about the currently executing SQL statement. If a stored procedure is being executed, this table contains information about the stored procedure. To view the execution record of a stored procedure, use the following SQL statement:
<code class="sql">SELECT * FROM V$SQL_WORKAREA WHERE OWNER = '<owner_name>' AND NAME = '<stored_procedure_name>';</code>
<owner_name>
is the owner name of the stored procedure, <stored_procedure_name>
is Stored procedure name.
3. View the session log file
The session log file records information about session activities, including stored procedure execution records. To view the session log file, use the following steps:
The default location of the session log file is ORACLE_BASE/admin/
The above is the detailed content of Where is the execution record of Oracle query stored procedure?. For more information, please follow other related articles on the PHP Chinese website!