Note
This view is introduced in V4.2.0.
Purpose
You can query this view only in the sys tenant. The view displays all the log streams that have existed in all tenants.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The ID of the tenant. |
| LS_ID | bigint(20) | NO | The ID of the log stream. |
| LS_GROUP_ID | bigint(20) | NO | The ID of the log stream group. |
| STATUS | varchar(100) | NO | The current status of the log stream.
|
| FLAG | varchar(2048) | NO | The log stream flag.
|
| CREATE_SCN | decimal(20,0) | NO | The GTS at which the log stream was created, in nanoseconds. |
Sample query
The following example shows how to query all the log streams that have existed in all tenants from the sys tenant.
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