[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 574
  • Last Modified:

How to track the last time user accessed database

Hi All,

Just a small doubt,. Could you please let me know if there is any way to find out the last time a user has entered (logged)  into the database? I am working on sybase 12.5 ASE
I checked syslogins and few other tables but couldn't get any relevant information from there. Our database is not tracking this date currently.
0
arundintyala
Asked:
arundintyala
  • 2
2 Solutions
 
bretCommented:
There are a couple of ways to do it, but nothing automatically track this.

You can set up auditing and audit logins.  That was the traditional solution, but is a bit much if that is all you want to audit.

You can also create a login trigger that updates a table every time someone logs in.

0
 
arundintyalaAuthor Commented:
Hi  Bret,

thanks for the reply
This login trigger would update the records from now if I write one. but is there any way to track the existing user logins.

0
 
Joe WoodhousePrincipal ConsultantCommented:
I'm pretty sure there is no way to get this retroactively if nothing was set up in advance to capture it.

It's exactly the same as setting up a video camera outside your front door - it can't tell you anything about what happened before you installed it.

We should also be clear on the difference between logging it to Sybase (connecting to the ASE) and using a database. They aren't the same thing, and you would need very different solutions to be able to see one set of data vs the other. (They may actually effectively be the same thing when a login has had a default database defined, but even so internally the process of connecting to the Sybase server is still not the same thing as connecting to a database within a Sybase server.)
0
 
arundintyalaAuthor Commented:
hi all thanks a lot for the replies.. looks like i will write one trigger now atleast to track this down from now
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now