Roger Xu wrote: > > Hi, > > >From V$SESSION, I can find out all the sessions for a user. > How do I find out the current SQL and previous SQL for that session? > > Thanks, > > Roger Xu > Database Administrator > Dr Pepper Bottling Company of Texas > (972)721-8337 >
SQL statements are identified by an address (location of the cursor in SGA) and a hash value (to make sure that the address has not been reused by another cursor). 999 first characters can be found in V$SQL or V$SQLAREA. For longer statements nose around V$SQLTEXT or V$SQLTEXT_WITH_NEWLINES. I still have to see the 'previous SQL' coordinates point to something else than the 'current SQL'. -- Regards, Stephane Faroult Oriole Software -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stephane Faroult INET: [EMAIL PROTECTED] Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
