The only real way is by sampling or tracing .......
Depending on how the application is written, then V$OPEN_CURSOR might provide what you are looking for -- a "history" of SQL statements executed by a session. However, it is at best only the most primitive of logging for that purpose, and if the application takes care to close unused cursors, it will be a misleadingly incomplete history. So, you almost have to hope for a sloppily written application, which is sadly not too much to hope for... :-)
Just an idea...
* On Thu, 24 Aug 2006 19:24:13 +0400, Vadim Bobrov wrote*
> Not, unless you traced it. And then you would get this info from a trace file, not from v$ views >
> ------------------------------ *From:* oracle-l-bounce@xxxxxxxxxxxxx [mailto: oracle-l-bounce@xxxxxxxxxxxxx] *On Behalf Of *Dhimant Patel > *Sent:* Thursday, August 24, 2006 6:39 PM > *To:* oracle-l > *Subject:* Chasing a session... > > > Gurus, > > Is there a straight way of querying v$SQL* views in order to retrieve all queries made by a session > including a recursive queries made by oracle on behalf of user. > Assume that SID and SERIAL# are known for the session. > > > I could not think of any other ways but tracing a session and then use TKPROF, which is not always possible and/or desirable. > > Thanks for advice - > DP.
-- Anjo Kolk Owner and Founder OraPerf Projects tel: +31-577-712000 mob: +31-6-55340888