Ask the Expert

How to find which stored procedure is currently running

How can I find out which stored procedure is currently running for a session?

    Requires Free Membership to View

The answer is to really find out which SQL statement a session is currently running. Stored procedures will appear as an SQL statement. To do this, we'll use the following query:

SELECT a.sqltext
FROM v$session s, v$sqlarea a
WHERE s.sql_address = a.addr
  AND s.sql_hash_value = a.hash_value
  AND s.username='MYUSER';
In my example, I limited this to just queries issued by MYUSER. But you can do other limitations on the V$SESSION view as well.

For More Information

This was first published in November 2002

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: