Sql-server – Check all login users list from back 3 months

auditsql server

There is any way to check all database login users list and their activities from back 3 months in SQL Server?

I tried with SQL server Logs but I need more info about user activities from past 3 months. Can we get those users list? I didn't capture any data 3 months ago.

We are facing some DB status restoring mode for some reason, so we need to capture details of users at the time who login to server.

Best Answer

Unless you set up something (Server side trace, Profiler trace, Extended event trace, Security audit, Modify SQL Error log retention) and retain that information you will not find what you are looking for.

Based on the comments, I assume what you are looking for will be in the default trace. But unfortunately SQL Server only keeps 5 files, each 20MB. It is a fixed size buffer meaning older events get deleted.

This is a great resource to learn about default trace:

https://www.simple-talk.com/sql/performance/the-default-trace-in-sql-server-the-power-of-performance-and-security-auditing/

Starting SQL 2008 Extended event health session is running continuously unless someone turn it off.

SQL error log keeps a good deal of information. Again by default keep current and 6 older files. If you do not recycle error log and did not restart more than 6 times you might still get some information from there.

This answer by Aaron Bertrand go in details about what information is collected in these default collections.

If you need anything more than these you can always set up your own trace/audit.