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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to derive the username that owns the SQL in V$SQLAREA

Re: How to derive the username that owns the SQL in V$SQLAREA

From: Peter Teoh <htmldeveloper_at_gmail.com>
Date: Sat, 1 Dec 2007 16:38:45 -0800 (PST)
Message-ID: <e6cf0194-ea51-47cb-81e3-33b40b863f9b@s12g2000prg.googlegroups.com>


On Dec 2, 8:12 am, Peter Teoh <htmldevelo..._at_gmail.com> wrote:
>
> I have given up. Anyone knows the answer?

Sorry, I have found the answer from Oracle Forums:

select username, sql_text
from v$session s, v$sqlarea sql
where s.sql_address = sql.address and s.sql_hash_value = sql.hash_value;

It is also wrong. Every time a user login, the following will be added to the list (according to the above SQL):

SELECT DECODE('A','A','1','2') FROM DUAL And all subsequently SQL issued by that user is not shown.

So how to get the list of all SQL belonging to that user? Received on Sat Dec 01 2007 - 18:38:45 CST

Original text of this message

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