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 remote procedure call (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 transaction ID. |
| THREAD_ID | bigint(20) unsigned | NO | The thread ID. |
| 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 transaction status. |
| TOTAL_CPU_TIME | BIGINT(21) | NO | The CPU time spent on executing the current statement, in seconds. |
Sample query
obclient [oceanbase]> SELECT * FROM oceanbase.V$OB_SESSION limit 2;