Note
This view is introduced since OceanBase Database V4.2.0.
Purpose
The V$OB_TIMESTAMP_SERVICE view displays the GTS/STS values, node information, and clock source type of the clock service of the current tenant.
The value varies based on databases.
- For the primary database, the GTS value of the primary database is displayed.
- For the standby database, the current readable timestamp (STS) of the standby database is displayed.
The value also varies based on tenants.
- For the sys tenant, you can query the clocks of all tenants.
- For a user tenant, you can query only the lock of the current tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The ID of the tenant. Valid values:
|
| TS_TYPE | varchar(100) | NO | The type of the clock source. Valid values:
|
| TS_VALUE | bigint(20) | NO | The current clock stored in the memory. |
| SVR_IP | varchar(46) | NO | The IP address of the OBServer node where the clock service resides. |
| SVR_PORT | bigint(20) | NO | The port number of the OBServer node where the clock service resides. |
Sample query
In the sys tenant, view the GTS/STS, clock service node information, and clock source type of all tenants.
obclient [oceanbase]> SELECT * FROM oceanbase.V$OB_TIMESTAMP_SERVICE;
The query result is as follows:
+-----------+---------+---------------------+----------------+----------+
| TENANT_ID | TS_TYPE | TS_VALUE | SVR_IP | SVR_PORT |
+-----------+---------+---------------------+----------------+----------+
| 1 | GTS | 1742974298040897001 | 11.xxx.xxx.xxx | 28825 |
| 1001 | GTS | 1742974298040897001 | 11.xxx.xxx.xxx | 28825 |
| 1002 | GTS | 1742974298040897001 | 11.xxx.xxx.xxx | 28825 |
| 1003 | GTS | 1742974298040897001 | 11.xxx.xxx.xxx | 28825 |
| 1004 | GTS | 1742974298040897001 | 11.xxx.xxx.xxx | 28825 |
| 1005 | GTS | 1742974298040897001 | 11.xxx.xxx.xxx | 28825 |
| 1006 | GTS | 1742974298040897001 | 11.xxx.xxx.xxx | 28825 |
+-----------+---------+---------------------+----------------+----------+
7 rows in set