This topic describes the performance metric XA Transactions of OceanBase Database tenants. The XA Transactions metric indicates the total number of XA transactions in OceanBase Database tenants. This metric is divided into three submetrics to count the number of XA transactions in a tenant: xa_trans_start_count, xa_read_only_trans_total_count, and xa_one_phase_commit_total_count. You can specify the statistical scope to query the XA Transactions of a tenant on a single zone or OBServer node.
xa_trans_start_count
Description
The total number of XA transactions that have been successfully started in OceanBase tenants (including those that have ended).
Parameters
| Metrics | Name | Unit |
|---|---|---|
| xa_trans_start_count | xa_trans_start_count | - |
Calculation expression
sum(rate(ob_sysstat{stat_id="30220",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL statement
For OceanBase Database of a version earlier than V4.0:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30220) and (con_id > 1000 or con_id = 1) and class < 1000For OceanBase Database V4.0 and later:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30220) and (con_id > 1000 or con_id = 1) and class < 1000
xa_read_only_trans_total_count
Description
The total number of read-only XA transactions in OceanBase tenants.
Parameters
| Metrics | Name | Unit |
|---|---|---|
| xa_read_only_trans_total_count | xa_read_only_trans_total_count | - |
Calculation expression
sum(rate(ob_sysstat{stat_id="30221",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL statement
For OceanBase Database of a version earlier than V4.0:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30221) and (con_id > 1000 or con_id = 1) and class < 1000For OceanBase Database V4.0 and later:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30221) and (con_id > 1000 or con_id = 1) and class < 1000
xa_one_phase_commit_total_count
Description
The total number of XA transactions that use the one-phase commit method in OceanBase tenants.
Parameters
| Metrics | Name | Unit |
|---|---|---|
| xa_one_phase_commit_total_count | xa_one_phase_commit_total_count | - |
Calculation expression
sum(rate(ob_sysstat{stat_id="30222",@LABELS}[@INTERVAL])) by (@GBLABELS)
SQL statement
For OceanBase Database of a version earlier than V4.0:
select /*+ MONITOR_AGENT READ_CONSISTENCY(WEAK) */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30222) and (con_id > 1000 or con_id = 1) and class < 1000For OceanBase Database V4.0 and later:
select /* MONITOR_AGENT */ con_id tenant_id, stat_id, value from v$sysstat where stat_id IN (30222) and (con_id > 1000 or con_id = 1) and class < 1000