1. 程式人生 > >根據SPID查找SQL語句

根據SPID查找SQL語句

pro ESS asc rev nbsp pre code lte res

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.paddr = (SELECT addr FROM v$process c WHERE c.spid = 23688)) ORDER BY piece ASC /

根據SPID查找SQL語句