This topic describes the monitoring metrics related to the cache hit rates within an OceanBase Database tenant. You can specify a statistical range to query statistics about the cache hit rates in a single zone or on a single OBServer of an OceanBase Database tenant.
block_cache
Definition
The block cache hit rate in the specified statistical range.
Description
| Metric | Metric name | Unit |
|---|---|---|
| block_cache | block_cache_hit_ratio | % |
Calculation expression
100 * 1 / (1 + sum(rate(ob_sysstat{stat_id="50009",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="50008",@LABELS}[@INTERVAL])) by (@GBLABELS))
SQL statements for metric collection
If you use OceanBase Database of a version earlier than V4.0, execute the following statement:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (50008, 50009) and (con_id > 1000 or con_id = 1) and class < 1000If you use OceanBase Database V4.0 or later, execute the following statement:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (50008, 50009) and (con_id > 1000 or con_id = 1) and class < 1000
row_cache
Definition
The row cache hit rate in the specified statistical range.
Description
| Metric | Metric name | Unit |
|---|---|---|
| row_cache | row_cache_hit_ratio | % |
Calculation expression
100 * 1 / (1 + sum(rate(ob_sysstat{stat_id="50001",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="50000",@LABELS}[@INTERVAL])) by (@GBLABELS))
SQL statements for metric collection
If you use OceanBase Database of a version earlier than V4.0, execute the following statement:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (50000, 50001) and (con_id > 1000 or con_id = 1) and class < 1000If you use OceanBase Database V4.0 or later, execute the following statement:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (50000, 50001) and (con_id > 1000 or con_id = 1) and class < 1000
plan_cache
Definition
The plan cache hit rate in the specified statistical range.
Description
| Metric | Metric name | Unit |
|---|---|---|
| plan_cache | plan_cache_hit_ratio | % |
Calculation expression
100 * sum(rate(ob_plan_cache_hit_total{@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_plan_cache_access_total{@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL statements for metric collection
If you use OceanBase Database of a version earlier than V4.0, execute the following statement:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ tenant_id, mem_used, access_count, hit_count from v$plan_cache_statIf you use OceanBase Database V4.0 or later, execute the following statement:
select /* MONITOR_AGENT */ tenant_id, mem_used, access_count, hit_count from V$OB_PLAN_CACHE_STAT
clog_cache
Definition
The clog cache hit rate in the specified statistical range.
Description
| Metric | Metric name | Unit |
|---|---|---|
| clog_cache | clog_cache_hit_ratio | % |
Calculation expression
100 * 1 / (1 + sum(rate(ob_sysstat{stat_id="50038",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="50037",@LABELS}[@INTERVAL])) by (@GBLABELS))
SQL statements for metric collection
If you use OceanBase Database of a version earlier than V4.0, execute the following statement:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (50037, 50038) and (con_id > 1000 or con_id = 1) and class < 1000If you use OceanBase Database V4.0 or later, execute the following statement:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (50037, 50038) and (con_id > 1000 or con_id = 1) and class < 1000
bloomfilter_cache
Definition
The Bloom filter cache hit rate in the specified statistical range.
Description
| Metric | Metric name | Unit |
|---|---|---|
| bloomfilter_cache | bloom_filter_cache_hit_ratio | % |
Calculation expression
100 * 1 / (1 + sum(rate(ob_sysstat{stat_id="50005",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="50004",@LABELS}[@INTERVAL])) by (@GBLABELS))
SQL statements for metric collection
If you use OceanBase Database of a version earlier than V4.0, execute the following statement:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (50004, 50005) and (con_id > 1000 or con_id = 1) and class < 1000If you use OceanBase Database V4.0 or later, execute the following statement:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (50004, 50005) and (con_id > 1000 or con_id = 1) and class < 1000
location_cache
Definition
The location cache hit rate in the specified statistical range.
Description
| Metric | Metric name | Unit |
|---|---|---|
| location_cache | location_cache_hit_ratio | % |
Calculation expression
100 * 1 / (1 + sum(rate(ob_sysstat{stat_id="50011",@LABELS}[@INTERVAL])) by (@GBLABELS) / sum(rate(ob_sysstat{stat_id="50010",@LABELS}[@INTERVAL])) by (@GBLABELS))
SQL statements for metric collection
If you use OceanBase Database of a version earlier than V4.0, execute the following statement:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (50010, 50011) and (con_id > 1000 or con_id = 1) and class < 1000If you use OceanBase Database V4.0 or later, execute the following statement:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (50010, 50011) and (con_id > 1000 or con_id = 1) and class < 1000