【 使用环境 】测试环境
【 OB or 其他组件 】OceanBase; OCP
【 使用版本 】OceanBase-CE-4.2.1-bp3; OCP-4.2.1-20231208144448
【问题描述】OCP 告警提示服务器数据盘使用率超限,但并没有大量导入数据,通过OCP上租户管理-数据库管理查看到,业务租户下OceanBase库磁盘使用量达370GB(三副本总量),SYS租户下OceanBase库磁盘使用量才不到1GB
通过SQL语句查询,发现业务租户下,OceanBase库下__all_histogram_stat_history磁盘占用量很大,查询官方文档并没有相关说明,且这张表的空间率也比较低。同时作为虚拟表也无法清理。
select /*+ READ_CONSISTENCY(WEAK) */ t1.table_name, concat(round(sum(t2.data_size/1024/1024/1024), 2), 'G') data_size_gb , concat(round(sum(t2.required_size)/1024/1024/1024, 2), 'G') required_size_gb from dba_ob_tenants t,cdb_ob_table_locations t1,cdb_ob_tablet_replicas t2 where t.tenant_id=t1.tenant_id and t1.svr_ip=t2.svr_ip and t1.tenant_id=t2.tenant_id and t1.ls_id=t2.ls_id and t1.tablet_id=t2.tablet_id and t1.role='leader' and t.tenant_id = 1002 and t1.database_name='oceanbase' group by t1.table_name order by 3 desc limit 10;
+------------------------------------------+--------------+------------------+
| table_name | data_size_gb | required_size_gb |
+------------------------------------------+--------------+------------------+
| __all_column_stat_history | 3.80G | 5.55G |
| __all_histogram_stat_history | 87.79G | 117.05G |
| __idx_334_idx_histogram_stat_his_savtime | 7.70G | 11.19G |
| __idx_333_idx_column_stat_his_savtime | 0.37G | 0.60G |
| __all_table_stat_history | 0.15G | 0.17G |
| __idx_332_idx_table_stat_his_savtime | 0.07G | 0.13G |
| __all_ddl_operation | 0.05G | 0.09G |
| __all_histogram_stat | 0.02G | 0.03G |
| __all_tablet_checksum | 0.02G | 0.03G |
| __all_column_stat | 0.02G | 0.02G |
+------------------------------------------+--------------+------------------+
是否有办法处理一下,这个磁盘占用严重影响了对应租户的合并过程。并且希望了解这个表里面数据是怎么产生的。