Using Mirroring and Log Shipping

Mirroring and log shipping are two different options that you can use to improve availability. The principal database used in database mirroring can act as the primary database in log shipping as well. You might want to do this is in a situation in which you have a critical database and you want to have multiple standby servers available. For example, you might use:

  • Mirroring to establish a single standby that will come online if the primary fails. With a fully synchronous mirroring configuration, automatic failover occurs if the principal database is lost, as long as the mirror server and witness can communicate with each other. Automatic failover causes the mirror server to assume the principal role and bring its database online as the principal database. When the former primary comes back online, it comes online as the mirror.

  • Log shipping to establish one or more standbys, which can be manually brought online in case the primary and mirror both fail. Transaction logs are shipped from a primary database to a central backup folder. Secondary servers access the backup folder and restore the transaction logs in their secondary databases to keep the servers synchronized. If the primary database fails, any secondary database can be brought online manually as the new primary database.

If you want to use both mirroring and log shipping, you will usually configure mirroring first, and then log shipping, by following these general steps:

  1. Restore backups of the principal database with NORECOVERY onto the server that will act as the mirror.

  2. Set up database mirroring by configuring the primary and mirror servers, and as necessary, the witness server (required for synchronous mirroring and automatic failover).

  3. Restore backups of the principal database to servers that will act as log shipping secondary (destination) databases.

  4. Create a shared resource to use as the backup folder for log shipping.

  5. Configure the principal database as the log shipping primary for one or more secondary (destination) databases.

  6. Configure the mirror server as a log shipping primary with the same log shipping configuration as the primary server. This allows log shipping to continue after database mirroring fails over.

  7. If mirroring fails over, the former mirror server comes on line as the primary server. If the backup folder is not available to both the primary and mirror, log shipping backup jobs will fail when the mirror takes over as the primary. To prevent this, create the backup folder on a shared network resource.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset