0

When trying to create a backup using a command like this:

Backup-SPSite https://server_name/sites/site_name -Path C:\Backup\site_name.bak -UseSqlSnapshot

Source

I ran into an issue where the target disk did not have enough space to create the file so I got an error. After fixing that problem I now realize that the snapshops from the multiple attempts are still on my disk taking way too much space, and if I try to right click and delete I get an error message saying they're being used by MSSQL.

How can I delete these snapshops?

1 Answer 1

0

First, open SQL Server Management Studio and connect to the server housing the database snapshot. Next, expand the Databases node in the Management Studio.

Locate the specific database snapshot you wish to delete, right-click on it, and select the Delete option. In the subsequent Delete Database Snapshot dialog box, make sure to select the Force check box to proceed with the deletion. Confirm your selection by clicking OK, effectively eliminating the database snapshot. In cases where the above procedure does not suffice, you can resort to a Transact-SQL (T-SQL) statement as an alternative:

DROP DATABASE database_snapshot_name

However, exercise caution when using code, especially in a production environment. After opening SQL Server Management Studio and connecting to the server hosting the database snapshot, execute the T-SQL statement in the Query Editor window.

It's essential to note that dropping a database snapshot not only removes it from SQL Server but also deletes the sparse files associated with the snapshot, effectively terminating all user connections to it. While managing SQL Server snapshots and ensuring data integrity is crucial, it's also worth considering the significance of robust third-party backup solutions, as Nakivo. I think this Microsoft article can be helpful to you, check it: https://learn.microsoft.com/en-us/sql/relational-databases/databases/drop-a-database-snapshot-transact-sql?view=sql-server-ver16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.