當前位置:
首頁 > 最新 > Oracle Mutex 等待事件

Oracle Mutex 等待事件

welcome to enmoedu

1

Oracle Mutex 等待事件之: cursor pin S

pin S 等待事件說明,當一個會話(session)試圖去更新一個共享的 Mutex Pin,同時已經有其他會話正在更新(updating)同一個 Shared Mutex Pin。注意,Pin S 的Mutex位於子游標上,是動態創建的,無法從等待事件中獲得,但是可以在競爭出現的情況下,通過觀察 x$mutex_sleep_history 來獲得。

文檔說明如下:

2

Oracle Mutex 等待事件之: cursor pin X

在 Oracle 官方文檔,關於 cursor pin X 等待事件的說明是:

A session waits on this event when it is requesting an exclusive mutex pin for a cursor object and it must wait because the resource is busy. The mutex pin for a cursor object can be busy either because a session is already holding it exclusive, or there are one or more sessions which are holding shared mutex pin(s). The exclusive waiter must wait until all holders of the pin for that cursor object have released it, before it can be granted. Wait Time:Microseconds

翻譯過來就是:

當一個會話對一個 cursor 對象請求 排他模式的 Mutex pin 時,因為該對象已有 X 或者 S 模式的 Mutex pin 存在,所以必須處於等待。直至所有 X 或 S 模式的 pin 被釋放後,才能夠獲得 X pin。

cursor pin X 等待有三個參數,第一個參數就是 cursor 的 hash value。

文檔說明如下:

需要對 Cursor 執行 Pin X 的操作包括:

會話在某些串列化操作時需要獲得 X 模式的 Pin,例如構建一個子游標;

在Cursor 上執行排他操作,如 dbms_shared_pool.purge, keep/unkeep 等;

一個或多個進程正在reference 該Mutex (shared mutex pin)

3

Oracle Mutex 等待事件之: cursor: mutex S

Cursor: Mutex S 等待事件是指,一個會話以共享模式請求一個Mutex,而其他會話以排他模式正在持有Cursor 上的 Mutex。

從文檔說明可以看到,此處的Mutex是位於 Cursor 對象上的固有 Mutex,也就是針對 Parent Cursor 的。這個等待的第一個參數會披露出 SQL 的 Hash Value。

4

Oracle Mutex 等待事件之: cursor mutex X

Cursor Mutex X 是當會話對某個 Cursor 請求排他模式鎖,但是該Cursor 上已經有 S 或 X 模式的鎖定,因而產生的等待。

需要持有 Cursor Mutex X 的操作主要有:

在父游標下創建新的子游標,但是這類操作在11.2之後被 Build Lock 替代,不再需要;

捕獲SQL中的綁定變數;

更新、生成 SQL 統計信息,主要是 V$SQLSTATS 的內容;

Cursor Mutex X 主要指對於父游標的操作;

Building a new cursor under a parent

Although this operation is cheaper, building many cursors under a parent cursor is not recommended.

Capture SQL bind data

Build or Update statistics blocks

Mutex is in the parent cursor.

以下是在生產環境中觀察到的實際現象,注意在獲取 cursor:mutex X 的過程中,調用的底層函數是kkscsAddChildNode 這是增加子游標的操作,需要進一步的獲取排他Mutex ,使用的函數是 kgxExclusive :

關於Mutex 的使用一直在變化之中。

作者簡介:

蓋國強

Oracle ACE總監,中國十大傑出資料庫工程師之一(2006),ITPUB論壇Oracle管理版版主,ITPUB論壇超級版主,《程序員》雜誌特邀專家顧問。蓋國強是國內第一位Oracle ACE及Oracle ACE總監,作為Oracle技術的推廣者,在2010年創建了國內第一個Oracle用戶組ACOUG(ALL China Oracle User Group),並迅速成為國際Oracle用戶組的重要成員。

喜歡這篇文章嗎?立刻分享出去讓更多人知道吧!

本站內容充實豐富,博大精深,小編精選每日熱門資訊,隨時更新,點擊「搶先收到最新資訊」瀏覽吧!


請您繼續閱讀更多來自 數據和雲 的精彩文章:

恩墨學子閆語的奮鬥歷程
空與非空 EMPTY_LOB和NULL的區別

TAG:數據和雲 |

您可能感興趣

Oracle 資料庫中enq:TX-index contention等待時間淺析
等待即將結束!John Elliott x Nike LeBron Icon 發售日期確定
你願意為了S Pen等待三星Galaxy Note9 嗎?
Wanna One,「請等待我們的回歸」(Pleasia)
等待已久,短評Fate/stay night hf第一部
經過多年等待,WPS for Mac終於登陸Mac App Store
換了剪輯師的the unit,等待下一個Wanna One
等待發售!BAPE x Neighborhood x adidas POD-S3.1官方細節欣賞!
等待即將結束!John Elliott x Nike LeBron Icon 發售日期確定 | 每日鞋訊
結束等待,Pharrell x adidas SOLARHU 發售日期確定
法國建築設計師 Atelier Aveus 作品—《The wait》 等待月亮和家
Off-White x NIKE再次出擊,這次是等待很久的Air Force 1黑色!
Off-White? x NIKE再次出擊,這次是等待很久的Air Force 1黑色!
等待吳亦凡 diss track 的第 x 天
Adidas Crazy BYW X:我值得你等待
還要繼續苦苦等待!OFF-WHITE x Nike Blazer Mid發售爽約!
現在入iphone6s還是等待遙遙無期的iphone SE2?
數字貨幣銀行Founders Bank仍在等待MFSA的許可
等待已久!adidas x 菲董 「Solar」 系列及新鞋型即將登場!
「Red Velvet」「新聞」190121 RedVelvet「謝謝一直等待我們的Luvie們」