Home > Database > Oracle > body text

Where is the execution record of Oracle query stored procedure?

下次还敢
Release: 2024-04-19 05:39:14
Original
1003 people have browsed it

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.

Where is the execution record of Oracle query stored procedure?

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

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

<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:

  • Open a trace file session.
  • Execute the stored procedure.
  • Close the trace file session.
  • Locate and view the session log file.

The default location of the session log file is ORACLE_BASE/admin//udump/.trc.

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!

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