ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Oracle Wait Interface学习笔记(3) Common Wait Events(2)

Oracle Wait Interface学习笔记(3) Common Wait Events(2)

原创 Linux操作系统 作者:等待和希望 时间:2008-08-22 16:21:49 0 删除 编辑

(OWI学习笔记索引)

Direct path write

同direct path read相对应,是由于direct data loads(inserts with APPEND hint OR CATS)或并行的DML操作需要写入temporary segments引起的。

Enqueue

某一个Session需要使用数据库的某项资源时,由于有其他的session正在使用这一资源,就会产生enqueue等待事件。

Enqueue的种类是由两位字符表示的,常见的有:

l   ST Enqueue for Space Management Transaction

l   SQ Enqueue for Sequence Numbers

l   TX Enqueue for a Transaction

从10g开始,每种enqueue都由单独的等待事件来表示,而不再是合并在enqueue中由不同的种类区分了。

看个例子,在9i和10g分别实验,两个Session同时对同一张表作dml操作时,9i显示有”enqueue”事件,类型为“TX”,而10g报告的等待事件则为“enq: TX - row lock contention”。

--以下为9i的输出

select sid,event,p1text,p1,p2text,p2,p3text,p3,wait_time,state

from v$session_wait

where event='enqueue';

 

SID    EVENT    P1TEXT    P1  P2TEXT  P2  P3TEXT  P3  WAIT_TIME   STATE

22   enqueue name|mode   1415053318  id1 131073  id2 597156  0   WAITING

 

select sid,

chr(bitand(p1, -16777216)/16777215)||chr(bitand(p1,16711680)/65535) "Name",

(bitand(p1, 65535)) "Mode"

      from   v$session_wait where  event = 'enqueue';

SID  Name    Mode

22   TX  6

 

--以下为10g的输出

SQL> select sid,event,p1text,p1,p2text,p2,p3text,p3,wait_time,state from v$session_wait  where sid in (144);

SID    EVENT                                P1TEXT     P1           P2TEXT       P2     P3TEXT     P3    WAIT_TIME      STATE

144    enq: TX - row lock contention    name|mode 1415053318 usn<<16 | slot  655364 sequence  1619  0            WAITING

 

参数:P1-enqueue name and mode,encoded in ASCII format;

P2- Resource identifier ID1 for the requested lock, same as V$LOCK.ID1

P3- Resource identifier ID1 for the requested lock, same as V$LOCK.ID2

Free buffer waits

当session在buffer cache中找不到足够的free buffer用于read in data blocks或者build a consistent read(CR) image of data block时就会提交Free buffer waits。产生这个等待事件的原因可能是buffer cache过小,或者将脏块写入磁盘的速度过慢,一旦出现这个等待事件,用户进程就会向DBWR发送信号,要求其尽快将脏数据块写入磁盘。

参数:P1-用户读取的数据块的所在文件,P2-用户读取的数据块的所在block号,P3-10g才开始启动,用于记录BUFFER CACHE中LRU和LRUW的SET_ID#

Latch free

进程想要获取latch的时候发现该latch正被其他进程所占用,此时就会出现latch free wait事件。和enqueue不同的是,latch不使用queue,process在获取不到latch的情况下不进入queue等待而是等待一段时间以后再获取。

常见的latch包括cache buffer chains, library chache 以及shared pool等,详见第六章。

参数:P1-进程所等待的latch address,P2-latch number,可以通过v$latchname查询到对应的latch name,P3-尝试获取latch的次数

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/55472/viewspace-432999/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-05-09

  • 博文量
    39
  • 访问量
    93665