Note
This view is introduced in V4.0.0.
Purpose
This view displays the status and restore progress of all log streams of all tenants.
Columns
| Column | Type | Nullable? | Description | |
|---|---|---|---|---|
| TENANT_ID | bigint(20) | NO | Tenant ID | |
| LS_ID | bigint(20) | NO | Log stream ID | |
| STATUS | varchar(100) | NO | Log stream status. Valid values: CREATING: Log stream is being created.CREATED: Log stream is created.NORMAL: The log stream is available.DROPPING: The log stream is to be deleted. The tablets on the log stream need to be migrated.TENANT DROPPING: The tenant that contains the log stream is to be deleted. The log stream needs to be deleted.WAIT OFFLINE: The data of the log stream is deleted. The log stream is waiting for garbage collection.CREATE ABORT: The log stream creation failed or is not needed. The log stream is to be deleted. |
|
| PRIMARY_ZONE | longtext | YES | Election priority of the log stream | |
| UNIT_GROUP_ID | bigint(20) | NO | Unit group ID | |
| LS_GROUP_ID | bigint(20) | NO | Log stream group ID | |
| CREATE_SCN | bigint(20) unsigned | NO | The first SCN where the log stream starts to write logs. | |
| DROP_SCN | bigint(20) unsigned | NO | The last SCN of all user data. | |
| SYNC_SCN | bigint(20) unsigned | NO | Synchronization SCN of the log stream. | |
| READABLE_SCN | bigint(20) unsigned | NO | Readable SCN of the log stream. | |
| FLAG | varchar(2048) | NO | Log stream flags. Valid values:
|
BLOCK_TABLET_IN: Tablets cannot be created on the broadcast log stream.
NoteThis field is introduced in V4.2.0. |
Sample query
The following example describes how to query the status and restore progress of all log streams of all tenants in the sys tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_LS;
The following figure shows the query result.
+-----------+-------+--------+--------------+---------------+-------------+---------------------+----------+---------------------+---------------------+------+
| 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