KI_SESSIONS
Argument | Enumeration | Purpose |
---|---|---|
handle | Handle | |
nConnectId | ConnectId of required session | |
status | KDB_ERROR_ENUM | Return status |
KI_SESSIONS
This function generates a result set containing rows from the Oracle SYS.K$SESSIONS view which contains details of all the connected Oracle sessions. For Oracle this is a dynamic view of the SYS.GV$SESSION table that is maintained by the database. If the database is distributed across a RAC cluster then the all the sessions on all nodes are included.
On other SQL databases it is a real table that KCML maintains. Entries are inserted by KI_CONNECT and removed by KI_DISCONNECT so there is the possibility of stale entries being left behind if a process dies abnormally.
This function is not supported on native KDB7 databases.
The handle must have been allocated with a KI_ALLOC_HANDLE and it can be used in subsequent KI_FETCH calls to get the information. When finished with the virtual table a KI_END will free resources.
The row buffer passed for the fetch operation should be an instance of the _KDB_SESSIONS record. If the optional connection identifier ConnectId is non-zero then only the row matching that ConnectId will be returned in the result set. The connection identifier for your process can be found from the INFO_CONN_ConnectId field returned by KI_INFO. You can use -1 as a shortcut for your connection id.
KI_LOCK_OWNER returns the connection id of the process that blocked a failed attempt to lock a row and you can use that id in KI_SESSIONS to get more information about that process.
Compatibility note:
KI_SESSIONS is only available for SQL databases