I have done a lot of research on this.
I am trying to restore a database with SQL Server 2014 and it is holding at 100%.
Many people believe that the solution is to simply make sure that you have restored using the RECOVERY option.
I tried this and it still hangs 100%. I tried through the SSMS recovery dialog, and I tried to execute the following SQL statement:
USE [master] RESTORE DATABASE [MyDB] FROM DISK = N'C:\MyDB_backup_2015_05_05_010004_1506557.bak' WITH FILE = 1, MOVE N'MyDB_Data' TO N'F:\MSSQL\DATA\MyDB.mdf', MOVE N'MyDB_Log' TO N'F:\MSSQL\DATA\MyDB_1.ldf', NOUNLOAD, REPLACE, RECOVERY, STATS = 2 GO
When I check the status of a command with:
SELECT r.status, r.command, r.wait_type, r.percent_complete FROM sys.dm_exec_requests r WHERE r.command like '%restore%' or r.command like '%backup%'
I get:
status: suspended command: RESTORE DATABASE wait_type: BACKUPTHREAD percent_complete: 100
From my reading it follows that RESTORE is waiting for BACKUP to complete, but there is no BACKUP command returned from my request in sys.dm_exec_requests
EDIT: after retrying the request and executing the above request, to see the RESTORE progress from the very beginning, I see that the value of “percent_complete” is steadily growing, despite the fact that the “status” remains “suspended” and “wait_type 'remains as' BACKUPTHREAD '.
Thus, although it has been “paused,” it still performs RESTORE.
So I'm at a loss ...
Anyone have any ideas what is going on here or what are some tips for diagnosing the problem?
Hooray!