您好,登錄后才能下訂單哦!
這篇文章主要講解了“Oracle中read by other session等待事件分析”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“Oracle中read by other session等待事件分析”吧!
read by other session發(fā)生的場景:
當(dāng)查詢數(shù)據(jù)時(shí),Oracle要把block從硬盤讀到buffer cache中。如果有兩個(gè)或更多session同時(shí)讀取同一個(gè)block數(shù)據(jù),第一個(gè)session會(huì)將block讀取到buffer cache,由于block尚未完全讀取到buffer cache,就導(dǎo)致其他session處于"read by other session"等待下。這個(gè)是oracle 10g從oracle 9i的"buffer busy waits"中分離出來的,也是一種熱塊現(xiàn)象。
read by other session等待事件有三個(gè)參數(shù),屬于User I/O類的等待 :
SQL> select name,parameter1,parameter2,parameter3,wait_class from v$event_name where name = 'read by other session';
NAME PARAMETER1 PARAMETER2 PARAMETER3 WAIT_CLASS
------------------------------ -------------------- -------------------- -------------------- -----------
read by other session file# block# class# User I/O
file#:要讀取的數(shù)據(jù)塊鎖在數(shù)據(jù)文件的文件號(hào)
block#:要讀取的起始數(shù)據(jù)塊號(hào)
class#:塊類型
可根據(jù)等待的file#、block#結(jié)合下面的sql獲取熱點(diǎn)塊所在的segment:
SELECT OWNER, SEGMENT_NAME, SEGMENT_TYPE, TABLESPACE_NAME, A.PARTITION_NAME
FROM DBA_EXTENTS A
WHERE FILE_ID = &FILE_ID
AND &BLOCK_ID BETWEEN BLOCK_ID AND BLOCK_ID + BLOCKS – 1;
查詢熱點(diǎn)塊對(duì)象:
SELECT *
FROM
(
SELECT O.OWNER, O.OBJECT_NAME, O.OBJECT_TYPE, SUM(TCH) TOUCHTIME
FROM X$BH B, DBA_OBJECTS O
WHERE B.OBJ = O.DATA_OBJECT_ID
AND B.TS# > 0
GROUP BY O.OWNER, O.OBJECT_NAME, O.OBJECT_TYPE
ORDER BY SUM(TCH) DESC
)
WHERE ROWNUM <= 10
感謝各位的閱讀,以上就是“Oracle中read by other session等待事件分析”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對(duì)Oracle中read by other session等待事件分析這一問題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是億速云,小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。