web analytics

Oracle: text of the running SQL queries

SELECT s.sid, s.serial#, st.sql_text sql_text FROM v$session s, v$sql st, v$process p WHERE s.sql_hash_value = st.hash_value AND s.sql_address = st.address AND s.paddr = p.addr AND ( s.sid=&which_sid. )

Full text

SELECT x.sql_text FROM v$session s,v$sqltext x WHERE s.sql_address=x.address AND s.sid = &which_sid ORDER BY sid, piece ASC