Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How can I see SQL executed by users?
Perfect. thanks.
I figured it had to be something simple; but you could bang around randomly in the Oracle docs forever without finding what you want....
M. Bhatti wrote in message <36237643.99D2A778_at_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 - 11:12:17 CDT
![]() |
![]() |