January 28, 2019 at 6:09 am
Hi,
Before database decommission, there is task to trace that whether database is involving in any read-write operations or not for next 30 days, can you suggest better option for it other than Enabling profiler Trace.
Regards,
Shivrudra W
January 28, 2019 at 6:23 am
The DMV dm_db_index_usage_stats can be used to query reads and writes on indexes.
https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-db-index-usage-stats-transact-sql?view=sql-server-2017
The columns you'll find useful are these:
last_user_seek datetime Time of last user seek
last_user_scan datetime Time of last user scan.
last_user_lookup datetime Time of last user lookup.
last_user_update datetime Time of last user update.
There is also a similar DMV that returns information on file usage.
https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-io-virtual-file-stats-transact-sql?view=sql-server-2017
"Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho
January 28, 2019 at 7:42 am
I think you can use perfmon for this. Just select the statistics you want to track and you can get it to write to a flat file or a database using an ODBC connection.
January 28, 2019 at 7:56 am
Shivrudra - Monday, January 28, 2019 6:09 AMHi,
Before database decommission, there is task to trace that whether database is involving in any read-write operations or not for next 30 days, can you suggest better option for it other than Enabling profiler Trace.
Do you just want to know whether the operations are happening, or do you also need to know what operations are happening on what database objects?
John
January 28, 2019 at 11:11 am
Also, before you drop the database, take it offline and leave in place for a few days just to see if someone or something complains.
"Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho
January 28, 2019 at 2:49 pm
Eric M Russell - Monday, January 28, 2019 6:23 AMThe DMV dm_db_index_usage_stats can be used to query reads and writes on indexes.
https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-db-index-usage-stats-transact-sql?view=sql-server-2017The columns you'll find useful are these:
last_user_seek datetime Time of last user seek
last_user_scan datetime Time of last user scan.
last_user_lookup datetime Time of last user lookup.
last_user_update datetime Time of last user update.There is also a similar DMV that returns information on file usage.
https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-io-virtual-file-stats-transact-sql?view=sql-server-2017
This is good advice, you will probably want to check these daily, not just once at the end of the 30 days, because these views will only show data since restart
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply