可以通过以下三种方式查看表的tableid,具体如下:
1、通过show
full create table 查看,TID即为该表的tableid
gbase> show full
create table t1;
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create
Table
|
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE "t1" (
"a" int(11) DEFAULT NULL,
"b" varchar(40) DEFAULT NULL,
"c" date DEFAULT NULL
) ENGINE=EXPRESS
DISTRIBUTED BY('a') TID(5) UID(1) DEFAULT CHARSET=utf8
TABLESPACE='sys_tablespace' COLUMN_IDS(0, 1, 2) |
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set
(Elapsed: 00:00:00.00)
2、通过information_schema.tables查看对应表的table_id
gbase> select
table_name,table_id from information_schema.tables where table_name='t1';
+------------+----------+
| table_name |
table_id |
+------------+----------+
| t1 | 5 |
+------------+----------+
1 row in set
(Elapsed: 00:00:00.00)
3、通过metadump查看:
元数据合并前版本查看方式metadump table.desc.A/B, 元数据合并后的版本查看方式metadumptable.info.A/B,其中的t_num就是tableid
元数据合并前版本:
[gbase@localhost t1.GED]$ metadump 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.
table.des.B
+----------------------+-----------------+
| storage_version | GEHV6 |
| encrypt | 0 |
| shrinked_rowid | 0 |
| no_attr | 1 |
| attr_nums[0] | 0 |
| no_attr_cnt | 1 |
| no_attr[0] | 1 |
| t_name | t1 |
| t_desc::false | |
| offset | 46 |
| length | 10 |
| block type | 1 |
| next | 0 |
| t_num | 2053 |
| limit_storage_size | 0 |
| storage_size | 0 |
| scn | 131083 |
| compress_flag_num | 4294967295 |
| compress_flag_str | 4294967295 |
| extend_size | 0 |
| autoextend_flag | 0 |
| tab_data_size | 0 |
| durability | 0 |
+----------------------+-----------------+
元数据合并后版本:
[gbase@node34 t1.GED]$ metadump
table.info.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.
table.info.B
----------------------------state------------------------
+-------------------------------------+-----------------+
| version | 8 |
| checksum | 3585941699 |
| table_last_operation | DDL |
| ctl_version | B |
| map_version | A |
| delete_version | B |
+-------------------------------------+-----------------+
----------------------------des--------------------------
+----------------------+-----------------+
| storage_version | GEHV8 |
| checksum | 2647270172 |
| t_num | 5 |
| tablespace_id | 0 |
| no_attr | 3 |
| no_attr_cnt | 3 |
| encrypt | 0 |
| compress_flag_num | 4294967295 |
| compress_flag_str | 4294967295 |
| limit_storage_size | 0 |
| autoextend_flag | 0 |
| extend_size | 0 |
| shrinked_rowid | 0 |
| tab_data_size | 0 |
| storage_size | 0 |
| scn | 9 |
+----------------------+-----------------+




