Red Gate forums :: View topic - Accidental Restore...help!
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Backup Previous Versions
SQL Backup Previous Versions forum

Accidental Restore...help!

Search in SQL Backup Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
freddy12345



Joined: 11 Dec 2006
Posts: 19

PostPosted: Thu Oct 01, 2009 8:37 pm    Post subject: Accidental Restore...help! Reply with quote

Hi,

i just issued this restore script, but on the wrong server. Sad

exec master..sqlbackup N'-SQL "RESTORE DATABASE [cdr200907] FROM DISK = ''\\Crystal\Share1\Mangal\BACKUPUncompressed\Daily\CDR200907\FULL_(local)_CDR200907_20091001_002312.sqb'' WITH RECOVERY, MAILTO = ''dbteamonly@demo.com''"'

i recognized the mistake immediately and hit the cancel button. but now the DB is in the '(restoring)' state, and it has been for 10 minutes.

since i did not tell it to Replace, why is it doing anything, and what is it doing?

can anyone shed light on this?

thanks!

Fred

--PS it actually did the restore. but since i did not include the REPLACE command, why did it do this?
Back to top
View user's profile Send private message Send e-mail
petey



Joined: 24 Apr 2005
Posts: 2277

PostPosted: Sat Oct 03, 2009 5:39 pm    Post subject: Re: Accidental Restore...help! Reply with quote

freddy12345 wrote:
since i did not tell it to Replace, why is it doing anything, and what is it doing?

On SQL Server 2000, REPLACE is not required in order to overwrite an existing database. On SQL Server 2005 and newer, REPLACE is not required if:

- you are running the database using the simple recovery model
- the database is running using full/bulk-logged recovery model, and there are no entries in the transaction log that needs to be backed up
_________________
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
Back to top
View user's profile Send private message Send e-mail
freddy12345



Joined: 11 Dec 2006
Posts: 19

PostPosted: Sat Oct 03, 2009 6:12 pm    Post subject: Re: Accidental Restore...help! Reply with quote

petey wrote:
freddy12345 wrote:
since i did not tell it to Replace, why is it doing anything, and what is it doing?

On SQL Server 2000, REPLACE is not required in order to overwrite an existing database. On SQL Server 2005 and newer, REPLACE is not required if:

- you are running the database using the simple recovery model
- the database is running using full/bulk-logged recovery model, and there are no entries in the transaction log that needs to be backed up


--Thank you for your response. From at least one point of view, it would seem dangerous to allow DB replacement without specific user directive. perhaps from another point of view it is desirable. Yikes. wonder if anyone else has got burned by this?

Fortunately, there was very little damage done in this instance.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group