List sessions / active connections in Vertica database

Vertica table contains a lot of useful information about database sessions.

Query

select session_id
       node_name,
       user_name,
       client_hostname,
       login_timestamp,
       statement_start,
       current_statement,
       last_statement,
       client_type,
       client_os
from v_monitor.sessions
order by user_name;

Columns

  • session_id - ID of this backend
  • node_name -
  • user_name - name of the user logged into this backend
  • client_hostname - IP address with port number of the client connected to this backend
  • login_timestamp - time the client connected to the server.
  • statement_start - time when current statement executing begins
  • current_statement - current executing statement
  • last_statement - last statement
  • client_type - type of client from which the connection was made
    • ADO.NET Driver
    • ODBC Driver
    • JDBC Driver
    • vsql
  • client_os - operating system on which client is running

Rows

  • One row: represents one active connection
  • Scope of rows: all active connections
  • Ordered by username

Sample results

sample results

0
There are no comments. Click here to write the first comment.