Competition: What’s your favorite Redgate tool? Enter now.

Accidental Restore...help!

freddy12345freddy12345 Posts: 19 Bronze 2
edited October 3, 2009 1:12PM in SQL Backup Previous Versions
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 = ''[email protected]''"'

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?

Comments

  • peteypetey Posts: 2,358 New member
    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 8
  • freddy12345freddy12345 Posts: 19 Bronze 2
    petey 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.
Sign In or Register to comment.