一 描述
参考官方文档中等待事件第二部分 Descriptions of Common Wait Event Parameters , 大致列出常用等待事件的参数说明.此档并未对参数进行详细说明.给出等待事件大致内容.
二 过程
按照Oracle® Database Reference 11g Release 2 (11.2) Part Number E17110-05 C Oracle Wait Events 官档的大纲内容进行整理。纲要内容如下:
Classes of Wait Events
Descriptions of Common Wait Event Parameters
Descriptions of Wait Events
关于等待事件的信息可以在三个动态性能视图中显示出来:
v$session_wait sessions正在进行或者已经完成的events
v$system_event 所有每个sessions已经完成的某个等待事件的总共等待次数 (翻不明白了,原文这样的:displays the total number of times all the sessions have waited for the events in that view.)
v$session_event 跟v$system_event相似,但是只显示当前session的所有每一个等待事件的总共等待次数。
下面的sql语句列出所有wait events 及其wait class .
SQL> SELECT name, wait_class FROM V$EVENT_NAME ORDER BY name;
此篇文档介绍Descriptions of Common Wait Event Parameters
三 详细内容
此部分描述了一些经常使用的wait event parameters.
1.block#
数据等待的block number。此block#与其相应的数据文件相关,用下面的sql语句找到此块与之对应的object:(注意需要提供file#与block#两个数值)
select segment_name, segment_type, owner, tablespace_name
from dba_extents
where file_id = file#
and block#
between block_id and block_id + blocks - 1;
2.blocks
正在向文件中读或写的block数。Block大小与文件类型相关。
数据文件block大小与 db_block_size 相关
日志文件与控制文件的block大小与操作系统平台的块大小相关。
3.break?
0表示服务端向客户端发送一个重置(reset)信息,非0表示服务器端向客户端发送一个断开(break)消息。
[If the value for this parameter equals 0, a reset was sent to the client. A nonzero value indicates that a break was sent to the client.]
block的class。例如 class1 表明此block为data block,class4 表明此block为segment header。「The class of the block describes how the contents of the block are used. For example, class 1 represents data block, and class 4 represents segment header.」
data block address,包含文件号与块号。
「The initials "dba" represents the data block ddress, which consists of a file number and a block number.」
服务器端和客户端连接使用的协议信息。
driver的disconnect function当前使用的地址. (注:参考文档中写的跟官档的说明以现在的水平看不明白.)
[The address of the disconnect function of the driver that is currently being used.]
数据库文件编号,以下语句返回数据库文件的名字及其他信息。(需提供file#)
select *
from v$datafile
where file# = file#;
enqueue或global lock的第一个identifier(id1),具体的值从P2或P2RAW中获得,具体identifier的意思参考P1. (P1在哪里?)
[The first identifier (id1) of the enqueue or global lock takes its value from P2 or P2RAW. The meaning of the identifier depends on the name (P1).]
enqueue或global lock的第二个identifier(id1),具体的值从P3或P3RAW中获得,具体identifier的意思参考P1. (P1在哪里?)
[The second identifier (id2) of the enqueue or global lock takes its value from P3 or P3RAW. The meaning of the identifier depends on the name (P1).]
(注:不明白)
The relative index number into V$GC_ELEMENT.
(注:不明白,mode常存储P1或P1RAW的low order?)
The mode is usually stored in the low order bytes of P1 or P1RAW and indicates the mode of the enqueue or global lock request. This parameter has one of the following values:
1 | |
2 | |
3 | |
4 | |
5 | |
6 | Exclusive |
Use the following SQL statement to retrieve the name of the lock and the mode of the lock request:
select chr(bitand(p1,-16777216)/16777215)||
chr(bitand(p1, 16711680)/65535) "Lock",
bitand(p1, 65535) "Mode"
from v$session_wait
where event = 'DFS enqueue lock acquisition';
(注:不明白,name or type 可以显示two high order bytes of P1 or P1RAW?)
The name or "type" of the enqueue or global lock can be determined by looking at the two high order bytes of P1 or P1RAW. The name is always two characters. Use the following SQL statement to retrieve the lock name.
select chr(bitand(p1,-16777216)/16777215)||
chr(bitand(p1,16711680)/65535) "Lock"
from v$session_wait
where event = 'DFS enqueue lock acquisition';
object namespace中的name.与v$db_object_cache视图中显示的相同.
[The name of the object namespace as it is displayed in V$DB_OBJECT_CACHE view.]
I/O请求的次数.不同于请求的blocks数,发起一次request可能包含多块.
[The number of I/Os that are "requested." This differs from the number of blocks in that one request could potentially contain multiple blocks.]
inactive的session号。用下面的语句查找更多的信息。
The number of the inactive session. Use the following SQL statement to find more information about the session:
select *
from v$session
where sid = session#;
直到session终断所记录的等待总时间。
「This is the total amount of time the session has waited for this session to terminate.」
四 个人总结
等待事件为判断等待情况的重要部分.
问题:等待事件参数id1,id2中的P1在哪里看? request参数的理解是否正确?
五 资料参考引用
Oracle® Database Reference 11g Release 2 (11.2) Part Number E17110-05
http://blog.sina.com.cn/s/blog_4dc6402101011eqp.html
namespace 参考 http://blog.csdn.net/tianlesoftware/article/details/6624122
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11780477/viewspace-753244/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/11780477/viewspace-753244/