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 can I see SQL executed by users?

Re: How can I see SQL executed by users?

From: M. Bhatti <mohammed.bhatti_at_mci.com>
Date: Tue, 13 Oct 1998 11:48:20 -0400
Message-ID: <36237643.99D2A778@mci.com>


DET wrote:

> I want to be able to see the full sql statements executed by a
> program. I've
> tried v$sqltext, but it's too short - cuts off the interesting parts.
>
> I don't have to see the stuff real-time. A log file would be fine. The
>
> server is 7.3.4, running on SCO OS5, and the client program is as
> well. Any
> advice?

  Have you tried v$sql. select sql_text from v$sql which gets you the first 1000 chars. I believe you can also match up the users running queries. select username, user# from v$session to get the user#. Then select v$sql where parsing_user_id =<user#> which gets you which user is executing the query.

You can also set a session trace on for a particular user using exec dbms_system.set_sql_trace_in_session(sid, serial#, true/false) and then tkprof the trace file.

mkb Received on Tue Oct 13 1998 - 10:48:20 CDT

Original text of this message

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