February 26th, 2009, 05:23 AM
Find out what are sql statements are currently running--THIS IS URGENT!!
From database server, I need to monitor the details about the sql statements which are being currenlt running in client machines.
I tried with V_$SQLTEXT view where I can only see the SQL statements, hash value,address,SQL_id. but I'm not able to get the user name,name the client machine .
Can anyone please help me to find out these details?.Which Data Dictionary i need to use ?.
Thanks in advance for your efforts.
February 26th, 2009, 10:12 AM
SELECT s.SID, s.STATUS, s.process, s.osuser, a.sql_text, p.program
FROM v$session s, v$sqlarea a, v$process p
WHERE s.PREV_HASH_VALUE = a.hash_value
AND s.PREV_SQL_ADDR = a.address
AND s.paddr = p.addr
AND s.STATUS = 'ACTIVE'
That should do it.
Comments on this post
February 27th, 2009, 05:24 AM
One of my friend help me & I've tried this query.....
select b.sql_id, a.sql_text, b.osuser, b.USERNAME
from sys.v_$sqltext a, Sys.v_$session b
where a.SQL_ID = b.SQL_ID;
I got more information from your query...
Thanks a lot for your help!!!