determine db last access date?
Is there a way to tell the last time a database was accessed?
Leave a comment...
- 4 Comments
- You can determine the last time a user logged into the SQL server, but I
don't know of any out of the box way to determine last DB access time.
"jason" <jason.sqlserver.questionfor.info.discussions.microsoft.com> wrote in message
> Is there a way to tell the last time a database was accessed?#1; Sun, 25 May 2008 14:37:00 GMT
- I refer to SQL2000 - can't comment on 2005!
"Immy" <therealasianbabe.sqlserver.questionfor.info.hotmail.com> wrote in message
> You can determine the last time a user logged into the SQL server, but I
> don't know of any out of the box way to determine last DB access time.
> "jason" <jason.sqlserver.questionfor.info.discussions.microsoft.com> wrote in message
>#2; Sun, 25 May 2008 14:38:00 GMT
- If you haven't put in something to specifically track that (e.g. using SQL
trace), the answer is no.
> Is there a way to tell the last time a database was accessed?#3; Sun, 25 May 2008 14:39:00 GMT
- Hello Jason,
I agree with Linchi that if you did n't configure track on the database, we
cannot determine the last access time since this informaiton is not saved
You may want to take a look at BOL for some explanations as well as
There is one column "databaseid" that you could add in profiler so that you
could get databaseid information of each event. You could get the name of
database from id by using:
select name from master..sysdatabases where dbid = <databaseid>
I understand it shall be convenient to store this information, and I will
forward your feedback to the product team. In the meantime, I also
encourage you submit via the link below since they'd like to hear your
If you have further questions on the issue, please feel free to let's know.
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
Get notification to my posts through email? Please refer to
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
This posting is provided "AS IS" with no warranties, and confers no rights.#4; Sun, 25 May 2008 14:41:00 GMT