In SQL Server 2016 the ability to perform database snapshots was introduced. An application can generate a database snapshot during its deployment. These snapshots can negatively impact Delphix related operations.
When performing a VDB refresh, Delphix will need to drop the database as part of the process. If a database snapshot is present then the following error will be generated:
Failed to delete the virtual database "VMcL_6XY2019": Changed database context to 'master'. ALTER DATABASE [VMcL_6XY2019] SET OFFLINE WITH ROLLBACK IMMEDIATE Nonqualified transactions are being rolled back. Estimated rollback completion: 0%. Nonqualified transactions are being rolled back. Estimated rollback completion: 100%. Changed database context to 'master'. DROP DATABASE [VMcL_6XY2019] Msg 3709, Level 16, State 2, Server 10-43-15-30\SQL2017, Line 1 Cannot drop the database while the database snapshot "VMcL_dbss1800" refers to it. Drop that database first. Changed database context to 'master'. Msg 50000, Level 11, State 127, Server 10-43-15-30\SQL2017, Line 4 Failed to drop database VMcL_6XY2019 die : Error: drop_database failed At C:\Program Files\Delphix\DelphixConnector\423f7b70-76b6-6eee-d8ad-622a693f2f53-vdb-4\SCRIPT\DropDatabase.ps1:26 char:12 + die <<<< "$($args)" + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,die .
Make sure that the user "AD\windows_OS_user" has privileges to delete the database.
Key section of the error
Cannot drop the database while the database snapshot "VMcL_dbss1800" refers to it. Drop that database first.
Applicable Delphix Versions
This article applies to the following versions of the Delphix Engine:
220.127.116.11, 18.104.22.168, 22.214.171.124, 126.96.36.199, 188.8.131.52, 184.108.40.206, 220.127.116.11, 18.104.22.168, 22.214.171.124, 126.96.36.199, 188.8.131.52, 184.108.40.206, 220.127.116.11
|5.2||18.104.22.168, 22.214.171.124, 126.96.36.199, 188.8.131.52, 184.108.40.206, 220.127.116.11, 18.104.22.168, 22.214.171.124|
126.96.36.199, 188.8.131.52, 184.108.40.206, 220.127.116.11, 18.104.22.168, 22.214.171.124, 126.96.36.199, 188.8.131.52, 184.108.40.206
The database snapshot will need to be deleted, this can be done from SQL Server Management Studio:
1. Select the offending Database snapshot, in this example "VMcL_dbss1800".
2. Right-click and select Delete.
3. Press OK on the Delete Object dialog.
4. Try the Refresh/Rollback again.