Restore database in a mirrored environment

  • We have a SQL server 2005 environment we are testing, with a principal and mirror but no witness. The database copy is quite old and we now have a newer version (from the live environment sql 2000) that we wish to put on.

    I am trying to understand what the best process is to restore this new database copy in an already mirrored environment.

    All the documents I read refer to setting up mirroring from scratch not this particular scenario.

    From what I have read we cannot simply pause mirroring we would have to turn off mirroring completely, either using the interface or a sql command of set partner off (does this need to be run on both machines?)

    We then restore the backup to the principal and at the same time restore to the mirror (with no recovery?).

    Once the restores have finished set up mirroring again.

    I am hoping someone can confirm what the best way of doing this would be?

  • Well I would presume that one has to remove the mirror, restore the database and re-establish the mirror.

    I have never done it before.

    Let us know how you do it and whats the outcome.

    Thanks.

  • How can I restore a database in a mirroring context after removing the database mirroring configuration. I ask that, because I note an alert that says me that the database is in use, I think that because the witness an the secondary server still mantaining a connection to the principal server. How are the correct steps for disabling the mirroring, restoring the database and re-enabling the database mirroring environment?

    Thanks in advance.

  • While a database mirroring session is active, the following restrictions apply:

    •Backup and restore of the mirror database are not allowed.

    •Backup of the principal database is allowed, but BACKUP LOG WITH NORECOVERY is not allowed.

    •Restoring the principal database is not allowed.

  • Yes, I know that, I need to know which are the steps to follow to accomplish this goal, after disabling the mirroring...

  • franzambesten (11/30/2011)


    Yes, I know that, I need to know which are the steps to follow to accomplish this goal, after disabling the mirroring...

    Database Mirroring Administration How-to Topics (Database Engine)

    http://msdn.microsoft.com/en-us/library/ms175059(v=SQL.90).aspx

  • Once you've removed mirroring (http://msdn.microsoft.com/en-us/library/ms189112%28v=SQL.90%29.aspx), you can just restore both dbs and re-setup mirroring.

  • I know this is a really old thread, but I wanted to ask this... In SQL 2012 I see there is a "Pause" mirroring button... would this suffice in order to restore from a .bak backup file? Or do we still need to break and reconfigure the mirroring in order to restore?

    Thank you

  • I think so, but I could be wrong.

    the main issue is mirroring relies on a log chain, just like log shipping (or similar to LS).

    If you restore, the chain becomes somewhat broken, depending on what you're restoring (from when/which backup). My suspicion is any restore will require you to reinitialize DM, and that if you're not restoring from an extremely recent backup, this is a reset of mirroring.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply