Note
This view is available starting with V4.0.0.
Purpose
This view displays the list of tablets for all tenants and the log stream information to which each tablet belongs, under the sys tenant.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The tenant ID. |
| TABLET_ID | bigint(20) | NO | The tablet ID. |
| LS_ID | bigint(1) | NO | The ID of the log stream to which the tablet belongs. |
Sample query
Query the list of tablets in log stream 1001 of tenant 1002 under the sys tenant, and display the first 5 entries.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_TABLET_TO_LS WHERE TENANT_ID=1002 AND LS_ID=1001 LIMIT 5;
The query result is as follows:
+-----------+-----------+-------+
| TENANT_ID | TABLET_ID | LS_ID |
+-----------+-----------+-------+
| 1002 | 200004 | 1001 |
| 1002 | 200005 | 1001 |
| 1002 | 200007 | 1001 |
| 1002 | 200008 | 1001 |
| 1002 | 200009 | 1001 |
+-----------+-----------+-------+
5 rows in set