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:
|
| PRIMARY_ZONE | longtext | YES | The priority of the log stream for election. |
| UNIT_GROUP_ID | bigint(20) | NO | The ID of the unit group.
Note
|
| LS_GROUP_ID | bigint(20) | NO | The ID of the log stream group. For system log streams (log stream 1) and broadcast log streams, this field is 0, indicating that the log stream does not belong to a log stream group. |
| CREATE_SCN | bigint(20) unsigned | NO | The SCN at which the log stream starts to write logs. |
| DROP_SCN | bigint(20) unsigned | NO | The SCN at which the log stream is dropped. This SCN marks the end of all user data. If the log stream is dropped, this field records the SCN at which the log stream is dropped. If the log stream is not dropped, this field is empty. |
| SYNC_SCN | bigint(20) unsigned | NO | The SCN of the last transaction that is successfully synchronized with the log stream. |
| READABLE_SCN | bigint(20) unsigned | NO | The SCN of the earliest readable log in the log stream. |
| FLAG | varchar(2048) | NO | The log stream flag. Valid values:
NoteThis field is available starting with V4.2.0. |
| UNIT_LIST | varchar(1216) | NO | The list of units where user log streams are distributed. For system log streams and broadcast log streams, this field is empty if the specific location is not specified.
Note
|
Sample query
Query the status and restore progress of all log streams for all tenants in the sys tenant.
obclient(root@sys)[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 | UNIT_LIST |
+-----------+-------+--------+--------------+---------------+-------------+---------------------+----------+---------------------+---------------------+------+-----------+
| 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 | 1768205075324901000 | 1768205075223955000 | | |
| 1002 | 1001 | NORMAL | zone1 | 0 | 1001 | 1767769653174440000 | NULL | 1768205075324901000 | 1768205075223955000 | | 1001 |
| 1003 | 1 | NORMAL | zone1 | 0 | 0 | NULL | NULL | NULL | NULL | | |
| 1004 | 1 | NORMAL | zone1 | 0 | 0 | NULL | NULL | 1768205075324901001 | 1768205075324901001 | | |
| 1004 | 1001 | NORMAL | zone1 | 0 | 1001 | 1767769662964400002 | NULL | 1768205075224971000 | 1768205075224971000 | | 1002 |
+-----------+-------+--------+--------------+---------------+-------------+---------------------+----------+---------------------+---------------------+------+-----------+
7 rows in set
References
Query the status and restore progress of log streams for the current tenant: DBA_OB_LS
For more information about log stream replicas, see Replica introduction.