获取表存储大小(data_length)

【 使用环境 】测试环境
【 OB or 其他组件 】OBServer
【 使用版本 】4.0
【问题描述】
手动执行统计信息刷新后( 手动收集统计信息 -OceanBase 数据库-OceanBase文档中心-分布式数据库使用文档),__all_table_stat 和 DBA_TAB_STATISTICS里面的表记录数已经刷新,但information_schema.tables中仍然没有数据;只有后者有表存储大小字段(data_length)。

附SQL:
select
table_schema as ‘数据库’,
table_name as ‘表名’,
table_rows as ‘记录数’,
truncate(data_length/1024/1024/1024, 2) as ‘数据容量(GB)’,
truncate(index_length/1024/1024/1024, 2) as ‘索引容量(GB)’
from information_schema.tables where table_schema=’<表名>’
order by table_rows desc, data_length desc;

table_schema填成数据库名即可

这个问题已经解决了吗?

解决了,我自己搞错了