Note
This view is available starting with V4.0.0.
Overview
The system tenant displays the table and table group relationships for all tenants. Tables that are not part of a table group are not displayed.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | Tenant ID |
| TABLEGROUP_NAME | VARCHAR2(128) | NO | Table group name |
| OWNER | VARCHAR2(128) | NO | The name of the database to which the table belongs. |
| TABLE_NAME | VARCHAR2(256) | NO | Table name |
| SHARDING | varchar(20) | NO | The SHARDING attribute of the table group:
|
| SCOPE | varchar(20) | NO | Table group'sSCOPEAttribute. Valid values:
NoteFor V4.4.2, this field is available starting with V4.4.2 BP1. |
Sample query
In the sys tenant, query the association relationships of the table group named tblgroup2.
obclient> SELECT * FROM oceanbase.CDB_OB_TABLEGROUP_TABLES
WHERE tablegroup_name = 'tblgroup2'
AND TENANT_ID = '1002';
The return result is as follows:
+-----------+-----------------+---------+------------+----------+--------+
| TENANT_ID | TABLEGROUP_NAME | OWNER | TABLE_NAME | SHARDING | SCOPE |
+-----------+-----------------+---------+------------+----------+--------+
| 1002 | tblgroup2 | test_db | test_tbl3 | NONE | SERVER |
| 1002 | tblgroup2 | test_db | test_tbl4 | NONE | SERVER |
+-----------+-----------------+---------+------------+----------+--------+
2 rows in set
