Jim Metcalf
asked on
sql 2012 login audits
I have a sql server with 80 databases.
management studio 2012 -> activity monitor -> Processes ->
under the drop down for database I only have about 10 db's listed. I am assuming that these are the ones that are active at the current time.
is there a way to run a log that will log all logins to all databases on the sql instance over a period of lets say a week?
I need this to figure out which db's are still in use and which ones are not.
if there is a better way to accomplish this - please advise.
thank you
management studio 2012 -> activity monitor -> Processes ->
under the drop down for database I only have about 10 db's listed. I am assuming that these are the ones that are active at the current time.
is there a way to run a log that will log all logins to all databases on the sql instance over a period of lets say a week?
I need this to figure out which db's are still in use and which ones are not.
if there is a better way to accomplish this - please advise.
thank you
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Nice.
ASKER
Hi Vitor. i ran the script in the link to the blog and it seemed to work well. in the output, if last_access = "null",
what could i infer from that? does that mean the last access was longer than a certain time parameter.?
the output has 2 columns (name, last_access)
if last access returned value = null...what should i infer from that? that it has never been accessed?
all the ones that returned a date/time are very recent... ie... within a day.
what could i infer from that? does that mean the last access was longer than a certain time parameter.?
the output has 2 columns (name, last_access)
if last access returned value = null...what should i infer from that? that it has never been accessed?
all the ones that returned a date/time are very recent... ie... within a day.
It only counts since last time the SQL Server started, so NULL means that no connection was made since last restart.
ASKER
Worked like a charm.