Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to capture SQL statements that are currently being executed
I used almost the same scripts. But it doesn't work.
It seems that all of users' requests will be executed under the name of
oracle. And even worse, oracle is not executing the exact SQl
statement, but the 'interpreted' one.
I suspect whether it is due to the different version of classpath, our
programs are using classes111b.zip in classpath, which downloaded from
Oracle website, what are yours?
Thanks
In article <8plvbf$756$1_at_nnrp1.deja.com>,
buckeye714_at_my-deja.com wrote:
> In article <8plt02$43e$1_at_nnrp1.deja.com>,
> gzwzhang_at_my-deja.com wrote:
> > I found that my old method (using v$sqlarea, v$sqltext) can't grab
the
> > SQl statement coming from Java--Jdbc. I guess JDBC did
> > something to the original SQL statements written by Java/SQl
> > programmer. I know that I can turn on the sql_trace, but that will
> > cause some extra overhead. I don't want to trace any sql at any
time.
> > ONly when something happened and the Oracle seems abnormal will I
have
> > a look at what's current running.
> > Any idea will be highly appreciated.
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> I use the query below on our website database. All connections are
> through JDBC, but there are some stored procedures being run. In any
> case, the query listed below returns statements for every session in
the
> datbase. Hope this Helps.
>
> Patrick
>
> column username format a15
> select a.sid, a.username, b.sql_text
> from v$session a, v$sqltext b
> where a.sql_address = b.address
> and a.sql_hash_value = b.hash_value
> order by a.sid, a.username, b.piece
> /
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Sep 12 2000 - 14:42:12 CDT