This topic describes the monitoring metric number of transaction logs within an OceanBase Database tenant. The atomicity, consistency, isolation, and durability (ACID) of a transaction depend on transaction log tracking. Each operation is written to a log file before it is written to a database. After the transaction is committed, the SQL statements involved in the transaction are batch synchronized to the database files on a disk. After the logs in the log file are synchronized to the disk, the corresponding space is automatically released. You can specify a statistical period to query statistics about the number of transaction logs in a single zone or on a single OBServer of an OceanBase Database tenant.
Definition
The number of transaction logs committed per second within a tenant in the specified statistical period.
Description
| Metric | Metric field name | Unit |
|---|---|---|
| - | trans_commit_log_count | times/s |
Calculation expression
sum(rate(ob_sysstat{stat_id="30002",@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 (30002) 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 (30002) and (con_id > 1000 or con_id = 1) and class < 1000