Welcome

Monday, April 30, 2012

MS SQL 2005 2008 2012 Mirroring

How to mirror MSSQL Database

=== PRINCIPAL ===
USE MASTER
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'Password'
GO


---
USE MASTER
GO
CREATE CERTIFICATE Principal_Cert
WITH SUBJECT = 'Principal Certificate';
GO
---

CREATE ENDPOINT End_Mirroring
STATE = STARTED
AS TCP (LISTENER_PORT = 5022, LISTENER_IP = ALL)
FOR DATABASE_MIRRORING
(
AUTHENTICATION = CERTIFICATE Principal_Cert,
ENCRYPTION = REQUIRED ALGORITHM RC4,
ROLE = ALL
)
GO
---


USE MASTER
GO
BACKUP CERTIFICATE Principal_Cert
TO FILE = 'C:\Cert\Principal_Cert.cer'
GO