Oracle数据库缓冲区命中率
1、查看Oracle数据库缓冲区命中率
select a.value + b.value "logical_reads", c.value "phys_reads",
round(100 * ((a.value+b.value)-c.value) / (a.value+b.value)) "BUFFER HIT RATIO"
from v$sysstat a, v$sysstat b, v$sysstat c
where a.statistic# = 40 and b.statistic# = 41
and c.statistic# = 42
2、Tags: oracle
数据库缓冲区命中率:
sql>select value from v$sysstat where name ='physical reads';
value
3714179
sql>select value from v$sysstat where name ='physical reads direct';
value
0
sql>select value from v$sysstat where name ='physical reads direct(lob)';
value
0
sql>select value from v$sysstat where name ='consistent gets';
value
856309623
sql>select value from v$sysstat where name ='db block gets';
value
19847790
这里命中率的计算应该是
令x=physical reads direct + physical reads direct(lob)
命中率=100-(physical reads -x)/(consistent gets +db block gets -x)*100
通常如果发现命中率低于90%,则应该调整应用可以考虑是否增大数据加
共享池的命中率
sql> select sum(pinhits)/sum(pins)*100 "hit radio" from v$librarycache;
如果共享池的命中率低于95%就要考虑调整应用(通常是没应用bind var)或者增加内存。
关于排序部分
sql> select name,value from v$sysstat where name like '%sort%';
如果我们发现sorts(disk)/(sorts(memory)+sorts(disk))的比例过高,则通常意味着sort_area_size部分内存教较小,可考虑调整相应的参数。
关于log_buffer
sql>select name,value from v$sysstat where name in ('redo entries','redo buffer allocation retries');
假如redo buffer allocation retries/redo entries的比例超过1%我们就可以考虑增加log_buffer.