如何计算oracle的数据缓冲区命中率与共享池的命中率

1、数据缓冲区命中率:
SQL> select value from v$sysstat where name ='physical reads';
SQL> select value from v$sysstat where name ='physical reads direct';
SQL> select value from v$sysstat where name ='physical reads direct (lob)';
SQL> select value from v$sysstat where name ='consistent gets';
SQL> 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%,则应该调整应用可可以考虑是否增大数据缓冲区
2、共享池的命中率:
SQL> select sum(pinhits-reloads)/sum(pins)*100 "hit radio" from v$librarycache;
假如共享池的命中率低于95%,就要考虑调整应用(通常是没使用bind var )或者增加内存
原文地址:https://www.cnblogs.com/tester2test/p/576531.html