All the sqls executed by a session
chinnaNov 15 2007 — edited Nov 16 2007This is in 10gR2. I want to see all the SQLs executed by a session w/o tracing the session. I have this query using ASH but I am not sure if I am getting the correct results. It looks like for every SQL execution, this query shows 3 rows. Could somebody check this. Thanks in advance.
select ash.SESSION_ID SID, ash.sample_time TIME, sa.sql_text
from v$active_session_history ash, v$sqlarea sa
where session_id = 106
and ash.sql_id = sa.sql_id
order by 2 desc;