1. query on v$session to get the SID select sid from v$session where username='user_name';
2. Then pass sid to the follwing query select sql_text from v$sqlarea a, v$session b where a.hash_value=b.sql_hash_value and a.address=b.sql_address and b.sid=&essiedi / 3. Also query v$open_cursor to check all the SQL statements executed by that user session. Madhu Reddy X13944 -----Original Message----- Sent: Wednesday, July 02, 2003 3:56 PM To: Multiple recipients of list ORACLE-L 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 ________________________________________________________________________ This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com ________________________________________________________________________ -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Roger Xu 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Reddy, Madhusudana 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).