Wednesday, 4 June 2014

Query to find currently running sql in database

/* Formatted on 6/4/2014 3:02:05 PM (QP5 v5.115.810.9015) */
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.sql_hash_value = a.hash_value
      AND s.sql_address = a.address
      AND s.paddr = p.addr
      AND s.schemaname = UPPER ('&1')
      AND s.status = 'ACTIVE'

No comments:

Post a Comment