Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
The oceanbase.DBA_OB_LS view displays the status and restore progress of log streams.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| LS_ID | bigint(20) | NO | The ID of the log stream. |
| STATUS | varchar(100) | NO | The status of the log stream. Valid values:CREATING: The log stream is being created.CREATED: The log stream has been created.NORMAL: The log stream can provide services.DROPPING: The log stream is to be deleted. You need to migrate the TABLETs from the log stream.TENANT DROPPING: The tenant where the log stream resides is being deleted. You need to delete the log stream.WAIT OFFLINE: The data has been deleted from the log stream. The log stream is waiting for GC.CREATE ABORT: The log stream fails to be created or does not need to be created, and will be deleted soon. |
| CREATE_SCN | bigint(20) unsigned | NO | The SCN where the log stream started to write logs. |
| DROP_SCN | bigint(20) unsigned | NO | The SCN where the log stream was deleted and all user data ended. |
| SYNC_SCN | bigint(20) unsigned | NO | The SCN when the log stream was synchronized. |
| READABLE_SCN | bigint(20) unsigned | NO | The readable SCNs of the log stream. |
| PRIMARY_ZONE | longtext | YES | The election priority of the log stream. |
| UNIT_GROUP_ID | bigint(20) | NO | The ID of the unit group. |
| LS_GROUP_ID | bigint(20) | NO | The ID of the log stream group. |
| FLAG | varchar(2048) | NO | The log stream flag:
NoteThis field has been introduced since V4.2.0. |
Sample query
A query in the sys tenant for the log stream status and restore progress of the current tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_LS;
The query result is as follows:
+-------+--------+--------------+---------------+-------------+------------+----------+----------+--------------+------+
| LS_ID | STATUS | PRIMARY_ZONE | UNIT_GROUP_ID | LS_GROUP_ID | CREATE_SCN | DROP_SCN | SYNC_SCN | READABLE_SCN | FLAG |
+-------+--------+--------------+---------------+-------------+------------+----------+----------+--------------+------+
| 1 | NORMAL | zone1 | 0 | 0 | NULL | NULL | NULL | NULL | |
+-------+--------+--------------+---------------+-------------+------------+----------+----------+--------------+------+
1 row in set