DBMS_SUPPORT.START_TRACE_IN_SESSION Procedure

This procedure enables event 10046 trace in another session.

The SID, serial# of the target session can be obtained from V$SESSION.

Argument Name Type In/Out Default?
SID NUMBER IN
SERIAL NUMBER IN
WAITS BOOLEAN IN DEFAULT
BINDS BOOLEAN IN DEFAULT

The serial number can also be specified as 0.

There are two optional Boolean parameters, waits and binds, both of which default to FALSE.

For example to enable event 10046, level 1 trace in a session with SID 9, serial number 29 use:

EXECUTE dbms_support.start_trace_in_session (9, 29);

This is equivalent to:

EXECUTE dbms_system.set_ev (9, 29, 10046, 1, '');

To enable event 10046, level 4 trace (bind variables) in a session with SID 9, serial number 29 use

EXECUTE dbms_support.start_trace_in_session (9, 29, binds->true);

This is equivalent to:

EXECUTE dbms_system.set_ev (9, 29, 10046, 4, '');

To enable event 10046, level 8 trace (waits) in a session with SID 9, serial number 29 use:

EXECUTE dbms_support.start_trace_in_session (9, 29, waits->true);

This is equivalent to:

EXECUTE dbms_system.set_ev (9, 29, 10046, 8, '');