[20220412]shared pool latch與使用sga heap的疑問2.txt
[20220412]shared pool latch與使用sga heap的疑問2.txt
--//接著前面的測試,驗證註解為KGLHD,KGLDA的情況.
--//首先註解為KGLHD,KGLDA,一定分配在特定sga heap(N,0) 與sga heap(N+,0)之間,前面的測試已經驗證.
--//先驗證KGLHD的情況.
--//首先如果過濾包含KGLHD行,就可以知道chunk的開始地址.開始地址+48(0x30),就是對應父/子游標控制程式碼的地址(注:至少對於11g是這樣
--//的情況).
SYS@127.0.0.1:9014/ywdb> select KSMCHIDX,count(*) from xx2 where KSMCHCOM='KGLHD' group by cube(KSMCHIDX) order by 1;
KSMCHIDX COUNT(*)
---------- ----------
1 28897
2 31911
3 20928
4 28428
5 29036
6 31497
7 26083
196780
8 rows selected.
with t_xx2 as
( select KSMCHIDX,hextoraw(to_char((to_number(rawtohex(ksmchptr),'xxxxxxxxxxxxxxxx')+48), 'FM0xxxxxxxxxxxxxxx')) ksmchptr2 from xx2 where KSMCHCOM='KGLHD')
SELECT CASE WHEN (KGLHDNSD='SQL AREA STATS' and KGLOBTYD='CURSOR STATS' ) then
mod(mod(TO_NUMBER(substr(kglnaobj,-8),'xxxxxxxxxxxxxxxx'),131072),7)+1
else
mod(mod(kglnahsh, 131072),7)+1
end N10,t_xx2.KSMCHIDX
from xx1,t_xx2
where
(CASE WHEN (KGLHDNSD='SQL AREA STATS' and KGLOBTYD='CURSOR STATS' ) then
mod(mod(TO_NUMBER(substr(kglnaobj,-8),'xxxxxxxxxxxxxxxx'),131072),7)+1
else
mod(mod(kglnahsh, 131072),7)+1
end) = t_xx2.KSMCHIDX and t_xx2.ksmchptr2=xx1.KGLHDADR;
--//輸出太長,結果不貼出了。共計194,313條。
with t_xx2 as
( select KSMCHIDX,hextoraw(to_char((to_number(rawtohex(ksmchptr),'xxxxxxxxxxxxxxxx')+48), 'FM0xxxxxxxxxxxxxxx')) ksmchptr2 from xx2 where KSMCHCOM='KGLHD')
SELECT CASE WHEN (KGLHDNSD='SQL AREA STATS' and KGLOBTYD='CURSOR STATS' ) then
mod(mod(TO_NUMBER(substr(kglnaobj,-8),'xxxxxxxxxxxxxxxx'),131072),7)+1
else
mod(mod(kglnahsh, 131072),7)+1
end N10,t_xx2.KSMCHIDX,xx1.KGLHDADR,xx1.KGLNAOBJ
from xx1,t_xx2
where
(CASE WHEN (KGLHDNSD='SQL AREA STATS' and KGLOBTYD='CURSOR STATS' ) then
mod(mod(TO_NUMBER(substr(kglnaobj,-8),'xxxxxxxxxxxxxxxx'),131072),7)+1
else
mod(mod(kglnahsh, 131072),7)+1
end) <> t_xx2.KSMCHIDX and t_xx2.ksmchptr2=xx1.KGLHDADR;
no rows selected
--//都是符合的記錄。
select KSMCHIDX,count(*) from
(with t_xx2 as
( select KSMCHIDX,hextoraw(to_char((to_number(rawtohex(ksmchptr),'xxxxxxxxxxxxxxxx')+48), 'FM0xxxxxxxxxxxxxxx')) ksmchptr2 from xx2 where KSMCHCOM='KGLHD')
SELECT CASE WHEN (KGLHDNSD='SQL AREA STATS' and KGLOBTYD='CURSOR STATS' ) then
mod(mod(TO_NUMBER(substr(kglnaobj,-8),'xxxxxxxxxxxxxxxx'),131072),7)+1
else
mod(mod(kglnahsh, 131072),7)+1
end N10,t_xx2.KSMCHIDX
from xx1,t_xx2
where
(CASE WHEN (KGLHDNSD='SQL AREA STATS' and KGLOBTYD='CURSOR STATS' ) then
mod(mod(TO_NUMBER(substr(kglnaobj,-8),'xxxxxxxxxxxxxxxx'),131072),7)+1
else
mod(mod(kglnahsh, 131072),7)+1
end) = t_xx2.KSMCHIDX and t_xx2.ksmchptr2=xx1.KGLHDADR)
group by cube(KSMCHIDX) order by 1 ;
KSMCHIDX COUNT(*)
---------- ----------
1 28711
2 31659
3 20352
4 28042
5 28709
6 31286
7 25554
194313
8 rows selected.
--//僅僅存在少量的記錄在表xx1不存在。
select * from xx2 where KSMCHIDX=1 and not exists (select 1 from xx1 where xx1.KGLHDADR = hextoraw(to_char((to_number(rawtohex(xx2.ksmchptr),'xxxxxxxxxxxxxxxx')+48), 'FM0xxxxxxxxxxxxxxx')))
and KSMCHCOM='KGLHD';
--//共計186條。28897-28711 = 186
select ksmchidx,count(*) from xx2 where not exists (select 1 from xx1 where xx1.KGLHDADR = hextoraw(to_char((to_number(rawtohex(xx2.ksmchptr),'xxxxxxxxxxxxxxxx')+48), 'FM0xxxxxxxxxxxxxxx')))
and KSMCHCOM='KGLHD'
group by cube(ksmchidx)
order by 1;
KSMCHIDX COUNT(*)
---------- ----------
1 186
2 252
3 576
4 386
5 327
6 211
7 529
2467
8 rows selected.
--//196780 - 194313 = 2467.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2887685/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20220413]shared pool latch與使用sga heap的疑問3.txt
- [20220406]使用那個shared pool latch的疑問1.txt
- [20210512]shared pool latch與library cache latch的簡單探究.txt
- [20190319]shared pool latch與library cache latch的簡單探究.txt
- [20210708]使用那個shared pool latch.txt
- [20210803]使用那個shared pool latch(補充).txt
- [20200212]使用DBMS_SHARED_POOL.MARKHOT與sql的計算2.txtSQL
- [20190419]shared latch spin count 2.txt
- [20200211]使用DBMS_SHARED_POOL.MARKHOT與sql語句2.txtSQL
- [20210520]11g shared pool latch與library cache mutex的簡單探究.txtMutex
- [20190416]完善shared latch測試指令碼2.txt指令碼
- [20200213]使用DBMS_SHARED_POOL.MARKHOT標識熱物件2.txt物件
- [20210521]11g shared pool latch與library cache mutex的簡單探究4.txtMutex
- [20210520]11g shared pool latch與library cache mutex的簡單探究3.txtMutex
- 透過案例學調優之--和 SHARED POOL 相關的主要 Latch
- [20200126]使用DBMS_SHARED_POOL.MARKHOT與sql語句.txtSQL
- 共享池 shared pool
- [20191209]降序索引疑問2.txt索引
- [20190102]DBMS_SHARED_POOL.MARKHOT與表.txt
- [20200211]使用DBMS_SHARED_POOL.MARKHOT與sql_id的計算.txtSQL
- [20200213]使用DBMS_SHARED_POOL.MARKHOT的總結.txt
- Oracle Shared Pool Memory ManagementOracle
- [20200212]使用DBMS_SHARED_POOL.MARKHOT與sql語句3.txtSQL
- [20201117]使用DBMS_SHARED_POOL.MARKHOT與sql語句5.txtSQL
- [20201117]使用DBMS_SHARED_POOL.MARKHOT與sql語句6.txtSQL
- [20200212]使用DBMS_SHARED_POOL.MARKHOT與檢視v$open_cursor.txt
- [20190419]shared latch spin count.txt
- [20190416]檢視shared latch gets的變化.txt
- [20210218]shared latch spin count 6.txt
- [20210218]shared latch spin count 5.txt
- SHARED POOL中KGH: NOACCESS佔用大量記憶體的問題分析記憶體
- [20200212]使用DBMS_SHARED_POOL.MARKHOT標識熱物件.txt物件
- 使用DBMS_SHARED_POOL包將物件固定到共享池物件
- [20230308]versions偽列versions_starttime疑問2.txt
- locust 使用的疑問
- [20210413]CBC latch再討論2.txt
- [20210208][20200426]檢視shared latch gets的變化.txt
- [20190415]關於shared latch(共享栓鎖).txt