Note
This view is available starting with V1.4.
Purpose
This view displays the session-level statistics of each tenant on the current OBServer node. In this view, STATISTIC# indicates the index of the statistics. You can query the V$STATNAME view to obtain the name and description of the statistics corresponding to the STATISTIC# index.
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 statistics. |
| VALUE | bigint(20) | NO | The number of times the statistics event occurs. |
Sample query
In the sys tenant, query the session-level statistics of tenant 1002 on the current OBServer node, and display the first 10 records.
obclient [oceanbase]> SELECT * FROM oceanbase.V$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 query the session-level statistics of a tenant:
- For more information about statistics, see Common statistics events.