深入理解shared pool共享池之library cache系列二
背景
繼續上文:深入理解shared pool共享池之library cache系列一,http://blog.itpub.net/9240380/viewspace-1844964/,學習library cache資料結構,本文主要學習library cache object(lco)的資料結構:data blocks為了直觀理解,先放一張網上關於DATA BLOCK中儲存不同HEAP的結構圖:
結論
1,data block是儲存不同HEAP的一個結構,每個HEAP儲存的內容不同2,分析heap請最終檢視ANONYMOUS LIST:對應的library object handle中的data blocks包括的heap
3,data blocks的結構:
DATA BLOCKS:
data# heap pointer status pins change whr alloc(K) size(K)
----- -------- -------- --------- ---- ------ --- -------- --------
0 a353a238 9d9b7788 I/P/A/-/- 0 NONE 00 2.99 3.12 --heap 0
6 9d9b7ba8 9bb1f118 I/-/A/-/E 0 NONE 00 5.06 7.90 --heap 6
4,dump特定的data blocks 中對應的heap,其命令:
oradebug setmypid
oradebug dump heapdump_addr 2 0xa353a238 ---0x後面對應上述data blocks中對應的heap addr
oradebug tracefile_name
5,上述data blocks不同heap可以在v$sgastat中進行對應起來
測試
---基於應用測試示例,便於直觀理解
SQL> show user
USER is "SCOTT"
SQL> create table t_data_block(a int);
Table created.
SQL> select * from t_data_block;
no rows selected
--dump LIBRARY CACHE,僅列出關注部分的內容
BUCKET 36417:
LIBRARY OBJECT HANDLE: handle=a353a480 mtx=0xa353a5b0(1) lct=1 pct=1 cdp=1
name=select * from t_data_block
hash=36f9d01e6a12a3ab7b92ad2ca24a8e41 timestamp=11-23-2015 19:12:41
namespace=CRSR flags=RON/KGHP/TIM/PN0/SML/KST/DBN/MTX/[120100d0]
kkkk-dddd-llll=0000-0001-0001 lock=N pin=0 latch#=4 hpc=0002 hlc=0002
lwt=0xa353a528[0xa353a528,0xa353a528] ltm=0xa353a538[0xa353a538,0xa353a538]
pwt=0xa353a4f0[0xa353a4f0,0xa353a4f0] ptm=0xa353a500[0xa353a500,0xa353a500]
ref=0xa353a558[0xa353a558,0xa353a558] lnd=0xa353a570[0xa353a570,0xa353a570]
LOCK OWNERS:
lock user session count mode flags
-------- -------- -------- ----- ---- ------------------------
9eb51a40 a4726cc0 a4726cc0 1 N [00]
LIBRARY OBJECT: object=9d9b9c28
type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
CHILDREN: size=16
child# table reference handle
------ -------- --------- --------
0 9d9b9b28 9d9b7dd8 a353a2f8 --通過child handle定位到下面的anonymous list中對應的library object handle
DATA BLOCKS:
data# heap pointer status pins change whr alloc(K) size(K)
----- -------- -------- --------- ---- ------ --- -------- --------
0 a35a4038 9d9b9d40 I/P/A/-/- 0 NONE 00 1.59 2.17
BUCKET 36417 total object count=1
ANONYMOUS LIST:
LIBRARY OBJECT HANDLE: handle=a353a2f8 mtx=0xa353a428(0) lct=1 pct=2 cdp=0
namespace=CRSR flags=RON/KGHP/PN0/EXP/[10010100]
kkkk-dddd-llll=0000-0001-0001 lock=N pin=0 latch#=4 hpc=0002 hlc=0002
lwt=0xa353a3a0[0xa353a3a0,0xa353a3a0] ltm=0xa353a3b0[0xa353a3b0,0xa353a3b0]
pwt=0xa353a368[0xa353a368,0xa353a368] ptm=0xa353a378[0xa353a378,0xa353a378]
ref=0xa353a3d0[0x9d9b7dd8,0x9d9b7dd8] lnd=0xa353a3e8[0xa353a3e8,0xa353a3e8]
CHILD REFERENCES:
reference latch flags
--------- ----- -------------------
9d9b7dd8 7 CHL[02]
LOCK OWNERS:
lock user session count mode flags
-------- -------- -------- ----- ---- ------------------------
9eb1fa90 a4726cc0 a4726cc0 1 N [00]
LIBRARY OBJECT: object=9d9b7670
type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
DEPENDENCIES: count=2 size=16
dependency# table reference handle position flags
----------- -------- --------- -------- -------- -------------------
0 9d9b7138 9d9b6e78 a353b358 14 DEP[01]
1 9d9b7138 9d9b6f78 a3539f18 0 DEP[01]
ACCESSES: count=1 size=16
dependency# types
----------- -----
0 0009
TRANSLATIONS: count=1 size=16
original final
-------- --------
a353b358 a353b358
DATA BLOCKS:
data# heap pointer status pins change whr alloc(K) size(K)
----- -------- -------- --------- ---- ------ --- -------- --------
0 a353a238 9d9b7788 I/P/A/-/- 0 NONE 00 2.99 3.12 --heap 0
6 9d9b7ba8 9bb1f118 I/-/A/-/E 0 NONE 00 5.06 7.90 --heap 6
--dump heap 0
SQL> oradebug setmypid
Statement processed.
SQL> oradebug dump heapdump_addr 2 0xa353a238
Statement processed.
SQL> oradebug tracefile_name
/home/ora10g/admin/ora10g/udump/ora10g_ora_22177.trc
--trc檔案內容,可見HEAP 0對應的堆名為ccursor,儲存SQL執行計劃之類我感覺
HEAP DUMP heap name="CCursor" desc=0xa353a238
SQL> select pool,name,bytes from v$sgastat where lower(name) like '%ccursor%';
POOL NAME BYTES
------------ -------------------------- ----------
shared pool CCursor 3062792
--dump heap 6
可見heap 6為儲存SQL文字
HEAP DUMP heap name="sql area" desc=0x9d9b7ba8
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-1845592/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 深入理解shared pool共享池之library cache系列一
- 深入理解shared pool共享池之library cache的library cache lock系列四
- 深入理解shared pool共享池之library cache的library cache pin系列三
- 深入理解shared pool共享池空間及library cache分配之ora-4031 系列一
- 共享池之六:shared pool latch/ library cache latch /lock pin 簡介
- zt_Oracle shared pool internals_共享池_shared_poolOracle
- 等待模擬-library cache shared pool 硬解析
- 基於引數shared_pool_reserved_size進一步理解共享池shared pool原理
- Shared pool的library cache lock/pin及硬解析
- 優化Shared Pool Latch與Library Cache Latch競爭優化
- shared pool library cache latch 競爭優化辦法優化
- shared pool之三:library cache結構/library cache object的結構-dump LibraryHandleObject
- 共享池之五:Shared Pool子池與結果集快取技術快取
- zt_eygle大師_shared pool共享池管理機制系列文章
- Flush an Object Out The Library Cache [SGA] Using The DBMS_SHARED_POOLObject
- Shared Pool優化和Library Cache Latch衝突優化優化
- 深入淺出buffer cache和shared pool記載01
- 深入淺出cache buffer和shared pool記載02
- 深入淺出buffer cache和shared pool記載03
- 資料庫體系結構-共享池(shared pool),largepool,Java池,流池資料庫Java
- oracle調優之-共享池尺寸調優+library cache+dicitonary library 命中率Oracle
- 使用DBMS_SHARED_POOL包將物件固定到共享池物件
- 共享池的調整與優化(Shared pool Tuning)優化
- 故障排除:Shared Pool優化和Library Cache Latch衝突優化優化
- 理解Oracle Shared PoolOracle
- 【每日一摩斯】-Shared Pool優化和Library Cache Latch衝突優化 (1523934.1)-系列6優化
- 【每日一摩斯】-Shared Pool優化和Library Cache Latch衝突優化 (1523934.1)-系列5優化
- 【每日一摩斯】-Shared Pool優化和Library Cache Latch衝突優化 (1523934.1)-系列4優化
- 【每日一摩斯】-Shared Pool優化和Library Cache Latch衝突優化 (1523934.1)-系列3優化
- 【每日一摩斯】-Shared Pool優化和Library Cache Latch衝突優化 (1523934.1)-系列2優化
- 【每日一摩斯】-Shared Pool優化和Library Cache Latch衝突優化 (1523934.1)-系列1優化
- 如何基於共享伺服器模式shared server mode配置大池large pool之二伺服器模式Server
- 深入理解Java併發框架AQS系列(四):共享鎖(Shared Lock)Java框架AQS
- Shared pool深入分析及效能調整(二)
- library cache lock和library cache pin理解
- 《深入解析Oracle》第六章,Buffer Cache與Shared Pool原理Oracle
- 【ASK_ORACLE】Library Cache概念篇(二)之Library Cache Pin的定義Oracle
- oracle10g_oracle11g_library cache_shared pool管理方面的小區別Oracle