如何查看渐进合并进度以及合并过程的磁盘用量

如何查看渐进合并进度?

对于 OceanBase 数据库 V2.2.x 前的版本,可以通过

_ALL_VIRTUAL_PARTITION_SSTABLE_IMAGE_INFO

表查询

progressive_merge_percent

列,查看当前渐进合并进度的百分比。

obclient> SELECT progressive_merge_percent FROM __ALL_VIRTUAL_PARTITION_SSTABLE_IMAGE_INFO WHERE tenant_id=<tenant_id> AND table_id=<table_id>;

对于 OceanBase 数据库 V2.2.x 及后续版本,可以通过

_ALL_VIRTUAL_PARTITION_SSTABLE_IMAGE_INFO

表查询

merge_process

列,查看当前渐进合并进度的百分比。

obclient> SELECT merge_process FROM __ALL_VIRTUAL_PARTITION_SSTABLE_IMAGE_INFO WHERE tenant_id=<tenant_id> AND table_id=<table_id>;

如何查看合并过程的磁盘用量?

可以通过

__ALL_VIRTUAL_DISK_STAT

查询

total_size

free_size

,并计算使用量。

obclient> SELECT svr_ip,svr_port,total_size/1024/1024/1024 AS total, free_size/1024/1024/1024 AS free,(total_size-free_size)/1024/1024/1024 as used FROM __all_virtual_disk_stat; ±---------------±---------±-----------------±-----------------±---------------+ | svr_ip | svr_port | total | free | used | ±---------------±---------±-----------------±-----------------±---------------+ | xxx.xx.xxx.xxx | 2882 | 176.552734375000 | 176.269531250000 | 0.283203125000 | | xxx.xx.xxx.xxx | 2882 | 176.552734375000 | 176.177734375000 | 0.375000000000 | | xxx.xx.xxx.xxx | 2882 | 176.552734375000 | 176.177734375000 | 0.375000000000 | ±---------------±---------±-----------------±-----------------±---------------+ 3 rows in set (0.01 sec)