Note
This view is introduced since OceanBase Database V4.3.0.
Purpose
The GV$OB_LS_SNAPSHOTS view displays the information about persisted log stream snapshots in all units.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The ID of the tenant. |
| SNAPSHOT_ID | bigint(20) | NO | The ID of the snapshot. |
| LS_ID | bigint(20) | NO | The ID of the log stream. |
| SVR_IP | varchar(46) | NO | The IP address of the server where the log stream resides. |
| SVR_PORT | bigint(20) | NO | The port number of the server where the log stream resides. |
| META_EXISTED | varchar(3) | NO | Indicates whether the metadata of the snapshot is stored in a unit. Valid values: YES and NO. |
| BUILD_STATUS | varchar(10) | NO | The build status of the snapshot. |
| REBUILD_SEQ_START | bigint(20) | YES | The rebuild sequence of the log stream when the creation of the snapshot started. |
| REBUILD_SEQ_END | bigint(20) | YES | The rebuild sequence of the log stream when the creation of the snapshot ended. |
| END_INTERVAL_SCN | bigint(20) | YES | The system change number (SCN) at which the replay ended. |
| LS_META_PACKAGE | longtext | YES | The log stream metadata corresponding to the replay start SCN. |
| TSNAP_IS_RUNNING | varchar(3) | NO | Indicates whether the corresponding tenant snapshot is running. Valid values: YES and NO. |
| TSNAP_HAS_UNFINISHED_CREATE_DAG | varchar(3) | NO | Indicates whether the corresponding tenant snapshot has any unfinished creation tasks. Valid values: YES and NO. |
| TSNAP_HAS_UNFINISHED_GC_DAG | varchar(3) | NO | Indicates whether the corresponding tenant snapshot has any unfinished garbage collection (GC) tasks. Valid values: YES and NO. |
| TSNAP_CLONE_REF | bigint(20) | YES | The number of cloning tasks of the corresponding tenant snapshot. |
| TSNAP_META_EXISTED | varchar(3) | NO | Indicates whether the metadata of the corresponding tenant snapshot is stored in the unit. Valid values: YES and NO. |
Sample query
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)