Sunday, March 25, 2012

Check last access/update date on each database

I need to check the date of the last update on each database on some
servers.
If the last update is many months ago, I'll need at least stop SQL Services.
How is the best was to do it?
Thanks folks!!!
Carlos Felipe Frana da FonsecaHi,
SQL Server will not keep track of these info by itself. Only way is to
verify the modifiedon column in your table. If you do not have modified on
column
then you may need to setup a profiler trace and based on the log you need to
go further.
Thanks
Hari
SQL Server MVP
"Carlos Felipe Frana da Fonseca" <carlos@.felipe.com.br> wrote in message
news:%23B0kfB52GHA.2196@.TK2MSFTNGP06.phx.gbl...
>I need to check the date of the last update on each database on some
>servers.
> If the last update is many months ago, I'll need at least stop SQL
> Services.
> How is the best was to do it?
> Thanks folks!!!
> Carlos Felipe Frana da Fonseca
>|||Hello,
Alternative way is look into sysprocesses table in each server .
For SPID > 50 look for last_batch . Check the date and time .
Note this will provide database accessed time and not updated time .
You have to look into all user databases for last_batch before
stopping the service .
M A Srinivas
Carlos Felipe Fran=E7a da Fonseca wrote:
> I need to check the date of the last update on each database on some
> servers.
> If the last update is many months ago, I'll need at least stop SQL Servic=
es.
> How is the best was to do it?
>=20
> Thanks folks!!!
>=20
> Carlos Felipe Fran=E7a da Fonseca

No comments:

Post a Comment