Thursday, September 3, 2009

Get running cursors and their queries


SELECT NVL(USERNAME,'SYSTEM PROC') USER_NAME, t2.SID,
SQL_TEXT
FROM v$open_cursor t1, v$session t2
WHERE t2.SQL_ADDRESS = t1.ADDRESS
AND t2.SQL_HASH_VALUE = t1.HASH_VALUE
ORDER BY 1

No comments:

Post a Comment