Note
This view is available starting with V4.0.0.
Purpose
This view displays the status and restore progress of log streams for all tenants.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The tenant ID. |
| LS_ID | bigint(20) | NO | The log stream ID. |
| STATUS | varchar(100) | NO | The status of the log stream. Valid values: CREATING: The log stream is being created.CREATED: The log stream is created.NORMAL: The log stream is available for service.DROPPING: The log stream is being dropped. You must migrate the tablets on the log stream.TENANT DROPPING: The tenant to which the log stream belongs is being dropped. You must drop the log stream.WAIT OFFLINE: The data of the log stream has been deleted. The log stream is waiting for garbage collection.CREATE ABORT: The log stream creation failed or is not required. The log stream is being dropped. |
| PRIMARY_ZONE | longtext | YES | The election priority of the log stream. |
| UNIT_GROUP_ID | bigint(20) | NO | The unit group ID. |
| LS_GROUP_ID | bigint(20) | NO | The log stream group ID. |
| CREATE_SCN | bigint(20) unsigned | NO | The starting point of log writing for the log stream. |
| DROP_SCN | bigint(20) unsigned | NO | The point where the log stream is dropped. This is also the point where all user data ends. |
| SYNC_SCN | bigint(20) unsigned | NO | The synchronization point of the log stream. |
| READABLE_SCN | bigint(20) unsigned | NO | The readable point of the log stream. |
| FLAG | varchar(2048) | NO | The log stream flag. Valid values:
NoteThis column is available starting with V4.2.0. |
Sample query
Query the status and restore progress of all log streams for all tenants as the sys tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_LS;
The query result is as follows:
+-----------+-------+--------+--------------+---------------+-------------+---------------------+----------+---------------------+---------------------+------+
| TENANT_ID | LS_ID | STATUS | PRIMARY_ZONE | UNIT_GROUP_ID | LS_GROUP_ID | CREATE_SCN | DROP_SCN | SYNC_SCN | READABLE_SCN | FLAG |
+-----------+-------+--------+--------------+---------------+-------------+---------------------+----------+---------------------+---------------------+------+
| 1 | 1 | NORMAL | zone1 | 0 | 0 | NULL | NULL | NULL | NULL | |
| 1001 | 1 | NORMAL | zone1 | 0 | 0 | NULL | NULL | NULL | NULL | |
| 1002 | 1 | NORMAL | zone1 | 0 | 0 | NULL | NULL | 1741746844849277001 | 1741746844849277000 | |
| 1002 | 1001 | NORMAL | zone1 | 1001 | 1001 | 1740535600638838000 | NULL | 1741746844849277001 | 1741746844849277000 | |
| 1003 | 1 | NORMAL | zone1 | 0 | 0 | NULL | NULL | NULL | NULL | |
| 1004 | 1 | NORMAL | zone1 | 0 | 0 | NULL | NULL | 1741746844849277001 | 1741746844849277000 | |
| 1004 | 1001 | NORMAL | zone1 | 1002 | 1001 | 1740535631547912001 | NULL | 1741746844849277001 | 1741746844849277000 | |
+-----------+-------+--------+--------------+---------------+-------------+---------------------+----------+---------------------+---------------------+------+
7 rows in set