Q
Problem solve Get help with specific problems with your technologies, process and projects.

Who is running which query?

How do I know that who is running which query? I know that sql_text view will give the text of the query. But I couldnt find any link in that to find out the username. Please let me know.

I like to join V$SQLAREA and V$SESSION to see who is running which query. The following query can give you an idea:

SELECT s.sid, s.username,a.sql_text
FROM v$session s, v$sqlarea a
WHERE a.address=s.sql_address  
AND a.hash_value=s.sql_hash_value;

The trick is to join these views on the SQL statement's "address" and "hash value".

Dig Deeper on Oracle database design and architecture

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.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close