Skip navigation
7698 Views 1 Reply Latest reply: Aug 20, 2010 8:41 PM by Shawn Fox RSS
bichonfrise74 New Enzee 9 posts since
Sep 4, 2008
Currently Being Moderated

Aug 20, 2010 3:04 PM

How to Know When a User Last Login?

I was asked this question and I was not sure how to answer it. I checked the /nz/kit/logs/postgres/*.log for the specific user but since the logs are not being kept forever, then the user might not be in the logs anymore. Then I tried to look at the user in the NZ_QUERY_HISTORY_VIEW and found the user. To me, going through this route seems a waste of time, so I am wondering if there is a system table that would show me when a user last login or even when the user was created?

  • Shawn Fox Enzee Exraordinaire 1,326 posts since
    Aug 15, 2006
    Currently Being Moderated
    1. Aug 20, 2010 8:41 PM (in response to bichonfrise74)
    Re: How to Know When a User Last Login?

    _v_user does have the user create date in it, but not the last time the user logged in.

     

    The query history database has all that login and query history in it, but of course you have to turn it on.  See the section in the Netezza admin guide regarding query history collection.  The $hist_session_prolog_$SCHEMA_VERSION table records information regarding every login and $hist_session_epilog_$SCHEMA_VERSION has information for every disconnection.  Other tables store the queries ran, the tables and columns accessed by each query, etc.  It is quite comprehensive.

     

    I believe the query history database is available on 4.6 and definitely on 5.0

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points