Debugging Events

DEBUGGING EVENT

A debugging event, which is identified by a numeric value, is the means used to set a type of flag in a running database engine process. The aim is to change its behavior, for example, by enabling or disabling a feature, by testing or simulating a corruption or crash, or by collecting trace or debug information. Some debugging events are not simple flags and can be enabled at several levels. Each level has its own behavior. In some situations, the level is an address of a block or memory structure.
You should use a debugging event with care and set it only when directed to do so by Oracle Support or if you know and understand what the debugging event is going to change. Debugging events enable specific code paths. Therefore, if a problem occurs when a debugging event is set, it is worth checking whether the same problem can be reproduced without the debugging event set.
Few debugging events are documented by Oracle. If documentation exists, it is usually provided through MetaLink notes. In other words, debugging events are generally not described in the official Oracle documentation about the database engine. You can find a complete list of the available debugging events in the file $ORACLE_HOME/rdbms/mesg/oraus.msg. Note that this file is not distributed on all platforms. The range from 10000 to 10999 is reserved for debugging events.

 

Levels of the Debugging Event 10046

SQL trace is based on debugging event 10046.

 

Level Description
0 The debugging event is disabled.
1 The debugging event is enabled. For each processed database call, the following
information is given: SQL statement, response time, service time, number of
processed rows, number of logical reads, number of physical reads and writes,
execution plan, and little additional information.
4 As in level 1, with additional information about bind variables. Mainly, the data
type, its precision, and the value used for each execution.
8 As in level 1, plus detailed information about wait time. For each wait experienced
during the processing, the following information is given: the name of the wait
event, the duration, and a few additional parameters identifying the resource that
has been waited for.
12 Simultaneously level 4 and level 8.

 

ALTER SESSION SET events '10046 trace name context forever, level 12'

ALTER SESSION SET events '10046 trace name context off'

 

 

dbms_monitor.session_trace_enable(session_id => 127,
                                  serial_num => 29,
                                  waits      => TRUE,
                                  binds      => FALSE)

 

dbms_monitor.session_trace_disable(session_id => 127,
                                   serial_num => 29)

 

Timing Information in Trace Files

ALTER SESSION SET timed_statistics = TRUE

 

ALTER SESSION SET max_dump_file_size = unlimited

 

 

你可能感兴趣的:(oracle,sql)