V$OB_SESSION

2024-06-28 05:30:30  Updated

Note

This view is introduced since OceanBase Database V4.3.0.

Purpose

The V$OB_SESSION view displays information about sessions created on the current OBServer node.

Columns

Column Type Nullable? Description
ID bigint(20) unsigned NO The ID of the session.
USER varchar(32) NO The user to which the session belongs.
TENANT varchar(128) NO The name of the tenant accessed.
HOST varchar(128) NO The IP address and port number of the client that initiated the session. If OceanBase Database Proxy (ODP) was used to connect to the database, the value indicates the host IP address and port number of ODP.
DB varchar(128) NO The name of the database to which the session connects.
COMMAND varchar(4096) NO The type of the statement being executed in the session.
SQL_ID varchar(32) NO The ID of the SQL statement.
TIME bigint(21) NO The execution time of the current statement, in seconds. If a retry occurs, the value is cleared and recalculated.
STATE varchar(128) NO The current status of the session.
INFO varchar(262143) NO The statement being executed in the session.
SVR_IP varchar(46) NO The IP address of the OBServer node.
SVR_PORT bigint(20) NO The RPC port number of the OBServer node.
SQL_PORT bigint(20) NO The SQL port number of the OBServer node.
PROXY_SESSID bigint(20) unsigned NO The session ID of ODP, if ODP is used for connection.
USER_CLIENT_IP varchar(46) NO The IP address of the user client.
USER_HOST varchar(128) NO The hostname of the user client.
TRANS_ID bigint(20) unsigned NO The ID of the transaction.
THREAD_ID bigint(20) unsigned NO The ID of the thread.
TRACE_ID varchar(64) NO The trace ID.
REF_COUNT bigint(20) NO The reference count of the connection.
BACKTRACE varchar(16384) NO The call stack for connection references.
TRANS_STATE varchar(32) NO The status of the transaction.
TOTAL_CPU_TIME bigint(21) NO The CPU time spent on executing the current statement, in seconds.

Sample query

Query information about sessions created on the current OBServer node.

obclient [oceanbase]> SELECT * FROM oceanbase.V$OB_SESSION limit 1\G

The query result is as follows:

*************************** 1. row ***************************
            ID: 3221487691
          USER: root
        TENANT: sys
          HOST: xx.xx.xx.xx:49978
            DB: oceanbase
       COMMAND: Query
        SQL_ID: 802A391F73FB7B28ABEA6757DACFE1EC
          TIME: 0
         STATE: ACTIVE
          INFO: SELECT * FROM oceanbase.V$OB_SESSION limit 1
        SVR_IP: xx.xx.xx.xx
      SVR_PORT: 2882
      SQL_PORT: 2881
  PROXY_SESSID: NULL
USER_CLIENT_IP: xx.xx.xx.xx
     USER_HOST: %
      TRANS_ID: 0
     THREAD_ID: 19932
      TRACE_ID: YXXXXXXXXXXX-000XXXXXXXXXXX-0-0
     REF_COUNT: 0
     BACKTRACE:
   TRANS_STATE:
TOTAL_CPU_TIME: 0

References

GV$OB_SESSION

Contact Us