October 30, 2024 at 4:17 pm
Hi - I'm looking for advice regarding the best & quickest way to establish whether or not a SQL2012 DB is being used.
Many thanks
Dax
October 30, 2024 at 10:16 pm
As in is a user connected? Or has anyone been running queries. Those are two different things.
I believe when someone connects, sp_who2 shows they are in the database, and I believe there is a shared lock.
If you want to know if anyone has used the database in the last xxx days, you likely need an Extended Event trace looking for any activity in that database.
October 30, 2024 at 11:58 pm
You can have a look at sys.dm_db_index_usage_stats() to see if there have been any reads or writes since the last time the SQL Server Service was started.
Once you've decided that no on is using it, don't just drop it. Just take it offline and wait for 6 weeks to see if the proverbial phone rings.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply