Oracle wait event 等待事件

2014-11-24 18:14:19 · 作者: · 浏览: 4

虽然不同版本和组件event, '%B0%B2%D7%B0');" target="_self">安装可能会有不同数目的等待事件,但是这些等待事件都可以通过查询V$EVENT_NAME视图获得:


SQL> select * from v$version;


BANNER


----------------------------------------------------------------


Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod


PL/SQL Release 10.2.0.1.0 - Production


CORE 10.2.0.1.0 Production


TNS for 32-bit Windows: Version 10.2.0.1.0 - Production


NLSRTL Version 10.2.0.1.0 – Production


SQL> select count(*) from v$event_name;


COUNT(*)


----------


872


ORACLE的等待事件,主要可以分为两类,即空闲(IDLE)等待事件和非空闲(NON-IDLE)等待事件。


1). 空闲等待事件指ORACLE正等待某种工作,在诊断和优化数据库的时候,不用过多注意这部分事件。


2). 非空闲等待事件专门针对ORACLE的活动,指数据库任务或应用运行过程中发生的等待,这些等待事件是在调整数据库的时候需要关注与研究的。


下面来看一下ORACLE 10GR2中主要分类及各类等待事件的个数:


SQL> select wait_class#,wait_class_id,wait_class,count(*) as "count"


2 from v$event_name


3 group by wait_class#,wait_class_id,wait_class


4 order by wait_class#;


WAIT_CLASS# WAIT_CLASS_ID WAIT_CLASS count


----------- ------------- ------------------------------ ----------


0 1893977003 Other 588


1 4217450380 Application 12


2 3290255840 Configuration 23


3 4166625743 Administrative 46


4 3875070507 Concurrency 24


5 3386400367 Commit 1


6 2723168908 Idle 62


7 2000153315 Network 26


8 1740759767 User I/O 17


9 4108307767 System I/O 24


10 2396326234 Scheduler 2


11 3871361733 Cluster 47


12 rows selected.


常见的空闲事件有:


dispatcher timer


lock element cleanup


Null event


parallel query dequeue wait


parallel query idle wait - Slaves


pipe get


PL/SQL lock timer


pmon timer- pmon


rdbms ipc message


slave wait


smon timer


SQL*Net break/reset to client


SQL*Net message from client


SQL*Net message to client


SQL*Net more data to client


virtual circuit status


client message


一些常见的非空闲等待事件有:


db file scattered read


db file sequential read


buffer busy waits


free buffer waits


enqueue


latch free


log file parallel write


log file sync