SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How do I stop a restore in the middle
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dolphin123
Starting Member

USA
44 Posts

Posted - 08/13/2012 :  09:55:10  Show Profile  Reply with Quote
Hi,

I ran this on the wrong. DB. :(
How do I stop the restore in the middle?? please help


restore database blah
from disk='\\mybackups\thismonth\backup1.BAK'
with replace, recovery, stats=5, maxtransfersize=1048576

D

dolphin123
Starting Member

USA
44 Posts

Posted - 08/13/2012 :  10:23:21  Show Profile  Reply with Quote
hi,

I kept trying the following command and it did not show any restore items on the instance.

SELECT sysdb.NAME,
dmv.PERCENT_COMPLETE AS [PercentComplete],
dmv.TOTAL_ELAPSED_TIME/60000 AS [Elapsed_Time_in_Minutes],
dmv.ESTIMATED_COMPLETION_TIME/60000 AS [Time_Remaining_in_Minutes],
(SELECT TEXT FROM sys.dm_exec_sql_text(dmv.SQL_HANDLE))AS COMMAND FROM
MASTER..SYSDATABASES sysdb, sys.dm_exec_requests dmv
WHERE sysdb.DBID=dmv.DATABASE_ID AND dmv.COMMAND LIKE '%restore%'
ORDER BY percent_complete desc,dmv.TOTAL_ELAPSED_TIME/60000 desc

So, it looks like the restore stopped when i closed the query windows. Thank god.

But the DB says "Restoring" and I am not able to open it.

How do I open it?

- D
Go to Top of Page

prett
Posting Yak Master

USA
161 Posts

Posted - 08/22/2012 :  23:34:19  Show Profile  Reply with Quote
Check this article, it will help you to resolve this issue:
http://beyondrelational.com/modules/2/blogs/634/posts/17529/how-to-recover-a-database-stuck-in-restore-mode.aspx
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000