Skip to main content

audit user login and activity

  • February 1, 2018
  • 1 reply
  • 5 views

sreeblr
Forum|alt.badge.img+2

Can we check complete list of all user logins and activity performed ?

1 reply

Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • February 1, 2018

Check out the USER_SESSIONS system table. It returns user session history on the system.

See:
https://my.vertica.com/docs/9.0.x/HTML/index.htm#Authoring/SQLReferenceManual/SystemTables/MONITOR/USER_SESSIONS.htm

And the QUERY_REQUESTS system table. It returns information about user-issued query requests.

https://my.vertica.com/docs/9.0.x/HTML/index.htm#Authoring/SQLReferenceManual/SystemTables/MONITOR/QUERY_REQUESTS.htm

You can create a job that populates a USER_AUDIT log table periodically using data from the tables above... This way you can keep a complete history.

Example SQL to insert data:

insert into USER_AUDIT
    select us.node_name, us.user_name, us.session_start_timestamp, us.session_id, us.transaction_id, us.statement_id, qr.start_timestamp, qr.request
      from user_sessions us
      join query_requests qr
        on qr.session_id = us.session_id
    order by us.user_name, us.session_start_timestamp desc, qr.start_timestamp;

Note that there is also a data collector table named DC_REQUESTS_ISSUED
that keeps a history of all SQL requests issued (but the data in there is limited by either time or size).