Tuesday, February 14, 2012

Database last used?

Is there a way to check how long since a database has been last used?
I have a database which I believe is redundant but I want to be sure before
dropping it.
ThanksSQL Server does not keep such information. You might be able to see when dat
a was last modified in
the database by looking at file modified date etc. An option might be to set
the database to
read-only, restricted user, offline etc and listen for screams...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Anceladux" <Anceladux@.discussions.microsoft.com> wrote in message
news:F56F4735-DF9D-41A8-84CB-C48E600897BB@.microsoft.com...
> Is there a way to check how long since a database has been last used?
> I have a database which I believe is redundant but I want to be sure befor
e
> dropping it.
> Thanks
>|||Thanks for your help Tibor
"Anceladux" wrote:

> Is there a way to check how long since a database has been last used?
> I have a database which I believe is redundant but I want to be sure befor
e
> dropping it.
> Thanks
>|||Unfortunately, there's no easy way to do this.
I created a job that runs hourly and polls the sysprocesses virtual table
to see who's connected to what. I then write this info to a table I've
created.
"Anceladux" <Anceladux@.discussions.microsoft.com> wrote in message
news:F56F4735-DF9D-41A8-84CB-C48E600897BB@.microsoft.com...
> Is there a way to check how long since a database has been last used?
> I have a database which I believe is redundant but I want to be sure
before
> dropping it.
> Thanks
>|||Anceladux,
Perhaps run profiler on the server for a few days, see if anyone logs
into it.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Anceladux wrote:
> Is there a way to check how long since a database has been last used?
> I have a database which I believe is redundant but I want to be sure befor
e
> dropping it.
> Thanks
>|||How about enabling AUTO_CLOSE with ALTER DATABASE. This will release all
resources held by the DB. If anybody tries to access the DB it will open it
causing them no disruption. SQL Errorlog will contain messages whenever the
DB is opened.
"Anceladux" <Anceladux@.discussions.microsoft.com> wrote in message
news:F56F4735-DF9D-41A8-84CB-C48E600897BB@.microsoft.com...
> Is there a way to check how long since a database has been last used?
> I have a database which I believe is redundant but I want to be sure
> before
> dropping it.
> Thanks
>|||Keep in mind that with autoclose, every time you try to access the database
any queries
issued will be bogged down by the amount of time it takes to open the
database
"Stringfellow Hawke" <Stringfellow.Hawke-PleaseNoSpam@.gmail.com.nospam>
wrote in message news:O9MwrScwEHA.3376@.TK2MSFTNGP12.phx.gbl...
> How about enabling AUTO_CLOSE with ALTER DATABASE. This will release all
> resources held by the DB. If anybody tries to access the DB it will open
it
> causing them no disruption. SQL Errorlog will contain messages whenever
the
> DB is opened.
> "Anceladux" <Anceladux@.discussions.microsoft.com> wrote in message
> news:F56F4735-DF9D-41A8-84CB-C48E600897BB@.microsoft.com...
>

No comments:

Post a Comment