等待事件的一个合集
官方文档
V$EVENT_NAME
displays information about wait events.
Column | Datatype | Description |
EVENT# | NUMBER | Number of the wait event |
EVENT_ID | NUMBER | Identifier of the wait event |
NAME | VARCHAR2(64) | Name of the wait event. Names that appear in this column remain stable across Oracle Database releases, and they can be relied on by customer scripts. |
PARAMETER1 | VARCHAR2(64) | Description of the first parameter for the wait event |
PARAMETER2 | VARCHAR2(64) | Description of the second parameter for the wait event |
PARAMETER3 | VARCHAR2(64) | Description of the third parameter for the wait event |
WAIT_CLASS_ID | NUMBER | Identifier of the class of the wait event |
WAIT_CLASS# | NUMBER | Number of the class of the wait event |
WAIT_CLASS | VARCHAR2(64) | Name of the class of the wait event See Also: "Classes of Wait Events" for a description of the different wait event classes |
DISPLAY_NAME | VARCHAR2(64) | A clearer and more descriptive name for the wait event that appears in the NAME column. Names that appear in theDISPLAY_NAME column can change across Oracle Database releases, therefore customer scripts should not rely on names that appear in the DISPLAY_NAME column across releases. |
CON_ID | NUMBER | The ID of the container to which the data pertains. Possible values include: 0: This value is used for rows containing data that pertain to the entire CDB. This value is also used for rows in non-CDBs. 1: This value is used for rows containing data that pertain to only the root n: Where n is the applicable container ID for the rows containing data |
字段解释
EVENT# :事件号
EVENT_ID:事件ID
NAME:事件名称
PARAMETER1,PARAMETER2,PARAMETER3:等待事件相关的3个参数
WAIT_CLASS_ID:等待事件的所属类ID
WAIT_CLASS#:等待事件的类号
WAIT_CLASS:等待事件类型
DISPLAY_NAME(12c):等待事件对应更清晰的描述
CON_ID(12c): 数据所属的容器的ID。 可能的值包括:0:该值用于包含与整个CDB相关的数据的行,此值也用于非CDB中的行。1:该值用于仅包含根的数据的行。n:其中 n是包含数据的行的适用容器ID。
示例:
EVENT# | EVENT_ID | NAME | PARAMETER1 | PARAMETER2 | PARAMETER3 | WAIT_CLASS_ID | WAIT_CLASS# | WAIT_CLASS | DISPLAY_NAME | CON_ID |
212 | 3926164927 | direct path read | file number | first dba | block cnt | 1740759767 | 8 | User I/O | direct path read | 0 |
Classes of Wait Events
每一个等待事件所属的类别,分为以下几大类:
Administrative:DBA命令导致的等待(例如,索引重建)
Application:应用程序的等待(例如,由行级锁定或显式锁定命令引起的锁定等待)
Cluster:与RAC资源有关的锁(例如,全局缓存资源,如“gc cr block busy”)
Commit:仅包含一个等待事件 - 等待重做日志写入确认(即“log file sync”)
Concurrency:等待数据库内部资源(例如,latches)
Configuration:由于数据库或实例资源配置不正确导致的等待(例如,不合适的logfile大小,shared pool size)
Idle:这个等待表示会话不活动,是空闲状态(例如,“SQL*Net message from client”)
Network:与网络消息相关的等待(例如,“SQL*Net more data to dblink”)
Other:通常不会在系统上发生等待(例如,“wait for EMON to spawn”)
Queue:包含表示在流水线环境中获取更多数据的延迟的事件。 在这些等待事件上花费的时间表明无效率或其他问题正在进行中。 它 会影响诸如Oracle Streams,并行查询或DBMS_PIPE PL / SQL包之类的功能。
Scheduler:资源管理器相关等待(例如,“resmgr: become active”)
System I/O:等待后台进程I / O(例如,DBWR等待'db file parallel write')
User I/O:等待User I/O(例如“db file sequential read”)
等待事件Parameters
block#
等待的块号对应的block number,使用如下sql定位
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;
blocks
从文件读取或写入的块数。 块大小取决于文件类型:数据库文件的块大小取决于DB_BLOCK_SIZE。日志文件和控制文件的块大小等于操作系统平台的物理块大小。
break?
如果此参数的值等于0,则会向客户端发送重置。 非零值表示break已发送到客户端。
class
表示块的类型。 例如,类1表示数据块,类4表示段头。使用如下sql的输出查询。
SELECT view_definition FROM V_$FIXED_VIEW_DEFINITION WHERE view_name='GV$WAITSTAT';
dba
缩写,“dba”表示由文件号和块号组成的数据块地址。
driver id
当前正在使用的驱动程序的断开连接功能的地址。
file#
文件号
id1
enqueue或者global lock的第一个标识符(id1)从P2或者P2RAW取值。标识符含义取决于P1的名称。
id2
enqueue或者global lock的第二个标识符(id2)从P3或者P3RAW取值。标识符含义取决于P1的名称。
le
相对索引号为V$GC_ELEMENT。
mode
该模式通常存储在P1或P1RAW的低位字节中,表示enqueue或者global lock请求的模式。具体如下:
Mode Value | Description |
1 | Null mode |
2 | Sub-Share |
3 | Sub-Exclusive |
4 | Share |
5 | Share/Sub-Exclusive |
6 | Exclusive |
使用以下SQL语句来检索锁的名称和锁定请求的模式:
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 and type
可以通过查看P1或P1RAW的两个高位字节来确定enqueue或者global lock的名称或“类型”。名字总是两个字符。使用以下SQL语句来检索锁名称:
select chr(bitand(p1,-16777216)/16777215)||
chr(bitand(p1,16711680)/65535) "Lock"
from v$session_wait
where event = 'DFS enqueue lock acquisition';
namespace
对象名称空间的名称,显示在V$DB_OBJECT_CACHE试图.
requests
“请求”的I / O数量。这与块的数量不同,因为一个请求可能包含多个块。
session#
inactive session的sid。
waited
会话等待该会话终止的总时间。