首批通过分布式安全可靠测评,为关键业务系统打造
系统表 __all_virtual_table 中 table_type 等字段的含义
更新时间:2026-05-21 01:56
在 __all_virtual_table 等系统表中,table_type、index_type、index_status、partition_status 均用整数数字表示,本文以 OceanBase 数据库 V3.x 版本为例,解释这些数字代表的含义。
适用版本
OceanBase 数据库 V3.x 版本。
查询示例
MySQL [oceanbase]> select tenant_id,table_id,data_table_id,table_name,table_type,index_type,partition_status,index_status from __all_virtual_table where tenant_id>1 limit 10;
+-----------+------------------+------------------+---------------------------------------+------------+------------+------------------+--------------+
| tenant_id | table_id | data_table_id | table_name | table_type | index_type | partition_status | index_status |
+-----------+------------------+------------------+---------------------------------------+------------+------------+------------------+--------------+
| 1001 | 1100611139453920 | 0 | TPX1 | 3 | 0 | 0 | 1 |
| 1001 | 1100611139453921 | 0 | TPX2 | 3 | 0 | 0 | 1 |
| 1001 | 1100611139453928 | 0 | TPX | 3 | 0 | 0 | 1 |
| 1001 | 1100611139453929 | 0 | TX | 3 | 0 | 0 | 1 |
| 1001 | 1100611139453931 | 0 | RECYCLE_$_1681708300_1694079775209832 | 4 | 0 | 0 | 1 |
| 1001 | 1100611139453935 | 0 | TEST_T1 | 3 | 0 | 0 | 1 |
| 1001 | 1100611139453936 | 1100611139453935 | __idx_1100611139453935_TEST_T1_I1 | 5 | 7 | 0 | 2 |
| 1001 | 1100611139453937 | 0 | TEST_T2 | 3 | 0 | 0 | 1 |
| 1001 | 1100611139453938 | 1100611139453937 | __idx_1100611139453937_TEST_T2_I1 | 5 | 7 | 0 | 2 |
| 1001 | 1100611139453939 | 1100611139453937 | __idx_1100611139453937_TEST_T2_I2 | 5 | 7 | 0 | 2 |
+-----------+------------------+------------------+---------------------------------------+------------+------------+------------------+--------------+
Table_type 的定义
- 0:SYSTEM_TABLE
- 1:SYSTEM_VIEW
- 2:VIRTUAL_TABLE
- 3:USER_TABLE
- 4:USER_VIEW
- 5:USER_INDEX
- 6:TMP_TABLE // MySQL 模式的临时表
- 7:MATERIALIZED_VIEW // 3.x 版本暂时不支持 MQT
- 8:TMP_TABLE_ORA_SESS // Oracle 模式的临时表, session level
- 9:TMP_TABLE_ORA_TRX // Oracle 模式的临时表, transaction level
Partition_status 的定义
- -1:INVALID
- 0:ACTIVE
- 1:LOGICAL_SPLITTING
- 2:MERGE
- 3:PHYSICAL_SPLITTING
- 4:SPLIT
Index_type 的定义
- 0:NOT_INDEX
- 1:本地普通索引
- 2:本地唯一索引
- 3:全局普通索引
- 4:全局唯一索引
- 5:主键
- 6:全文索引
- 7:单分区表的全局普通索引,实际上优化成本地普通索引
- 8:单分区表的全局唯一索引,实际上优化成本地唯一索引
Index_status 的定义
- 0:NOT_FOUND
- 1:UNAVAILABLE
- 2:AVAILABLE
- 5:ERROR // 索引创建出错时的状态,出错后索引会被删除
- 6:RESTORE_INDEX_ERROR
- 7:UNUSABLE