Note
This view is introduced since OceanBase Database V1.4.
Purpose
The GV$SESSTAT view displays the session-level statistics on all OBServer nodes.
Note that STATISTIC# indicates the number of a statistical item. You can query the V$STATNAME view for the name and description of a statistical item based on its number.
Columns
| Column | Type | Nullable? | Description | | SID | NUMBER | NO | For V4.3.x:
- Before V4.3.5 BP2:
In all connection modes (direct mode/ODP mode), this field indicates the server session ID. - V4.3.5 BP2 and later versions:
- In direct mode:
This field indicates the server session ID. - In ODP mode:
- When the ODP parameter
client_session_id_version = 2is set, this field indicates the client session ID. - When
client_session_id_version = 1, this field indicates the server session ID.
- When the ODP parameter
- In direct mode:
Sample query
Query session-level statistics on all servers.
obclient [SYS]> SELECT * FROM SYS.GV$SESSTAT WHERE ROWNUM =1\G
The query result is as follows:
*************************** 1. row ***************************
SID: 1152921504606867748
CON_ID: 1004
SVR_IP: xx.xx.xx.xx
SVR_PORT: 2882
STATISTIC#: 0
VALUE: 0