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
0

Comments

2 comments

  • petey
    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
    petey
    0
  • freddy12345
    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
    0

Add comment

Please sign in to leave a comment.