一篇share pool結構佳文
看了Tanel Poder一篇關於shared pool文章,將其歸納如下:
1、oracle9i 的shared pool引入了sub-pool概念,10.2進一步將sub pool分成4個
sub-sub-pool。具體檢視:
SQL>select count(kghluidx) num_pools
from x$kghlu
where kghlushrpool=1
說明:
kghlushrpool:
=1: shared pool subpools
=0: java pool
sub-sub-pool查詢:
SQL>select kghluidx, kghludur from x$kghlu
where kghlushrpool=1
KGHLUIDX KGHLUDUR
--------------------- -----------------
2 3
2 2
2 1
2 0
1 3
1 2
1 1
1 0
oracle根據shared pool大小和CPU_COUNT來計算需要分成幾個sub pool,例如 oracle9i,shared pool size 大於256MB, cpu_count=4,則分成2個sub pool, 10g中shared pool size 大於512MB,11g應該是1G。
2、可以通過_kghdsidx_count控制sub pool數量
SQL>select n.ksppinm, c.ksppstvl, n.ksppdesc
from x$ksppi n, x$ksppcv c
where n.indx = c.indx
and lower(n.ksppinm) like lower ('%kghdsidx%');
1、oracle9i 的shared pool引入了sub-pool概念,10.2進一步將sub pool分成4個
sub-sub-pool。具體檢視:
SQL>select count(kghluidx) num_pools
from x$kghlu
where kghlushrpool=1
說明:
kghlushrpool:
=1: shared pool subpools
=0: java pool
sub-sub-pool查詢:
SQL>select kghluidx, kghludur from x$kghlu
where kghlushrpool=1
KGHLUIDX KGHLUDUR
--------------------- -----------------
2 3
2 2
2 1
2 0
1 3
1 2
1 1
1 0
oracle根據shared pool大小和CPU_COUNT來計算需要分成幾個sub pool,例如 oracle9i,shared pool size 大於256MB, cpu_count=4,則分成2個sub pool, 10g中shared pool size 大於512MB,11g應該是1G。
2、可以通過_kghdsidx_count控制sub pool數量
SQL>select n.ksppinm, c.ksppstvl, n.ksppdesc
from x$ksppi n, x$ksppcv c
where n.indx = c.indx
and lower(n.ksppinm) like lower ('%kghdsidx%');
NAME VALUE DESCRIPTION5、如何獲得各個sub pool中空間資訊,ksmdsidx中,0表示內部使用記憶體,1表示sub pool #1
-------------- ----------- ------------------------
_kghdsidx_count 2 max kghdsidx count
3、每個sub pool由一個share pool latch控制,3~7表示未使用。
SQL>select child#, gets
from v$latch_children
where name = 'shared pool'
order by child#;
CHILD# GETS
---------- ----------
1 29906417
2 24955057
3 2905
4 2905
5 2905
6 2905
7 2905
4、ORA-04031錯誤
ORA-04031: "unable to allocate n bytes of shared memory
("shared pool", "object_name", "alloc type(2,0)" ...)
type(2,0)表示sub pool# =2, sub sub pool=0
該錯誤通常造成原因:
a)、shared pool空間太小
b)、空閒空間碎片太多
c)、在不同的sub pool中記憶體使用/空閒空間使用不平衡
SQL>select ksmdsidx sub_pool, sum(ksmsslen) bytes
from x$ksmss
where ksmsslen>0
group by ksmdsidx
order by sub_pool;
SUB_POOL BYTES
---------- ----------
0 16777216
1 236552072
2 238228464
也可以通過該檢視檢視subpool下具體各個部分分配情況。
另外參看metalink396940.1: Troubleshooting and Diagnosing ORA-4031 Error
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/354732/viewspace-606428/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- shared pool記憶體結構記憶體
- shared pool的物理結構和邏輯結構
- SHARED POOL總結
- Share Pool理解
- Oracle記憶體結構(二)----Shared Pool的詳細資訊Oracle記憶體
- dbms_shared_pool keep物件到share pool中物件
- shared pool之三:library cache結構/library cache object的結構-dump LibraryHandleObject
- 【Shared Pool】使用DBMS_SHARED_POOL包將PL/SQL大物件儲存到Shared PoolSQL物件
- Oracle記憶體結構(二)----Shared Pool的詳細資訊(轉)Oracle記憶體
- Oracle shared poolOracle
- _shared_pool_reserved_pct or shared_pool_reserved_size with ASMMASM
- zt_Oracle shared pool internals_共享池_shared_poolOracle
- SHARED_POOL解析
- 理解Oracle Shared PoolOracle
- 資料庫體系結構-共享池(shared pool),largepool,Java池,流池資料庫Java
- Oracle Shared Pool Memory ManagementOracle
- ORACLE SGA之shared poolOracle
- 使用DBMS_SHARED_POOL包將PL/SQL大物件儲存到Shared PoolSQL物件
- SHARED POOL 基礎知識
- 簡單分析shared pool(一)
- 簡單分析shared pool(二)
- 簡單分析shared pool(三)
- shared_pool_spare_free.sqlSQL
- ORACLE記憶體管理 之五 SGA variable pool,shared_pool,large_pool,java_poolOracle記憶體Java
- latch:shared pool的一點理解
- Shared Pool 的基本原理
- Shared Pool 的轉儲與分析
- 安裝DBMS_SHARED_POOL包
- oracle優化--shared_pool (3)Oracle優化
- oracle優化--shared_pool (2)Oracle優化
- oracle優化--shared_pool (1)Oracle優化
- PL/SQL Program Units and the Shared Pool (89)SQL
- JVM常量池Constant pool結構速查JVM
- 基於引數shared_pool_reserved_size進一步理解共享池shared pool原理
- Oracle記憶體分配與使用小記(二)Shared Pool and Large PoolOracle記憶體
- shared_pool的sql命中率SQL
- SHARED POOL 空閒空間分配流程
- 轉_診斷latch:shared pool等待事件事件