Note
This view was introduced in 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 garbage collection (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 system change number (SCN) when the log stream started to write logs. |
| DROP_SCN | bigint(20) unsigned | NO | The SCN when 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. |
Sample query
Query the status and restore progress of log streams 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 | 1727403426326888000 | 1727403425825889004 | |
| 1001 | NORMAL | zone1 | 1001 | 1001 | 1727343222369406001 | NULL | 1727403426326888000 | 1727403426326888000 | |
+-------+--------+--------------+---------------+-------------+---------------------+----------+---------------------+---------------------+------+
2 rows in set