Accidental Restore...help!

Forum for users of Red Gate SQL Backup tool

Moderator: Chris Auckland

Accidental Restore...help!

Postby freddy12345 » Thu Oct 01, 2009 8:37 pm

Hi,

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

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?
freddy12345
 
Posts: 19
Joined: Mon Dec 11, 2006 6:37 pm

Re: Accidental Restore...help!

Postby petey » Sat Oct 03, 2009 5:39 pm

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
petey
 
Posts: 2233
Joined: Sun Apr 24, 2005 12:34 pm

Re: Accidental Restore...help!

Postby freddy12345 » Sat Oct 03, 2009 6:12 pm

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.
freddy12345
 
Posts: 19
Joined: Mon Dec 11, 2006 6:37 pm


Return to SQL Backup Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests