Note
This view is available starting with V1.4.
Purpose
This view displays session-level statistical events for the current tenant across all OBServer nodes. Here, STATISTIC# indicates the statistical item number, which can be queried from the V$STATNAME view to obtain the corresponding statistical item name and its meaning.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| SID | bigint(20) | NO | For V4.2.x:
|
| CON_ID | bigint(20) | NO | Tenant ID |
| SVR_IP | varchar(46) | NO | IP address of the server where the information is located |
| SVR_PORT | bigint(20) | NO | Port number of the server where the information is located |
| STATISTICS# | bigint(20) | NO | Index of the statistical event |
| VALUE | bigint(20) | NO | Number of times the statistical event occurred |
Sample query
Query session-level statistical events for the current tenant across all OBServer nodes, and display the first 10 records.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$SESSTAT 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 statistical events:
- For more information about statistical events, see Common statistical events.