Debugging Events

本文深入探讨了数据库调试事件的概念、用途及其不同级别设置方法。详细介绍了如何通过启用或禁用特定事件来改变数据库行为,包括SQL跟踪基于的事件10046,以及不同级别的描述和行为变化。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.

 

LevelDescription
0The debugging event is disabled.
1The 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.
4As in level 1, with additional information about bind variables. Mainly, the data
type, its precision, and the value used for each execution.
8As 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.
12Simultaneously 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

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值