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: Chuck Hamilton <chuckh_at_safeaccess.net>
Date: Wed, 14 Oct 1998 12:49:16 GMT
Message-ID: <36259d1b.1521133@news.axs2000.net>


You can also join v$session with v$sql where v$session.sql_address = v$sql.address to see the currently running sql, or v$session.prev_sql_addr = v$sql.address to see the previous sql for any session.

        Chuck

On Tue, 13 Oct 1998 11:48:20 -0400, "M. Bhatti" <mohammed.bhatti_at_mci.com> wrote:

>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

--
Chuck Hamilton
chuckh_at_safeaccess.net

If at first you don't succeed, sky diving isn't for you. Received on Wed Oct 14 1998 - 07:49:16 CDT

Original text of this message

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