Note
This view is available starting with V1.4.
Purpose
This view displays session-level statistics for all tenants across all OBServer nodes. The STATISTIC# column indicates the statistic index, which can be mapped to the corresponding statistic name and description using the V$STATNAME view.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| SID | bigint(20) | NO | For V4.2.x:
|
| CON_ID | bigint(20) | NO | The tenant ID. |
| SVR_IP | varchar(46) | NO | The IP address of the server where the information is stored. |
| SVR_PORT | bigint(20) | NO | The port number of the server where the information is stored. |
| STATISTICS# | bigint(20) | NO | The index of the statistic. |
| VALUE | bigint(20) | NO | The number of times the statistic has occurred. |
Sample query
Query the session-level statistics for tenant 1002 across all OBServer nodes in the sys tenant, and display the first 10 records.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$SESSTAT WHERE CON_ID=1002 LIMIT 10;
The query result is as follows:
+----------------------+--------+----------------+----------+------------+-------+
| SID | CON_ID | SVR_IP | SVR_PORT | STATISTIC# | VALUE |
+----------------------+--------+----------------+----------+------------+-------+
| -9223372036854727988 | 1002 | 11.xxx.xxx.xxx | 28825 | 0 | 0 |
| -9223372036854727988 | 1002 | 11.xxx.xxx.xxx | 28825 | 2 | 0 |
| -9223372036854727988 | 1002 | 11.xxx.xxx.xxx | 28825 | 129 | 0 |
| -9223372036854727988 | 1002 | 11.xxx.xxx.xxx | 28825 | 130 | 0 |
| -9223372036854727988 | 1002 | 11.xxx.xxx.xxx | 28825 | 161 | 0 |
| -9223372036854727988 | 1002 | 11.xxx.xxx.xxx | 28825 | 162 | 0 |
| -9223372036854727988 | 1002 | 11.xxx.xxx.xxx | 28825 | 163 | 0 |
| -9223372036854727988 | 1002 | 11.xxx.xxx.xxx | 28825 | 164 | 0 |
| -9223372036854727988 | 1002 | 11.xxx.xxx.xxx | 28825 | 165 | 0 |
| -9223372036854727988 | 1002 | 11.xxx.xxx.xxx | 28825 | 166 | 0 |
+----------------------+--------+----------------+----------+------------+-------+
10 rows in set
References
To view tenant-level statistics:
- For more information about statistics, see Common statistics.