Note
This view is available starting with V4.3.0.
Purpose
The V$OB_SESSION view records session information created in the current server.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| ID | NUMBER(38) | NO | For V4.3.x versions:
|
| USER | CHAR(193) | NO | The user to whom the session belongs. |
| TENANT | VARCHAR2(128) | NO | The name of the tenant accessed by the session. |
| HOST | VARCHAR2(128) | NO | The IP address and port number of the client that initiated the session. If the database is connected through ODP, this field shows the IP address and port number of ODP. |
| DB | VARCHAR2(128) | YES | The name of the database to which the session is currently connected. |
| COMMAND | VARCHAR2(4096) | NO | The command being executed by the session. |
| SQL_ID | VARCHAR2(32) | NO | The SQL ID. |
| TIME | NUMBER(38) | NO | The time when the current command is executed, in seconds. If the command is retried, this field is reset to zero. |
| STATE | VARCHAR2(128) | YES | The current state of the session. |
| INFO | VARCHAR2(262143) | YES | The statement being executed by the session. |
| SVR_IP | VARCHAR2(46) | NO | The IP address of the server. |
| SVR_PORT | NUMBER(38) | NO | The RPC port number of the server. |
| SQL_PORT | NUMBER(38) | NO | The SQL port number of the server. |
| PROXY_SESSID | NUMBER(38) | YES | If the current client is ODP, this field shows the session ID of ODP. |
| USER_CLIENT_IP | VARCHAR2(46) | YES | The IP address of the user client. |
| USER_HOST | VARCHAR2(128) | YES | The hostname of the user client. |
| TRANS_ID | NUMBER(38) | NO | The transaction ID. |
| THREAD_ID | NUMBER(38) | NO | The thread ID. |
| TRACE_ID | VARCHAR2(64) | YES | The trace ID. |
| REF_COUNT | NUMBER(38) | NO | The connection reference count. |
| BACKTRACE | VARCHAR2(16384) | YES | The connection reference call stack. |
| TRANS_STATE | VARCHAR2(32) | YES | The transaction state (empty if no transaction exists on the session):
|
| USER_CLIENT_PORT | NUMBER(38) | NO | The port number of the user client.
NoteFor V4.4.x versions, this field is available starting with V4.4.0. |
| TOTAL_CPU_TIME | NUMBER(38) | NO | The CPU usage time for the current command, in seconds |
Sample query
Query session information created in all servers.
obclient [SYS]> SELECT * FROM SYS.V$OB_SESSION WHERE ROWNUM <= 1\G
The query result is as follows:
*************************** 1. row ***************************
ID: 3221487694
USER: SYS
TENANT: oracle001
HOST: xx.xx.xx.xx:46156
DB: SYS
COMMAND: Query
SQL_ID: EEB077450268C07286E668791886DBA2
TIME: 0
STATE: ACTIVE
INFO: SELECT * FROM SYS.V$OB_SESSION WHERE ROWNUM <= 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: 20625
TRACE_ID: YXXXXXXXXXXX-000XXXXXXXXXXX-0-0
REF_COUNT: 0
BACKTRACE: NULL
TRANS_STATE: NULL
TOTAL_CPU_TIME: 0
1 row in set (0.004 sec)