Note
This view is available starting with V4.0.0.
Purpose
This view displays the location of a table or partition, including system tables, user tables, and index tables.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| DATABASE_NAME | varchar(128) | NO | The name of the database. |
| TABLE_NAME | varchar(256) | NO | The name of the table. |
| TABLE_ID | bigint(20) | NO | The ID of the table. |
| TABLE_TYPE | varchar(13) | NO | The type of the table. Valid values:
|
| PARTITION_NAME | varchar(64) | NO | The name of the partition. For non-partitioned tables, this column is NULL. |
| SUBPARTITION_NAME | varchar(64) | NO | The name of the subpartition. If no subpartition exists, this column is NULL. |
| INDEX_NAME | varchar(256) | NO | The name of the index table. If the table is not an index table, this column is NULL. |
| DATA_TABLE_ID | bigint(20) | NO | The ID of the main table to which the index table or LOB auxiliary table belongs. If the table is not an index table or LOB auxiliary table, this column is NULL. |
| TABLET_ID | bigint(20) | NO | The ID of the tablet. |
| LS_ID | bigint(20) | NO | The ID of the log stream where the object is located. |
| ZONE | varchar(128) | NO | The zone where the replica is located. |
| SVR_IP | varchar(46) | NO | The IP address of the replica. |
| SVR_PORT | bigint(20) | NO | The port number of the replica. |
| ROLE | varchar(8) | NO | The role of the replica. |
| REPLICA_TYPE | varchar(18) | NO | The type of the log stream replica. Valid values:
|
| DUPLICATE_SCOPE | varchar(7) | NO | The value indicates whether the table is a replicated table. Valid values:
NoteThis column is available starting with V4.2.0. |
| DUPLICATE_READ_CONSISTENCY | varchar(6) | NO | The value indicates the read consistency constraint of the standby replica of a replicated table. Valid values:
NoteThis column is available starting with V4.3.4. |
| OBJECT_ID | bigint(20) | NO | The ID of the partition
NoteThis column is available starting with V4.2.0. |
| TABLEGROUP_NAME | varchar(128) | NO | The name of the table group to which the table belongs
NoteThis column is available starting with V4.2.0. |
| TABLEGROUP_ID | bigint(20) | NO | The ID of the table group to which the table belongs
NoteThis column is available starting with V4.2.0. |
| SHARDING | varchar(20) | NO | The sharding attribute of the table group to which the table belongs (evenly distributed mode)
NoteThis column is available starting with V4.2.0. |
| INDEX_TYPE | varchar(6) | NO | The GLOBAL/LOCAL attribute of the index table. Valid values:
Note
|
Sample query
Query the location of the test1_tbl1 table.
obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_TABLE_LOCATIONS WHERE TABLE_NAME='test1_tbl1'\G
The query result is as follows:
*************************** 1. row ***************************
DATABASE_NAME: test
TABLE_NAME: test1_tbl1
TABLE_ID: 500002
TABLE_TYPE: USER TABLE
PARTITION_NAME: NULL
SUBPARTITION_NAME: NULL
INDEX_NAME: NULL
DATA_TABLE_ID: NULL
TABLET_ID: 200001
LS_ID: 1001
ZONE: zone1
SVR_IP: xxx.xx.xxx.xxx
SVR_PORT: 2882
ROLE: LEADER
REPLICA_TYPE: FULL
DUPLICATE_SCOPE: NONE
DUPLICATE_READ_CONSISTENCY: NONE
OBJECT_ID: 500002
TABLEGROUP_NAME: NULL
TABLEGROUP_ID: NULL
SHARDING: NULL
INDEX_TYPE: NULL
1 row in set
