小编给大家分享一下Oracle如何调优相关的命中率、使用率,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!http://www.ecdoer.com/post/oracle-radio.html
计算公式:Library Cache Hit Ratio = sum(pinhits) / sum(pins)SELECT SUM(pinhits) / sum(pins) FROM V$LIBRARYCACHE;通常在98%以上,否则,需要要考虑加大共享池,绑定变量,修改cursor_sharing等参数。SELECT (1 – ROUND(BYTES / (&TSP_IN_M * 1024 * 1024), 2)) * 100 || ‘%’FROM V$SGASTATWHERE NAME = ‘free memory’AND POOL = ‘shared pool’;其中: &TSP_IN_M是你的总的共享池的SIZE(M)共享池内存使用率,应该稳定在75%-90%间,太小浪费内存,太大则内存不足。查询空闲的共享池内存:SELECT * FROM V$SGASTATWHERE NAME = ‘free memory’AND POOL = ‘shared pool’;计算公式:Hit ratio = 1 – [physical re免费主机域名ads/(block gets + consistent gets)]SELECT NAME,PHYSICAL_READS,DB_BLOCK_GETS,CONSISTENT_GETS,1 – (PHYSICAL_READS / (DB_BLOCK_GETS + CONSISTENT_GETS)) “Hit Ratio”FROM V$BUFFER_POOL_STATISTICSWHERE NAME = ‘DEFAULT’;通常应在90%以上,否则,需要调整,加大DB_CACHE_SIZE。另外一种计算命中率的方法:命中率的计算公式为:Hit Ratio = 1 – ((physical reads – physical reads direct – physical
reads direct (lob)) / (db block gets+ consistent gets – physical reads
direct – physical reads direct (lob))分别代入上一查询中的结果值,就得出了Buffer cache的命中率SELECT NAME, VALUEFROM V$SYSSTATWHERE NAME IN (‘session logical rea免费主机域名ds’,‘physical reads’,‘physical reads direct’,‘physical reads direct (lob)’,‘db block gets’,‘consistent gets’);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 sum(pinhits – reloads) / sum(pins) * 100 “hit radio” from v$librarycache;假如共享池的命中率低于95%,就要考虑调整应用(通常是没使用bind var )或者增加内存计算CPU消耗首先要借助Linux的TOP命令寻找CPU使用量高的session,找到高占用的PID。然后借助v$process的addr字段跟v$session的paddr找到sql_id、hash_value,然后结合v$sqltext然后找相应的SQL语句,找到之后分析执行计划,进行相应调优。看完了这篇文章,相信你对“Oracle如何调优相关的命中率、使用率”有了一定的了解,如果想了解更多相关知识,欢迎关注云技术行业资讯频道,感谢各位的阅读!
本篇内容主要讲解“数据库中TO_CHAR格式转换的方法是什么”,感兴趣的朋友不免费主机域名妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“数据库中TO_CHAR格式转换的方法是什么”吧!我的经理叫我写一个函数,这个函数接受一个正整数并…