Note
This view is introduced since OceanBase Database V4.2.0.
Purpose
The V$OB_TIMESTAMP_SERVICE view displays the GTS/STS values of the GTS 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 | NUMBER(38) | NO | The ID of the tenant. Valid values:
|
| TS_TYPE | VARCHAR2(100) | NO | The type of the clock source. Valid values:
|
| TS_VALUE | NUMBER(38) | NO | The current clock stored in the memory. |
| SVR_IP | VARCHAR2(46) | NO | The IP address of the OBServer node where the clock service resides. |
| SVR_PORT | NUMBER(38) | NO | The port number of the OBserver node where the clock service resides. |
Sample query
In a user tenant, view the information about the GTS/STS, the clock service, and the clock source type.
obclient [SYS]> SELECT * FROM SYS.V$OB_TIMESTAMP_SERVICE;
The query result is as follows:
+-----------+---------+---------------------+----------------+----------+
| TENANT_ID | TS_TYPE | TS_VALUE | SVR_IP | SVR_PORT |
+-----------+---------+---------------------+----------------+----------+
| 1004 | GTS | 1742974578234478001 | 11.xxx.xxx.xxx | 28825 |
+-----------+---------+---------------------+----------------+----------+
1 row in set