首批通过分布式安全可靠测评,为关键业务系统打造
oceanbase.DBA_TAB_STATS_HISTORY
更新时间:2026-07-15 20:42:47
说明
该视图从 V4.0.0 版本开始引入。
功能描述
展示当前租户的所有表的表统计历史记录。
字段说明
| 字段名称 | 类型 | 是否可以为 NULL | 描述 |
|---|---|---|---|
| OWNER | varchar(128) | NO | 对象的所有者 |
| TABLE_NAME | varchar(128) | NO | 表名 |
| PARTITION_NAME | varchar(128) | NO | 分区表名称 |
| SUBPARTITION_NAME | varchar(128) | NO | 子分区表的名称 |
| STATS_UPDATE_TIME | datetime(6) | NO | 更新统计数据的时间 |
查询示例
查看本租户中表 t_subpart 的表统计修改历史记录。
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_TAB_STATS_HISTORY WHERE TABLE_NAME='t_subpart';
查询结果如下:
+-------+---------------+----------------+-------------------+----------------------------+
| OWNER | TABLE_NAME | PARTITION_NAME | SUBPARTITION_NAME | STATS_UPDATE_TIME |
+-------+---------------+----------------+-------------------+----------------------------+
| test | t_subpart | NULL | NULL | 2025-03-21 15:23:11.884679 |
| test | t_subpart | NULL | NULL | 2025-03-21 16:21:09.868166 |
| test | t_subpart | p2023 | NULL | 2025-03-21 15:23:11.884679 |
| test | t_subpart | p2023 | NULL | 2025-03-21 16:21:09.868166 |
| test | t_subpart | p2024 | NULL | 2025-03-21 15:23:11.884679 |
| test | t_subpart | p2024 | NULL | 2025-03-21 16:21:09.868166 |
| test | t_subpart | p_max | NULL | 2025-03-21 16:21:09.868166 |
| test | t_subpart | p2023 | p2023sp0 | 2025-03-21 15:23:11.884679 |
| test | t_subpart | p2023 | p2023sp0 | 2025-03-21 16:21:09.868166 |
| test | t_subpart | p2023 | p2023sp1 | 2025-03-21 15:23:11.884679 |
| test | t_subpart | p2023 | p2023sp1 | 2025-03-21 16:21:09.868166 |
| test | t_subpart | p2023 | p2023sp2 | 2025-03-21 15:23:11.884679 |
| test | t_subpart | p2023 | p2023sp2 | 2025-03-21 16:21:09.868166 |
| test | t_subpart | p2023 | p2023sp3 | 2025-03-21 15:23:11.884679 |
| test | t_subpart | p2023 | p2023sp3 | 2025-03-21 16:21:09.868166 |
| test | t_subpart | p2024 | p2024sp0 | 2025-03-21 15:23:11.884679 |
| test | t_subpart | p2024 | p2024sp0 | 2025-03-21 16:21:09.868166 |
| test | t_subpart | p2024 | p2024sp1 | 2025-03-21 15:23:11.884679 |
| test | t_subpart | p2024 | p2024sp1 | 2025-03-21 16:21:09.868166 |
| test | t_subpart | p2024 | p2024sp2 | 2025-03-21 15:23:11.884679 |
| test | t_subpart | p2024 | p2024sp2 | 2025-03-21 16:21:09.868166 |
| test | t_subpart | p2024 | p2024sp3 | 2025-03-21 15:23:11.884679 |
| test | t_subpart | p2024 | p2024sp3 | 2025-03-21 16:21:09.868166 |
| test | t_subpart | p_max | p_maxsp0 | 2025-03-21 16:21:09.868166 |
| test | t_subpart | p_max | p_maxsp1 | 2025-03-21 16:21:09.868166 |
| test | t_subpart | p_max | p_maxsp2 | 2025-03-21 16:21:09.868166 |
| test | t_subpart | p_max | p_maxsp3 | 2025-03-21 16:21:09.868166 |
+-------+---------------+----------------+-------------------+----------------------------+
27 rows in set