Identify ksusetxn DID:An Deadlock ID

我们在查看10704 event trace(Print out information about what enqueues are being obtained)或deadlock detected trace死锁检测跟踪日志时,总是会看到名为”DID”的名词,影响”DID”这个名词被正确理解的一个原因是你很难通过search engine正确找到相关的正确解释(被误解)。

那么DID到底是什么东西呢?我们来看一下trace中的DID:

=====================10704 enqueue trace========================

ksqgtl *** CU-913f5a28-00000000 mode=6 flags=0x10010 timeout=300 ***
ksqgtl: no transaction
ksqgtl: use existing ksusetxn DID
ksqgtl:
        ksqlkdid: 0002-001E-00000026

*** 2011-05-09 23:44:15.210
*** ksudidTrace: ksqgtl
        ksusesdi:   0002-001E-00000025
        ksusetxn:   0002-001E-00000026
ksqgtl: RETURNS 0

*** 2011-05-09 23:44:15.212
ksqrcl: CU,913f5a28,0
ksqrcl: returns 0

*** 2011-05-09 23:44:15.212
ksqgtl *** TM-00013abc-00000000 mode=6 flags=0x401 timeout=21474836 ***
ksqgtl: xcb=0x97227118, ktcdix=2147483647, topxcb=0x97227118
        ktcipt(topxcb)=0x0

*** 2011-05-09 23:44:15.212
ksucti: init txn DID from session DID
ksqgtl:
        ksqlkdid: 0002-001E-00000026

*** 2011-05-09 23:44:15.212
*** ksudidTrace: ksqgtl
        ktcmydid(): 0002-001E-00000026
        ksusesdi:   0002-001E-00000025
        ksusetxn:   0002-001E-00000026

===========================global enqueue deadlock detected==========================

Global Wait-For-Graph(WFG) at ddTS[0.1] :
BLOCKED 0xda9da740 5 wq 2 cvtops x1 TX 0x110001.0x8c(ext 0x5,0x0)[34000-0001-0000006E] inst 1
BLOCKER 0x99a2bf50 5 wq 1 cvtops x28 TX 0x110001.0x8c(ext 0x5,0x0)[1E000-0002-0000001D] inst 2
BLOCKED 0x99448ad8 5 wq 2 cvtops x1 TX 0x9000d.0x7b9(ext 0x2,0x0)[1E000-0002-0000001D] inst 2
BLOCKER 0xda983008 5 wq 1 cvtops x28 TX 0x9000d.0x7b9(ext 0x2,0x0)[34000-0001-0000006E] inst 1

DID即Deadlock id,在Oracle死锁检测时充当一个进程的identifier.可以看到lmd RAC后台进程的global enqueue deadlock detected日志中的DID与单实例死锁检测日志或10704事件跟踪日志中的DID在格式上存在区别,但他们的内容是一样的,我们以单实例中的DID为例:

002-001E-00000026

002:instance number,实例号

001E: 十进制的30,ORACLE PID,ORACLE进程号

0026:十进制的38,类似于v$session.serial#,ORACLE PID的一个串行值,复用ORACLE PID后会递增

global enqueue deadlock detected日志中的DID也是类似的,仅仅是把instance number和oracle pid的顺序颠倒了,同时pid要从高位读起。


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *