Microsoft® SQL Server® 2012 Bible

(Ben Green) #1

693


Chapter 27: Database Mirroring


27


Confi guring Database Mirroring
You can confi gure database mirroring using one of two methods: SQL Server Management
Studio or system stored procedures.

Pre-Database Mirroring Configuration
With either method of confi guration, the following prerequisites need to be completed
before confi guring database mirroring:

■ (^) The principal, mirror, and witness servers all must have the same version of SQL
Server (SQL Server 2005,2008, 2008 R2, or 2012).
■ (^) The principal and the mirror server must have the same edition of SQL Server
(Enterprise, Business Intelligence, or Standard Edition).
■ (^) The edition of witness server (if you confi gure high-safety mode with automatic
failover) can be SQL Server Express, Web, Standard, Business Intelligence, or
Enterprise Edition.
■ The recovery model of the principal database must be set to full.
■ (^) Ensure that there is enough disk space for the mirror database on the mirror server.
■ Create the mirror database. To do this, take a full database backup of the principal
database and subsequent transaction log backups; copy the backups to the mir-
ror server; and restore it on the mirror server with norecovery to put it into a
state that allows inserting transaction log records. The name of the mirror database
should be the same as the principal database. Before you start mirroring, take the
transaction log backup on the principal database and restore it on the mirror data-
base with norecovery. Do not restore the transaction log backups with standby
because even though it’s a loading state, database mirroring does not work.
Best Practice
Although not required, the mirror database should have the same directory structure as the principal
database. If the directory structure is different, adding and removing fi le operations on the principal
database cannot be allowed without suspending database mirroring.
For more information about backup and restore, refer to Chapter 21, “Backup and Recovery Planning.”
■ (^) Communication between the SQL Servers in database mirroring confi guration is
accomplished over Transmission Control Protocol (TCP) endpoints. Each server par-
ticipating in database mirroring requires its own dedicated database mirroring end-
point. Each endpoint listens on a unique TCP/IP port.
c27.indd 693c27.indd 693 7/31/2012 9:50:26 AM7/31/2012 9:50:26 AM
http://www.it-ebooks.info

Free download pdf