Overview
The GV$OB_LS_SNAPSHOTS view displays information about the log stream snapshots stored persistently in all units.
Columns
Field |
Type |
Nullable |
Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | Tenant ID |
| SNAPSHOT_ID | bigint(20) | NO | Snapshot ID |
| LS_ID | bigint(20) | NO | Log Stream ID |
| SVR_IP | varchar(46) | NO | IP Address of the Server Where the Log Stream Resides |
| SVR_PORT | bigint(20) | NO | Port number of the server where the log stream is located |
| META_EXISTED | varchar(3) | NO | Whether the snapshot's meta information is stored in units (YES/NO) |
| BUILD_STATUS | varchar(10) | NO | Snapshot Creation Status |
| REBUILD_SEQ_START | bigint(20) | YES | REBUILD SEQ of the log stream at the start of snapshot creation |
| REBUILD_SEQ_END | bigint(20) | YES | REBUILD SEQ of the log stream when snapshot creation ends |
| END_INTERVAL_SCN | bigint(20) | YES | Terminate Replay SCN Point |
| LS_META_PACKAGE | longtext | YES | Log stream metadata corresponding to the start replay position |
| TSNAP_IS_RUNNING | varchar(3) | NO | Whether the tenant snapshot is running (YES/NO). |
| TSNAP_HAS_UNFINISHED_CREATE_DAG | varchar(3) | NO | Whether there are any unfinished create tasks for the tenant snapshot (YES/NO). |
| TSNAP_HAS_UNFINISHED_GC_DAG | varchar(3) | NO | Whether there are any unfinished GC tasks for the tenant snapshot (YES/NO) |
| TSNAP_CLONE_REF | bigint(20) | YES | Number of Clone Tasks for Tenant Snapshots |
| TSNAP_META_EXISTED | varchar(3) | NO | Whether the tenant snapshot's meta information is stored in a unit (YES/NO) |
Sample query
Query information about the log stream snapshot stored persistently in all units.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_LS_SNAPSHOTS;
The query result is as follows:
+-----------+---------------------+-------+-----------+----------+--------------+--------------+-------------------+-----------------+------------------+-----------------+------------------+---------------------------------+-----------------------------+-----------------+--------------------+
| TENANT_ID | SNAPSHOT_ID | LS_ID | SVR_IP | SVR_PORT | META_EXISTED | BUILD_STATUS | REBUILD_SEQ_START | REBUILD_SEQ_END | END_INTERVAL_SCN | LS_META_PACKAGE | TSNAP_IS_RUNNING | TSNAP_HAS_UNFINISHED_CREATE_DAG | TSNAP_HAS_UNFINISHED_GC_DAG | TSNAP_CLONE_REF | TSNAP_META_EXISTED |
+-----------+---------------------+-------+-----------+----------+--------------+--------------+-------------------+-----------------+------------------+-----------------+------------------+---------------------------------+-----------------------------+-----------------+--------------------+
| 1004 | 1705980893676511847 | 1001 | xx.xx.xx.xx | 27801 | YES | UNKNOWN | NULL | NULL | NULL | NULL | YES | NO | NO | 0 | YES |
| 1004 | 1705980893676511847 | 1 | xx.xx.xx.xx | 27801 | YES | UNKNOWN | NULL | NULL | NULL | NULL | YES | NO | NO | 0 | YES |
+-----------+---------------------+-------+-----------+----------+--------------+--------------+-------------------+-----------------+------------------+-----------------+------------------+---------------------------------+-----------------------------+-----------------+--------------------+
2 rows in set (0.180 sec)