Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: How do I find out the SQL statements for a session

RE: How do I find out the SQL statements for a session

From: Reddy, Madhusudana <Madhusudana.Reddy_at_bestbuy.com>
Date: Wed, 02 Jul 2003 14:03:55 -0700
Message-ID: <F001.005C20C0.20030702135036@fatcity.com>

  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).
Received on Wed Jul 02 2003 - 16:03:55 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US