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.