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