Sunday, November 25, 2007

SQL 2005 Database Mirroring and Log Shipping

SQL Server 2005 Books Online (September 2007)
Database Mirroring and Log Shipping
A given database can be mirrored or log shipped; it can also be simultaneously mirrored and log shipped. To choose what approach to use, consider the following:
How many destination servers do you require?If you require only a single destination database, database mirroring is the recommended solution. If you require more than one destination database, you need to use log shipping, either alone or with database mirroring. Combining these approaches gives you the benefits of database mirroring along with the support for multiple destinations provided by log shipping.
If you need to delay restoring log on the destination database (typically, to protect against logical errors), use log shipping, alone or with database mirroring.
This topic discusses considerations for combining log shipping and database mirroring.

SQL 2005 Database Mirroring and Log Shipping

Setting Up Mirroring and Log Shipping Together

Setting Up Mirroring and Log Shipping Together

To set up database mirroring and log shipping together, the following steps are required:

Restore backups of the principal/primary database with NORECOVERY onto another server instance to be later used as database mirroring mirror database for the principal/primary database. For more information, see Preparing a Mirror Database for Mirroring.

Set up database mirroring. For more information, see How to: Configure a Database Mirroring Session (SQL Server Management Studio) or Setting Up Database Mirroring.

Restore backups of the principal/primary database to other server instances to be later used as log shipping secondary databases for the primary database. For more information, see Configuring Log Shipping.

Set up log shipping on the principal database as the primary database for one or more secondary databases.
You should set up a single share as the backup directory (a backup share). This ensures that after role switching between the principal and mirror servers, backup jobs continue to write to the same directory as before. A best practice is to ensure that this share is located on a different physical server from the servers hosting the databases involved in mirroring and log shipping.
For more information, see How to: Enable Log Shipping (SQL Server Management Studio).

Set up log shipping on the mirror as the inactive primary database.
You must use the same backup share that is being used by the principal/primary and the secondary servers. Do not perform any setup from the secondary(s) for the mirror/primary. The primary server specified when configuring the secondary server is not used for the mechanics of shipping the logs to the secondary. Log shipping just copies files and a secondary server does not connect to the primary server instance defined on the secondary.
The Transaction Log Shipping interface in SQL Server Management Studio supports only one primary database per log shipping configuration. Therefore, you must use stored procedures to set up the mirror/primary. For more information, see How to: Enable

No comments: