找出session正在執行什麼語句

pentium發表於2007-07-28
SELECT /*+ ORDERED */
sql_text
FROM v$sqltext a
WHERE (a.hash_value, a.address) IN (
SELECT DECODE (sql_hash_value,
0, prev_hash_value,
sql_hash_value
),
DECODE (sql_hash_value, 0, prev_sql_addr, sql_address)
FROM v$session b
WHERE b.sid = &sid)
ORDER BY piece ASC
/[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/14377/viewspace-928803/,如需轉載,請註明出處,否則將追究法律責任。

相關文章