snippetsqlMinor
How to "hack-drop" a database snapshot after SQL Server upgrade has botched it
Viewed 0 times
aftersqldatabasedropsnapshothashackhowserverupgrade
Problem
I'm dealing with an issue where database snapshots cannot be dropped after SQL Server has been upgraded to 2014. The snapshots are defunct but cannot be dropped.
Now although the Connect item has a disappointing comment in it I assume that this will be fixed eventually. However, I need to deal with this soon.
Is there a way to drop a database snapshot that cannot be deleted due to this bug? I fear that I have exhausted all documented means to do this. It might take undocumented modifications to system tables. Is there a way to force a database (snapshot) to be dropped?
Now although the Connect item has a disappointing comment in it I assume that this will be fixed eventually. However, I need to deal with this soon.
Is there a way to drop a database snapshot that cannot be deleted due to this bug? I fear that I have exhausted all documented means to do this. It might take undocumented modifications to system tables. Is there a way to force a database (snapshot) to be dropped?
Solution
I was able to reproduce this in an Azure VM, and resolve by simply setting the primary database offline and dropping the snapshot, eg
ALTER DATABASE AdventureWorks2012 SET OFFLINE
DROP DATABASE AdventureWorks2012_SN001Code Snippets
ALTER DATABASE AdventureWorks2012 SET OFFLINE
DROP DATABASE AdventureWorks2012_SN001Context
StackExchange Database Administrators Q#64165, answer score: 4
Revisions (0)
No revisions yet.