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 last published in November 2002

Dig Deeper on Oracle database design and architecture

PRO+

Content

Find more PRO+ content and other member only offers, here.

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.

Start the conversation

Send me notifications when other members comment.

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

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close