VT_SESSION and VS_SESSION monitor internal and external sessions. Both tables have the same set of columns. However:
Reviewers: please check the SQL data types in this table for accuracy.
Column Name |
Data Type |
Description |
TIMESTAMP |
DATE |
when the data in this table was generated |
NODE |
VARCHAR |
the node reporting the session state |
USERNAME |
VARCHAR |
the name used to log into the database or NULL if the session is internal |
CLIENT |
VARCHAR |
the host name and port of the TCP socket from which the client connection was made; NULL if the session is internal |
LOGIN_TIME |
DATE |
the date and time the user logged into the database or when the internal session was created. This can be useful for identifying sessions that have been left open for a period of time and may be idle. |
SESSIONID |
VARCHAR |
the identifier required to close or interrupt a session. This identifier is unique within the cluster at any point in time but can be reused when the session closes. |
TXN_START |
DATE |
the date/time the current transaction started or NULL if no transaction is running. |
TXNID |
INTEGER |
an identifier for the transaction within the session if any; otherwise NULL. |
TXN_DESCRIPTION |
VARCHAR |
a description of the current transaction |
STMT_START |
DATE |
the date/time the current statement started execution, or NULL if no statement is running. |
STMTID |
VARCHAR |
an ID for the currently executing statement. NULL indicates that no statement is currently being processed. |
STMT_DURATION |
INTEGER |
duration of the last statement in milliseconds. |
LAST_STATEMENT |
CHAR(4000 ) |
NULL if the user has just logged in; otherwise the currently running statement or the most recently completed statement. |
Notes
Examples
=> SELECT * FROM VT_SESSION;
-[ RECORD 1 ]-+-------------------------------------------
timestamp | 2008-02-15 19:24:03
node | site01
username | release
client | 10.10.50.123:41183
login_time | 2008-02-15 19:24:03
sessionid | qa01-2421:0x46409940
txn_start | 2008-02-15 19:24:36
txnid | 45035996273706429
txn_descript | user <unknown> (SELECT * FROM VT_SESSION;)
stmt_start |
stmtid | 45035998174734037
stmt_duration | 0
last_stmt | SELECT * FROM VT_SESSION;
=> SELECT * FROM VS_SESSION;
-[ RECORD 1 ]-+--------------------------------------------
timestamp | 2008-02-15 18:05:10
node | site01
username |
client |
login_time |
sessionid | qa01-2421:0x41401940
txn_start | 2008-02-15 18:05:11
txnid | 0
txn_descript | Unknown Txn: 0
stmt_start |
stmtid | 4294967295
stmt_duration | 0
last_stmt |
-[ RECORD 2 ]-+--------------------------------------------
timestamp | 2008-02-15 18:05:10
node | site01
username |
client |
login_time |
sessionid | qa01-2421:0x42803940
txn_start | 2008-02-15 18:05:10
txnid | 0
txn_descript | Unknown Txn: 0
stmt_start |
stmtid | 4294967295
stmt_duration | 0
last_stmt |
-[ RECORD 3 ]-+--------------------------------------------
timestamp | 2008-02-15 19:24:03
node | site01
username | release
client | 10.10.50.123:41183
login_time | 2008-02-15 19:24:03
sessionid | qa01-2421:0x46409940
txn_start | 2008-02-15 19:24:36
txnid | 45035996273706429
txn_descript | user <unknown> (SELECT * FROM VS_SESSION;)
stmt_start |
stmtid | 45035998174734037
stmt_duration | 0
last_stmt | SELECT * FROM VS_SESSION;
-[ RECORD 4 ]-+--------------------------------------------
timestamp | 2008-02-15 18:05:10
node | site02
username |
client |
login_time |
sessionid | qa02-540:0x41401940
txn_start | 2008-02-15 18:05:10
txnid | 0
txn_descript | Unknown Txn: 0
stmt_start |
stmtid | 4294967295
stmt_duration | 0
last_stmt |
-[ RECORD 5 ]-+--------------------------------------------
timestamp | 2008-02-15 18:05:10
node | site02
username |
client |
login_time |
sessionid | qa02-540:0x43204940
txn_start | 2008-02-15 18:05:10
txnid | 0
txn_descript | Unknown Txn: 0
stmt_start |
stmtid | 4294967295
stmt_duration | 0
last_stmt |
-[ RECORD 6 ]-+--------------------------------------------
timestamp | 2008-02-15 19:24:36
node | site02
username |
client |
login_time |
sessionid | qa01-2421:0x46409940
txn_start | 2008-02-15 19:24:36
txnid | 45035996273706429
txn_descript | user <unknown> (SELECT * FROM VT_SESSIONS;)
stmt_start |
stmtid | 45035998174734037
stmt_duration | 0
last_stmt |
and so forth.