This topic describes monitoring metrics related to SQL execution plan category of an OceanBase Database tenant. These metrics are used to monitor the number of SQL execution plans executed per second in the current statistical period. You can specify a statistical period to query statistics about the SQL execution plan category in a single zone or on a single OBServer of an OceanBase Database tenant.
sql_local_count
Definition
The number of local execution plans processed per second within the statistical period.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| sql_local_count | sql_local_count | times/s |
Calculation expression
sum(rate(ob_sysstat{stat_id="40010",@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 (40010) 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 (40010) and (con_id > 1000 or con_id = 1) and class < 1000
sql_remote_count
Definition
The number of remote execution plans processed per second within the statistical period.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| sql_remote_count | sql_remote_count | times/s |
Calculation expression
sum(rate(ob_sysstat{stat_id="40011",@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 (40011) 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 (40011) and (con_id > 1000 or con_id = 1) and class < 1000
sql_distributed_count
Definition
The number of distributed execution plans processed per second within the statistical period.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| sql_distributed_count | sql_distributed_count | times/s |
Calculation expression
sum(rate(ob_sysstat{stat_id="40012",@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 (40012) 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 (40012) and (con_id > 1000 or con_id = 1) and class < 1000