Oracle RAC interconnect Traffic 监控

Oracle在AWR中提供了Estd Interconnect traffic(KB)指标,由于AWR默认只能查看小时级别的数据,做准实时监控需要以更小的时间粒度来计算这个指标。
AWR怎么算的看不到,我们可以查看statspack计算这一指标的方法,在sprepins.sql中可以发现Statspack的计算公式:

Estd Interconnect traffic = ((Global Cache blocks received + Global Cache blocks served)*db_block_size +(GCS/GES messages received + GCS/GES messages sent)*200)/elapsed time

在Oracle statistics中,Global Cache Blocks received等的名字转换参见如下SQL:

SELECT
DECODE(name,'gc cr blocks received','global cache blocks received','gc cr blocks served','global cache blocks served','gc current blocks received','global cache blocks received','gc current blocks served','global cache blocks served',name) AS name,
SUM(VALUE) AS VALUE,
TO_CHAR(SYSDATE,'yyyy-mm-dd hh24:mi:ss') AS date_taken
FROM gv$sysstat
WHERE inst_id=1
AND name IN ('gc cr blocks received','gc cr blocks served','gc current blocks received','gc current blocks served','gcs messages sent','ges messages sent')
GROUP BY DECODE(name,'gc cr blocks received','global cache blocks received','gc cr blocks served','global cache blocks served','gc current blocks received','global cache blocks received','gc current blocks served','global cache blocks served',name)
UNION
SELECT name,VALUE,TO_CHAR(SYSDATE,'yyyy-mm-dd hh24:mi:ss') AS date_taken
FROM gv$dlm_misc
WHERE name IN ('gcs msgs received','ges msgs received')
AND inst_id=1;

Leave Comment