Note
This view is available starting with V4.3.0.
Purpose
The GV$OB_SESSION view records session information created on all servers.
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 to which the session belongs. |
| 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 column indicates the IP address and port number of the 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 taken to execute the current command, in seconds. If the command is retried, this value is reset to zero and recalculated. |
| 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 column indicates 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 is associated with the session):
|
| USER_CLIENT_PORT | NUMBER(38) | NO | The port number of the user client
NoteFor V4.4.x versions, this column is available starting with V4.4.0. |
| TOTAL_CPU_TIME | NUMBER(38) | NO | The CPU time consumed to execute the current command, in seconds |
Sample query
Query the session information created on all servers.
obclient [SYS]> SELECT * FROM SYS.GV$OB_SESSION WHERE ROWNUM <= 1\G
The query result is as follows:
*************************** 1. row ***************************
ID: 3221539962
USER: SYS
TENANT: oracle001
HOST: 100.xx.xxx.xxx:51828
DB: SYS
COMMAND: Query
SQL_ID: EEB077450268C07286E668791886DBA2
TIME: 0
STATE: ACTIVE
INFO: SELECT * FROM SYS.GV$OB_SESSION WHERE ROWNUM <= 1
SVR_IP: 172.xx.xxx.xxx
SVR_PORT: 2882
SQL_PORT: 2881
PROXY_SESSID: NULL
USER_CLIENT_IP: 100.xx.xxx.xxx
USER_HOST: %
TRANS_ID: 0
THREAD_ID: 109892
TRACE_ID: YB4xxxxxxxx-xxxxxxxxx-0-0
REF_COUNT: 0
BACKTRACE: NULL
TRANS_STATE: NULL
USER_CLIENT_PORT: 51828
TOTAL_CPU_TIME: 0
1 row in set