Sunday, March 25, 2012

Determine database no longer in use

I've got a server with 36 databases which may or may not
be in use any longer. I spent yesterday running SQL
Profiler on that server but the trace doesn't capture the
database in use (or if it does, it doesn't give me the
option of displaying the database).
Does anyone have a relatively painless way (without
affecting performance, if possible) of capturing any
access to any of these databases, so I know whether or not
I can drop the database?
Thanks.
AllenIf you are saving the Profiler trace to a DB table and you only have the
database ID to go on then use DB_NAME(database ID) to get the name.
--
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Allen White" <awhite@.advanstar.com> wrote in message
news:0c1b01c37222$8ca69dd0$a301280a@.phx.gbl...
> I've got a server with 36 databases which may or may not
> be in use any longer. I spent yesterday running SQL
> Profiler on that server but the trace doesn't capture the
> database in use (or if it does, it doesn't give me the
> option of displaying the database).
> Does anyone have a relatively painless way (without
> affecting performance, if possible) of capturing any
> access to any of these databases, so I know whether or not
> I can drop the database?
> Thanks.
> Allen|||Apparently I wasn't very clear. I have 36 databases which
I'm not sure are still in use at all. I was hoping that
someone could tell me a way I could determine if the
database was accessed at any time within the last couple
of weeks or any time in the next couple of weeks, without
relying on luck for me to 'catch' it via sp_who, or
capturing megabytes worth of data using the profiler, just
to see if the database was used.
Does anyone know a way to trigger something so that if any
one of these databases is accessed I can find out which
one? Something like creating an alert that fires when the
database is used.
Any assistance is greatly appreciated!
Allen
>--Original Message--
>I've got a server with 36 databases which may or may not
>be in use any longer. I spent yesterday running SQL
>Profiler on that server but the trace doesn't capture the
>database in use (or if it does, it doesn't give me the
>option of displaying the database).
>Does anyone have a relatively painless way (without
>affecting performance, if possible) of capturing any
>access to any of these databases, so I know whether or
not
>I can drop the database?
>Thanks.
>Allen
>.
>

No comments:

Post a Comment