Error Code: [30:299] A SharePoint In-Place Restore Operation Fails

Article ID: SP0020 A SharePoint in-place restore operation fails because the database is in use.

Symptom

A SharePoint in-place restore operation fails, and the following error message appears:

Error Code: [30:299]
Description: Query Result [Microsoft.SqlServer.Management.Common.ExecutionFailureException:Exclusive access could not be obtained because the database is in use. RESTORE DATABASE is terminating abnormally. An exception occurred while executing a Transact-SQL statement or batch.].

Cause

Because you use the Same configuration option for the SharePoint database, the database is not deleted and might be in use during the in-place restore operation.

Resolution

Delete the web application and the content database, and then restart the restore operation.