Oracle wait event 等待事件

來源:互聯網
上載者:User

等待事件的源起
等待事件的概念大概是從Oracle 7.0.12中引入的,大致有100個等待事件。在ORACLE 8.0中這個數目增大到了大約150個,在ORACLE 8I中大約有220個事件,在ORACLE 9IR2中大約有400個等待事件,而在最近ORACLE 10GR2中,大約有874個等待事件。

雖然不同版本和組件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

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 下一頁

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.