1,测试环境是oracle 10.2.0.5
2,_kghdsidx_count=1,即共享池子池个数是1个
3,硬解析需要获取shared pool latch
4,软解析需要获取shared pool latch
5,软软解析不需要获取shared pool latch
6,上次各类解析皆要获取library cache latch
7,上述各类解析要获取的shared pool latch是child#=1,即第1个子latch
却不会去获取其它6个可用的子latch
8,增大共享池子池到5个
即参数 _kghdsidx_count=5
8.1,仅硬解析需要获取shared pool latch
8.2,软解析及软软解析不再需要获取shared pool latch
8.3,如果共享池子池配置为1个,软解析也要获取shared pool latch
而增加共享池子池为5个,软解析不需要再获取shared pool latch了,这就是增加子池的优点
测试
---oracle version
SQL> select * from v$version where rownum=1;
PROCESS 33:
----------------------------------------
SO: 0xa42dc1b0, type: 2, owner: (nil), flag: INIT/-/-/0x00
(process) Oracle pid=33, calls cur/top: 0xa43e82d0/0xa43e82d0, flag: (0) -
int error: 0, call error: 0, sess error: 0, txn error 0
(post info) last post received: 0 0 0
last post received-location: No post
last process to post me: none
last post sent: 0 0 0
last post sent-location: No post
last process posted by me: none
(latch info) wait_event=0 bits=20
Location from where call was made: kghupr1: Chunk Header
Context saved from call: 2678808096
waiting for 600e7af0 Child shared pool level=7 child#=1 ---等待shared pool latch
Location from where latch is held: kghupr1: Chunk Header
Context saved from call: 2658951960
state=busy, wlstate=free
waiters [orapid (seconds since: put on list, posted, alive check)]:
10 (328, 1447926130, 328)
11 (325, 1447926130, 325)
34 (258, 1447926130, 258)
8 (177, 1447926130, 177)
33 (153, 1447926130, 147)
9 (144, 1447926130, 144)
waiter count=6
gotten 70198 times wait, failed first 0 sleeps 0
gotten 0 times nowait, failed: 0
on wait list for 600e7af0
holding (efd=3) a14ee0b0 Child library cache level=5 child#=1 --同时持有library cache latch
Location from where latch is held: kgllkdl: child: no lock handle: latch
Context saved from call: 0
state=busy, wlstate=free
Process Group: DEFAULT, pseudo proc: 0xa42fe938
O/S info: user: ora10g, term: pts/5, ospid: 4154
OSD pid info: Unix process pid: 4154, image: oracle@seconary (TNS V1-V3)
(FOB) flags=2 fib=0xa27d54b0 incno=0 pending i/o cnt=0
fname=/home/ora10g/ora10g/system01.dbf
fno=1 lblksz=8192 fsiz=75520
而且同时发现smon,mmon后台进程也在等待shared pool latch,不再贴出相关TRC文件内容
查看TRC文件,可知软解析也会等待shared pool latch,且持有library cache latch
PROCESS 33:
----------------------------------------
SO: 0xa42dc1b0, type: 2, owner: (nil), flag: INIT/-/-/0x00
(process) Oracle pid=33, calls cur/top: 0xa43e82d0/0xa43e82d0, flag: (0) -
int error: 0, call error: 0, sess error: 0, txn error 0
(post info) last post received: 110 0 4
last post received-location: kslpsr
last process to post me: a42cea88 1 6
last post sent: 0 0 24
last post sent-location: ksasnd
last process posted by me: a42cea88 1 6
(latch info) wait_event=0 bits=20
Location from where call was made: kghupr1: Chunk Header
Context saved from call: 2675911648
waiting for 600e7af0 Child shared pool level=7 child#=1
Location from where latch is held: kghupr1: Chunk Header
Context saved from call: 2658951960
state=busy, wlstate=free
waiters [orapid (seconds since: put on list, posted, alive check)]:
10 (114, 1447927688, 114)
11 (99, 1447927688, 99)
33 (33, 1447927688, 33)
waiter count=3
gotten 111441 times wait, failed first 6 sleeps 7
gotten 0 times nowait, failed: 0
on wait list for 600e7af0
holding (efd=3) a14ee0b0 Child library cache level=5 child#=1
Location from where latch is held: kgllkdl: child: no lock handle: latch
Context saved from call: 0
state=busy, wlstate=free
Process Group: DEFAULT, pseudo proc: 0xa42fe938
O/S info: user: ora10g, term: pts/5, ospid: 4860
OSD pid info: Unix process pid: 4860, image: oracle@seconary (TNS V1-V3)
Total System Global Area 1157627904 bytes
Fixed Size 2095800 bytes
Variable Size 301991240 bytes
Database Buffers 822083584 bytes
Redo Buffers 31457280 bytes
Database mounted.
Database opened.
SQL> col name_1 for a50
SQL> col value_1 for a50
SQL> col desc1 for a50
SQL> set linesize 300
SQL> /
Enter value for parameter: _kghdsidx_count
old 6: where (x.indx = y.indx) and lower(x.ksppinm) like '%¶meter%'
new 6: where (x.indx = y.indx) and lower(x.ksppinm) like '%_kghdsidx_count%'