二、 SGA各部分命中率介绍
1、数据缓存区命中率
select value from v$sysstat where name='physical reads'
select value from v$sysstat where name='physical reads direct'
select value from v$sysstat where name='physical reads direct (lob)'
select value from v$sysstat where name='consistent gets'
select value from v$sysstat where name='db block gets'
X= physical reads direct+ physical reads direct (lob)
命中率=100-(physical reads-x)/(consistent gets+ db block gets-x)*100
通常发现命中率低于90%,则应该考虑增大数据缓冲区。
select (100 - (n1.value - n2.value - n3.value) /
(n4.value + n5.value - n2.value - n3.value) * 100) as per
from (select value from v$sysstat where name = 'physical reads') n1,
(select value from v$sysstat where name = 'physical reads direct') n2,
(select value
from v$sysstat
where name = 'physical reads direct (lob)') n3,
(select value from v$sysstat where name = 'consistent gets') n4,
(select value from v$sysstat where name = 'db block gets') n5
2、共享池命中率
select sum(pinhits)/sum(pins)*100 "hit radio" from V$librarycache
通常共享池命中率低于95%,考虑增加共享池内存
3、排序
select name,value from V$sysstat where name like '%sort%'
文章来源于领测软件测试网 https://www.ltesting.net/