Note
This view is available starting with V4.2.0.
Purpose
Only the sys tenant can access this view, which displays all log streams that have existed in all tenants.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The tenant ID. |
| LS_ID | bigint(20) | NO | The log stream ID. |
| LS_GROUP_ID | bigint(20) | NO | The log stream group ID. |
| STATUS | varchar(100) | NO | The current status of the log stream:
|
| FLAG | varchar(2048) | NO | The flag of the log stream:
|
| CREATE_SCN | decimal(20,0) | NO | The GTS when the log stream was created, in nanoseconds. |
Sample query
Query all log streams that have existed in all tenants.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_LS_HISTORY;
The query result is as follows:
+-----------+-------+-------------+--------+------+---------------------+
| TENANT_ID | LS_ID | LS_GROUP_ID | STATUS | FLAG | CREATE_SCN |
+-----------+-------+-------------+--------+------+---------------------+
| 1 | 1 | 0 | NORMAL | | 0 |
| 1001 | 1 | 0 | NORMAL | | 0 |
| 1002 | 1 | 0 | NORMAL | | 0 |
| 1002 | 1001 | 1001 | NORMAL | | 1736152420990131001 |
| 1003 | 1 | 0 | NORMAL | | 0 |
| 1004 | 1 | 0 | NORMAL | | 0 |
| 1004 | 1001 | 1001 | NORMAL | | 1736152507462028000 |
| 1009 | 1 | 0 | NORMAL | | 0 |
| 1010 | 1 | 0 | NORMAL | | 0 |
| 1010 | 1001 | 1001 | NORMAL | | 1736315563386701001 |
| 1015 | 1 | 0 | NORMAL | | 0 |
| 1016 | 1 | 0 | NORMAL | | 0 |
| 1016 | 1001 | 1001 | NORMAL | | 1736152420990131001 |
+-----------+-------+-------------+--------+------+---------------------+
13 rows in set