如何查看 OceanBase 数据库事务层的整体耗时?

可以通过 gv$sysstat 视图查看各监控项的累计耗时,并通过 LIKE ‘%transaction%’ 条件过滤事务层的监控信息。

使用示例如下所示。

obclient> SELECT * FROM gv$sysstat WHERE NAME LIKE ‘%transac%’; ±-------±---------------±---------±-----------±-----------±--------±------------------------------------------------------±------+ | CON_ID | SVR_IP | SVR_PORT | STATISTIC# | VALUE | STAT_ID | NAME | CLASS | ±-------±---------------±---------±-----------±-----------±--------±------------------------------------------------------±------+ | 1 | xxx.xx.xxx.xxx | 2882 | 348 | 21111835 | 82001 | replay engine success replay transaction log count | 256 | | 1 | xxx.xx.xxx.xxx | 2882 | 349 | 3454364169 | 82002 | replay engine success replay transaction log time | 256 | | 1 | xxx.xx.xxx.xxx | 2882 | 350 | 0 | 82003 | replay engine fail replay transaction log count | 256 | | 1 | xxx.xx.xxx.xxx | 2882 | 351 | 0 | 82004 | replay engine fail replay transaction log time | 256 | | 1 | xxx.xx.xxx.xxx | 2882 | 362 | 21111835 | 82015 | replay engine submitted transaction replay task count | 256 | …