December 5, 2017 at 4:45 pm
Eric M Russell - Tuesday, December 5, 2017 12:21 PMJeff Moden - Tuesday, December 5, 2017 9:16 AMBert-701015 - Tuesday, December 5, 2017 8:45 AMJust a heads up; some of the techniques discussed can be skewed (in use) by maintenance jobs like re-indexing.Which techniques and how are they skewed?
I believe he's referring to scheduled index and statistics maintenance jobs performing reads and writes.
Agreed. I just hate it when someone drops partial information on the table. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
December 6, 2017 at 10:27 am
There are a dozen different things you can do to help determine if a database is being used, but none of them are entirely reliable as a standalone solution. Just for completeness, another option is querying plan cache by database id or analyzing sql text looking for database references.
SELECT @@servername as servername
, db_name(qp.dbid) dbname
, object_name( qp.objectid, qp.dbid ) objectname
, qs.creation_time AS plan_created
, qs.last_execution_time AS last_executed
, qs.execution_count
from sys.dm_exec_cached_plans cp
outer apply sys.dm_exec_query_plan ( cp.plan_handle ) as qp
left outer join sys.dm_exec_query_stats AS qs on qs.plan_handle = cp.plan_handle
outer apply sys.dm_exec_sql_text (cp.plan_handle) as st
where db_name(qp.dbid) = 'MyDatabase'
order by qs.last_execution_time;
"Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho
December 6, 2017 at 6:59 pm
Eric M Russell - Wednesday, December 6, 2017 10:27 AMThere are a dozen different things you can do to help determine if a database is being used, but none of them are entirely reliable as a standalone solution.
There is one guaranteed way to determine if a database is being used... do the BSOFH thing. Take a full backup followed by a "Tail Log Backup" and then wait for the instant messages to start and trouble tickets to start popping up. 😉 If none of that happens for a year, drop the database and put the final backup files in long term storage.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 11, 2017 at 4:58 pm
Jeff Moden - Wednesday, December 6, 2017 6:59 PMEric M Russell - Wednesday, December 6, 2017 10:27 AMThere are a dozen different things you can do to help determine if a database is being used, but none of them are entirely reliable as a standalone solution.There is one guaranteed way to determine if a database is being used... do the BSOFH thing. Take a full backup followed by a "Tail Log Backup" and then wait for the instant messages to start and trouble tickets to start popping up. 😉 If none of that happens for a year, drop the database and put the final backup files in long term storage.
And this is what I call "User Driven Documentation" (UDD). When all indications suggest the database is not in use, I turn to UDD. 😉
March 29, 2019 at 8:24 am
"One person suggested we just not move them, and see if anybody screamed or if it broke anything."
Years ago at a Giant Entity that was the method used in our department to see if various reports were being used. One time the department IT head announced that he was going to shut off printing hard copies of a certain report, and asked if anybody used it. One user declared "yes - I look at it every month." The IT head then stated that he had turned off printing hard copies 3 months ago. Doh!
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply