GV$SESSTAT

2025-11-14 07:33:33  Updated

Note

This view is introduced since OceanBase Database V1.4.

Purpose

The GV$SESSTAT view displays the session-level statistical events on all OBserver nodes.

Columns

Column Type Nullable? Description
SID bigint(20) 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 = 2 is set, this field indicates the client session ID.
      • When client_session_id_version = 1, this field indicates the server session ID.
CON_ID bigint(20) NO The ID of the tenant.
SVR_IP varchar(46) NO The IP address of the OBServer node where the information is stored.
SVR_PORT bigint(20) NO The port number of the OBServer node where the information is stored.
STATISTICS# bigint(20) NO The subscript of the statistical event.
VALUE bigint(20) NO The number of times that the statistical event has happened.

Sample query

Query session-level statistical event information for all OBServer nodes.

obclient [oceanbase]> SELECT * FROM oceanbase.GV$SESSTAT LIMIT 1\G

The query result is as follows:

*************************** 1. row ***************************
       SID: 1152921504606863376
    CON_ID: 1002
    SVR_IP: xx.xx.xx.xx
  SVR_PORT: 2882
STATISTIC#: 0
     VALUE: 0

Contact Us