Q

How to find which stored procedure is currently running

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

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

Dig deeper on Oracle database design and architecture

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

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:

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close