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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to trace user performing a query?

Re: How to trace user performing a query?

From: <bialik_at_wis.weizmann.ac.il>
Date: Tue, 21 Apr 1998 15:46:43 -0600
Message-ID: <6hj0jj$l4l$1@nnrp1.dejanews.com>


In article <353C4238.F3A3E57B_at_usa.net>,   Sim Keng Hwee <simkh_at_usa.net> wrote:
>
> In Database Trigger, it can only trace Update, Delete and Insert
> action. What if I want to trace user performing query? Could it be
> done? If yes, how it can be done? Please advice. Thank you.
>
>

Hi.
 You can do it by following :

  1. Let user issue a command : ALTER SESSION SET SQL_TRACE = TRUE; From that moment on - all SQL statements will be traced and execution stats will be written at <...>.TRC file in the directory specified by user_dump_dest parameter.
  2. If your user can not issue such a command - use DBMS_SYSTEM package to set SQL_TRACE for his/her session. The same *.TRC file will be created. After you finished running all problematic SQL's reset the trace ( either by ALTER SESSION SET SQL_TRACE = FALSE; or by using DBMS_SYSTEM package. Use TKPROF utility to get a readable report from your trace file.

 Good luck.

    Michael.

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Tue Apr 21 1998 - 16:46:43 CDT

Original text of this message

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