您好,登錄后才能下訂單哦!
Oracle Enqueue Names
Enquences 是為了管理 連續訪問數據庫資源而設計的一種共享內存結構也叫鎖。它們可以與會話或事務相關聯。Enquences 名顯示在DBA_LOCK和DBA_LOCK_INTERNAL數據字典視圖的LOCK_TYPE列中。
資源被唯一地標識一個對象,該對象可以被一個實例(本地資源)或多個實例之間(全局資源)的不同會話鎖定。每個想試圖鎖定資源的會話都在該資源上生成一個隊列。
下面是Oracle Enqueues對資源申請的鎖模式和申請資源
Enqueues are usually represented in the format "TYPE-ID1-ID2" where:
"TYPE" is a 2 character text string"ID1" is a 4 byte hexadecimal number
"ID2" is a 4 byte hexadecimal number Parameters:
P1 = Lock Type & Mode
P2 = Lock ID1
P3 = Lock ID2
Lock Type & Mode
The lock type and requested mode are encoded into P1 thus:
Convert P1 into hexadecimal (or use P1RAW) and extract the lock type and requested mode from this by converting the first 2 bytes of the hexadecimal number to ASCII and the second 2 bytes to a number:
Eg: 54580006
^^^^------ Converted to ASCII gives "TX" (0x54 = "T", 0x58 = "X")
^^^^-- 0006 is 6 in decimal so this is a mode 6 request
Note that on UNIX, the command 'man ascii' will display the Octal, hexadecimal, and decimal ASCII character sets to help with the hex translation.
An alternative way to extract this information is to use SQL thus:
SELECT chr(to_char(bitand(p1,-16777216))/16777215)||
chr(to_char(bitand(p1, 16711680))/65535) "Lock",
to_char( bitand(p1, 65535) ) "Mode"
FROM v$session_wait
WHERE event = 'enqueue'
;
Lock ID1
P2 represents ID1 of the enqueue name in decimal.
P2RAW represents ID1 of the enqueue name in hexadecimal.
Lock ID2
P3 represents ID2 of the enqueue name in decimal.
P3RAW represents ID2 of the enqueue name in hexadecimal.
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。