Note
This view is introduced since OceanBase Database V1.4.
Purpose
This view displays the statistics of each tenant on the current OBServer node.
where:
*STATISTIC#: the statistic number. This number may vary across versions of the OBServer node.
STAT_ID: the ID of the statistic. The ID of each statistic is the same across OBServer node versions.
Note
To query statistics from this view, you must enable monitoring by setting the enable_perf_event parameter to True.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| 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 |
| STATISTIC# | bigint(20) | NO | Index of the statistics event |
| NAME | varchar(64) | NO | Name of the statistics event |
| CLASS | bigint(20) | NO | Type of the statistics event |
| VALUE | bigint(20) | NO | Result value of the statistics event |
| VALUE_TYPE | varchar(16) | NO | Statistics value type: |
| STAT_ID | bigint(20) | NO | Statistics event ID |
Sample query
In the sys tenant, view the statistics events of all tenants on the current node and display the first 10 records.
obclient [oceanbase]> SELECT * FROM oceanbase.V$SYSSTAT LIMIT 10;
The query result is as follows:
+--------+----------------+----------+------------+-----------------------+-------+-------------+------------+---------+
| CON_ID | SVR_IP | SVR_PORT | STATISTIC# | NAME | CLASS | VALUE | VALUE_TYPE | STAT_ID |
+--------+----------------+----------+------------+-----------------------+-------+-------------+------------+---------+
| 1 | 11.xxx.xxx.xxx | 28825 | 0 | rpc packet in | 1 | 60000651 | ADD_VALUE | 10000 |
| 1 | 11.xxx.xxx.xxx | 28825 | 1 | rpc packet in bytes | 1 | 14857436223 | ADD_VALUE | 10001 |
| 1 | 11.xxx.xxx.xxx | 28825 | 2 | rpc packet out | 1 | 13331823 | ADD_VALUE | 10002 |
| 1 | 11.xxx.xxx.xxx | 28825 | 3 | rpc packet out bytes | 1 | 4602803985 | ADD_VALUE | 10003 |
| 1 | 11.xxx.xxx.xxx | 28825 | 4 | rpc deliver fail | 1 | 0 | ADD_VALUE | 10004 |
| 1 | 11.xxx.xxx.xxx | 28825 | 5 | rpc net delay | 1 | 465112463 | ADD_VALUE | 10005 |
| 1 | 11.xxx.xxx.xxx | 28825 | 6 | rpc net frame delay | 1 | 1564592 | ADD_VALUE | 10006 |
| 1 | 11.xxx.xxx.xxx | 28825 | 7 | mysql packet in | 1 | 530 | ADD_VALUE | 10007 |
| 1 | 11.xxx.xxx.xxx | 28825 | 8 | mysql packet in bytes | 1 | 63960 | ADD_VALUE | 10008 |
| 1 | 11.xxx.xxx.xxx | 28825 | 9 | mysql packet out | 1 | 1223369 | ADD_VALUE | 10009 |
+--------+----------------+----------+------------+-----------------------+-------+-------------+------------+---------+
10 rows in set
References
View statistics events at the session level:
View the definitions of all statistics events of a tenant: V$STATNAME
For more information about statistics events, see Common statistical events.