Friday, February 17, 2012

DB Last Access Times

Hi All,
Would it be safe to use the last modified date of a .MDF file within Windows
Explorer to view the last time anyone utilised a database? I'm trying to
clear unused DB's from a server and am wondering if this is a reliable
method of finding unused data?
Many thanks in advance,
Orb.Hi
I'd run SQL Server Profiler to collect the info per database and then make
a conclusions. BTW , what version are you using?
"Orbital" <sian.clarke@.newhamhealth.nhs.uk> wrote in message
news:O60yZ6IXGHA.4148@.TK2MSFTNGP03.phx.gbl...
> Hi All,
> Would it be safe to use the last modified date of a .MDF file within
> Windows Explorer to view the last time anyone utilised a database? I'm
> trying to clear unused DB's from a server and am wondering if this is a
> reliable method of finding unused data?
>
> Many thanks in advance,
> Orb.
>|||Hi Uri,
Thanks for your rapid response!
I'm on SQL2000 right now.
The SQL Server Profiler you mention, is this an MS tool? If you would
kindly point me to any documentation/ resources I'd be really grateful!
Many Thanks in advance,
Orb.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:ePtdY8IXGHA.2356@.TK2MSFTNGP03.phx.gbl...
> Hi
> I'd run SQL Server Profiler to collect the info per database and then
> make a conclusions. BTW , what version are you using?
>
>
> "Orbital" <sian.clarke@.newhamhealth.nhs.uk> wrote in message
> news:O60yZ6IXGHA.4148@.TK2MSFTNGP03.phx.gbl...
>|||> The SQL Server Profiler you mention, is this an MS tool?
Yes ,it is

> kindly point me to any documentation/ resources I'd be really grateful!
Actually , take a look at BOL for some explanations as well as visiting at
http://www.sql-server-performance.c...ofiler_tips.asp
"Orbital" <sian.clarke@.newhamhealth.nhs.uk> wrote in message
news:ecJRPAJXGHA.3760@.TK2MSFTNGP02.phx.gbl...
> Hi Uri,
> Thanks for your rapid response!
> I'm on SQL2000 right now.
> The SQL Server Profiler you mention, is this an MS tool? If you would
> kindly point me to any documentation/ resources I'd be really grateful!
>
> Many Thanks in advance,
> Orb.
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:ePtdY8IXGHA.2356@.TK2MSFTNGP03.phx.gbl...
>|||"Orbital" <sian.clarke@.newhamhealth.nhs.uk> wrote in message
news:O60yZ6IXGHA.4148@.TK2MSFTNGP03.phx.gbl...
> Hi All,
> Would it be safe to use the last modified date of a .MDF file within
Windows
> Explorer to view the last time anyone utilised a database? I'm trying to
> clear unused DB's from a server and am wondering if this is a reliable
> method of finding unused data?
No, absolutely not.
In general the last modified date only shows the last time the server
started up or shut down or the size changed.
While in use, it generally doesn't change.
Now, you can try renaming the file, and it will fail if in use, but that's
not an entirely safe way to do things.

>
> Many thanks in advance,
> Orb.
>|||Uri,
This is superb, thanks for making me aware of this utility.
Many Thanks,
Orb.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23dgh4OJXGHA.4924@.TK2MSFTNGP05.phx.gbl...
> Yes ,it is
>
> Actually , take a look at BOL for some explanations as well as visiting
> at
> http://www.sql-server-performance.c...ofiler_tips.asp
>
>
>
> "Orbital" <sian.clarke@.newhamhealth.nhs.uk> wrote in message
> news:ecJRPAJXGHA.3760@.TK2MSFTNGP02.phx.gbl...
>|||Hello Orbital,
I had exactly the same issue -- multiple databases and many of them
suspected of no usage.
I use Profiler, and monitor locks on the suspected databases. The idea behid
this is actually every access to Db is some kind of lock.
"Greg D. Moore (Strider)" wrote:

> "Orbital" <sian.clarke@.newhamhealth.nhs.uk> wrote in message
> news:O60yZ6IXGHA.4148@.TK2MSFTNGP03.phx.gbl...
> Windows
> No, absolutely not.
> In general the last modified date only shows the last time the server
> started up or shut down or the size changed.
> While in use, it generally doesn't change.
> Now, you can try renaming the file, and it will fail if in use, but that's
> not an entirely safe way to do things.
>
>
>|||Thanks for your reply Strider. I've had a go at renaming what look to be
old databases - I think October 2003 datestamps should be safe!- and will
reinstate if anyone screams!
Thanks for you help,
Orb.
"Greg D. Moore (Strider)" <mooregr_deleteth1s@.greenms.com> wrote in message
news:%23p9L0iJXGHA.1192@.TK2MSFTNGP03.phx.gbl...
> "Orbital" <sian.clarke@.newhamhealth.nhs.uk> wrote in message
> news:O60yZ6IXGHA.4148@.TK2MSFTNGP03.phx.gbl...
> Windows
> No, absolutely not.
> In general the last modified date only shows the last time the server
> started up or shut down or the size changed.
> While in use, it generally doesn't change.
> Now, you can try renaming the file, and it will fail if in use, but that's
> not an entirely safe way to do things.
>
>|||Hi Gary,
Thanks for your reply. I've just ran a quick trace and this is just what
I'm looking for!. My only problem now is relating the DatabaseID to the
actual DB I see in my SQL Enterprise Manager, as the DatabaseName column
somehow remains empty? Does anyone know how I match the two together?
Many Thanks,
Orb.
"Gary" <Gary@.discussions.microsoft.com> wrote in message
news:EDF55C4E-9EDE-4D7E-86E2-8BFCD26806AE@.microsoft.com...[vbcol=seagreen]
> Hello Orbital,
> I had exactly the same issue -- multiple databases and many of them
> suspected of no usage.
> I use Profiler, and monitor locks on the suspected databases. The idea
> behid
> this is actually every access to Db is some kind of lock.
> "Greg D. Moore (Strider)" wrote:
>|||select name from master..sysdatabases where dbid = '
HTH. Ryan
"Orbital" <sian.clarke@.newhamhealth.nhs.uk> wrote in message
news:uicVQbKXGHA.5096@.TK2MSFTNGP03.phx.gbl...
> Hi Gary,
> Thanks for your reply. I've just ran a quick trace and this is just what
> I'm looking for!. My only problem now is relating the DatabaseID to the
> actual DB I see in my SQL Enterprise Manager, as the DatabaseName column
> somehow remains empty? Does anyone know how I match the two together?
>
> Many Thanks,
> Orb.
> "Gary" <Gary@.discussions.microsoft.com> wrote in message
> news:EDF55C4E-9EDE-4D7E-86E2-8BFCD26806AE@.microsoft.com...
>

No comments:

Post a Comment