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: Tracing SQL statements

Re: Tracing SQL statements

From: Tim Lange <tim.lange_at_abbott.com>
Date: Fri, 04 Sep 1998 08:36:15 -0500
Message-ID: <35EFECCF.3219CA7D@abbott.com>


Also, the DBMS_SYSTEM package can be used to enable SQL tracing in another session. That way you can log on to the system as a DBA, determine which session is causing problems and then turn trace on for that particular session.

In SQL*Plus: (Logon as SYS, unless you grant more privileges).

To enable trace for a session:

    execute dbms_system.set_sql_trace_in_session(session, serial, true);

To disable trace:

    execute dbms_system.set_sql_trace_in_session(session, serial, false);

    then run "tkprof" against the file.

session and serial to supply in these commands can be obtained from v$session.

Regards,
Tim

Pavel Polcar wrote:

> Hi,
>
> put SQL_TRACE=TRUE in your INITxxxx.ORA file if you want to activate tracing
> for all sessions. Within a session, you can activate/deactivate tracing with
> ALTER SESSION SET SQL_TRACE=TRUE/FALSE. The trace files will be created in
> the directory pointed to by USER_DUMP_DEST from your INITxxxx.ORA file.
>
> Hth,
> --
> Pavel Polcar
> John Bester wrote in message <35f01a06.0_at_informer.hixnet.co.za>...
> >I have Oracle 7.3 and would like to know how I can trace SQL statements.
> >---
> >John Bester
> >iCONNECT
> >johnb_at_iconnect.co.za
> >
> >
Received on Fri Sep 04 1998 - 08:36:15 CDT

Original text of this message

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