【发布时间】:2018-01-20 06:41:13
【问题描述】:
我想计算缓冲区缓存命中率并按实例分组。为此,我有以下公式;
1 - ( physical reads cache / (consistent gets from cache + db block gets from cache)
我需要计算如下公式的查询;
select inst_id,name,value
from gv$sysstat
where name in ('consistent gets from cache','db block gets from cache','physical reads cache')
我尝试使用 3 个子查询来实现它,但它没有用且无法正常工作。
此查询的示例输出如下所示;
1 db block gets from cache 3980038
1 consistent gets from cache 16692788
1 physical reads cache 174385
我想要的示例输出如下所示;
INST_ID VALUE
1 0.92
2 0.93
如何编写此查询以获得缓存命中率?
【问题讨论】:
-
您确实意识到 Buffer Cache Hit Ratio(缓冲区高速缓存命中率)即使不是真正不可信的指标,也基本上是无用的指标,不是吗? Find out more
-
@APC 不明白
-
阅读我链接到的文章。 BHCR 不会告诉您有关数据库状态的任何有意义的信息。
-
APC想说什么:看缓冲区缓存命中率没用。
-
@johntrue - 我正在给你最好的建议:你是否接受它取决于你。