#182 Trace session

open
nobody
None
5
2012-12-13
2003-03-10
Anonymous
No

Ability to trace a session from the session list.

Discussion

  • Henrik Johnson
    Henrik Johnson
    2003-03-10

    Logged In: YES
    user_id=2931

    How do you do that?

    /Mauritz
    Underscore AB

     
  • Logged In: NO

    Trace a session:

    EXEC SYS.DBMS_SYSTEM.Set_Sql_Trace_In_Session(sid, serial#,
    true );

    Trace a session with specific event/level:

    EXEC SYS.DBMS_SYSTEM.Set_Ev(sid, serial#, event, level, name);

    levels:
    1 - Standard SQL_TRACE functionality.
    4 - As level 1 plus tracing of bind variables.
    8 - As level 1 plus wait events.
    12 - As level 1 plus bind variables and wait events.

    You can also use the Oracle Trace (otrace) facility if
    installed:

    EXEC
    SYS.DBMS_ORACLE_TRACE_AGENT.SET_ORACLE_TRACE_IN_SESSION(sid,
    serial#, true/false, collection_name, server_event_set)

    See "Controlling Oracle Trace Collections from PL/SQL" from OTN:

    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96533/o_trace.htm