Backup failed in sql databases

Avyayah 1,291 Reputation points
2022-12-14T15:10:48.83+00:00

Executing the query "DBCC CHECKDB(N'DB') WITH NO_..." failed with the following error: "A database snapshot cannot be created because it failed to start.
A database snapshot cannot be created because it failed to start.
Cannot create file 'G:\DATA\DB_Data.MDF_MSSQL_DBCC11' because it already exists. Change the file path or the file name, and retry the operation.
The database snapshot for online checks could not be created. Either the reason is given in a previous error or one of the underlying volumes does not support sparse files or alternate streams. Attempting to get exclusive access to run checks offline.
The database could not be exclusively locked to perform the operation.
Check statement aborted. The database could not be checked as a database snapshot could not be created and the database or table could not be locked. See Books Online for details of when this behavior is expected and what workarounds exist. Also see previous errors for more details.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

SQL Server Other
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2022-12-14T22:36:29.057+00:00

    The title says Backup, but it appears that you have a problem with DBCC CHECKDB?

    DBCC CHECKDB creates a hidden database snapshot. Apparently this is failing here. It seems that there is a leftover file from a previous execution that was aborted for some reason. I would try to delete the file in the error message and try again.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.