南大通用GBase 8a查看表的tableId

可以通过如下两种方案查看某表的tableID。

参考

GBase 8a查看和修改表的拥有者UID

GBase8a 集群查看建表结构,存储过程的语句

GBase 8a的show命令列表和使用

联机的tables表

查看information_schema.table表可以获得tableid。如下例子是9。

gbase> use information_schema;
Query OK, 0 rows affected (Elapsed: 00:00:00.00)

gbase> select * from tables where table_name='tmpab'\G
*************************** 1. row ***************************
              TABLE_CATALOG: NULL
               TABLE_SCHEMA: testdb
                 TABLE_NAME: tmpab
                 TABLE_TYPE: BASE TABLE
                     ENGINE: EXPRESS
                    VERSION: 10
                 ROW_FORMAT: Compressed
                 TABLE_ROWS: 0
             AVG_ROW_LENGTH: 0
                DATA_LENGTH: 0
            MAX_DATA_LENGTH: 0
               INDEX_LENGTH: 0
                  DATA_FREE: 0
             AUTO_INCREMENT: NULL
                CREATE_TIME: 2020-10-27 15:44:38
                UPDATE_TIME: 2020-10-27 15:49:21
                 CHECK_TIME: NULL
            TABLE_COLLATION: utf8_general_ci
                   CHECKSUM: NULL
             CREATE_OPTIONS: avg_row_length=307
   TABLE_LIMIT_STORAGE_SIZE: 0
         TABLE_STORAGE_SIZE: 770
            TABLE_DATA_SIZE: 0
              TABLE_COMMENT:
 LOCAL_HASH_INDEX_FILE_SIZE: 0
GLOBAL_HASH_INDEX_FILE_SIZE: 0
                        SCN: 26
                   TABLE_ID: 9
                  OWNER_UID: 1
1 row in set (Elapsed: 00:00:00.00)

离线通过metadump

通过metadump table.desc.A/B, 或者V95版本的table.info.A/B查看,其中的t_num就是tableid。如下例子同样的表是9。

[gbase@rh6-1 t1_n1.GED]$ metadump /opt/gcluster/userdata/gcluster/testdb/metadata/tmpab.GED/table.des.B
This tool is designed for use at GBase internally,and is unsupported externally.
GBase makes no claims and holds no liability regarding the external use of this tool.
This tool is copyrighted and his redistribution is restricted.
/opt/gcluster/userdata/gcluster/testdb/metadata/tmpab.GED/table.des.B
+----------------------+-----------------+
| storage_version      | GEHV7           |
| encrypt              | 0               |
| shrinked_rowid       | 0               |
| no_attr              | 2               |
| attr_nums[0]         | 0               |
| attr_nums[1]         | 1               |
| no_attr_cnt          | 2               |
| no_attr[0]           | 1               |
| no_attr[1]           | 1               |
| t_name               | tmpab           |
| t_desc::false        |                 |
| offset               | 54              |
| length               | 14              |
| block type           | 1               |
| next                 | 0               |
| t_num                | 9               |
| limit_storage_size   | 0               |
| storage_size         | 0               |
| scn                  | 26              |
| compress_flag_num    | 4294967295      |
| compress_flag_str    | 4294967295      |
| extend_size          | 0               |
| autoextend_flag      | 0               |
| tab_data_size        | 0               |
| durability           | 0               |
+----------------------+-----------------+