Tuesday, April 14, 2009

How to find last executed queries in Oracle?

select c.spid b1, b.osuser c1, b.username c2, b.sid b2, b.serial# b3,
a.sql_text,b.status
from v$SQLTEXT_WITH_NEWLINES a
, v$session b, v$process c
where a.address = b.sql_address
and a.username='&username'
and b.paddr = c.addr
and a.hash_value = b.sql_hash_value
order by c.spid,a.hash_value,a.piece

No comments: