Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
The oceanbase.CDB_OB_TABLEGROUP_TABLES view displays the associations between table groups and tables of all tenants in the sys tenant. Tables that do not belong to a table group are not displayed.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The ID of the tenant. |
| TABLEGROUP_NAME | VARCHAR2(128) | NO | The name of the table group. |
| OWNER | VARCHAR2(128) | NO | The name of the database where the table belongs. |
| TABLE_NAME | VARCHAR2(256) | NO | The name of the table. |
| SHARDING | varchar(10) | NO | The SHARDING attribute of the table group. Valid values:
|
Sample query
Query the relationships of the tblgroup1 table group in the sys tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_TABLEGROUP_TABLES WHERE tablegroup_name = 'tblgroup1';
The query result is as follows:
+-----------+-----------------+-------+------------+----------+
| TENANT_ID | TABLEGROUP_NAME | OWNER | TABLE_NAME | SHARDING |
+-----------+-----------------+-------+------------+----------+
| 1002 | tblgroup1 | test | tbl3 | ADAPTIVE |
| 1004 | TBLGROUP1 | SYS | TBL3 | NONE |
+-----------+-----------------+-------+------------+----------+
2 rows in set