The document provides instructions for configuring database mirroring between servers HOST_A, HOST_B, and HOST_C. It involves creating certificates and logins on each server to authenticate connections from the other servers and allow them to join the mirroring session. Certificates are created, backed up, and imported on each server to trust the other servers. Logins and users are also created on each server to represent the other servers' certificates and grant permissions to connect to the mirroring endpoint.
1. OUTBOUND A
On the master database, create the database master key, if needed.
USE master;
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'Motorola1';
GO
Make a certificate for this server instance.
use master;
create certificate HOST_A_CERT with subject ='HOST_A Certificate'
GO
Create a mirroring endpoint for server instance using the certificate.
create ENDPOINT Endpoint_Mirroring STATE=STARTED AS TCP(LISTENER_PORT=7024,
LISTENER_IP=ALL)
FOR DATABASE_MIRRORING(AUTHENTICATION=CERTIFICATE
HOST_A_CERT,ENCRYPTION=REQUIRED
ALGORITHMAES,ROLE=ALL);
Backup the HOST_A certificate and copy it to other system HOST-B
BACKUP CERTIFICATE HOST_A_CERT TO FILE='C:backupHOST_A_CERT.cer'
OUTBOUND B
On the master database, create the database master key, if needed.
USE master;
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'Motorola1';
GO
2. Make a certificate for this server instance.
use master;
create certificate HOST_B_CERT with subject ='HOST_B Certificate'
GO
Create a mirroring endpoint for server instance using the certificate.
create ENDPOINT Endpoint_Mirroring STATE=STARTED AS TCP(LISTENER_PORT=7024,
LISTENER_IP=ALL)
FOR DATABASE_MIRRORING(AUTHENTICATION=CERTIFICATE
HOST_B_CERT,ENCRYPTION=REQUIRED
ALGORITHMAES,ROLE=ALL);
Backup the HOST_B certificate and copy it to other systemHOST-B
BACKUP CERTIFICATE HOST_B_CERT TO FILE='C:backupHOST_B_CERT.cer'
OUTBOUND C
On the master database, create the database master key, if needed.
USE master;
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'Motorola1';
GO
Make a certificate for this server instance.
use master;
create certificate HOST_C_CERT with subject ='HOST_C Certificate'
GO
3. Create a mirroring endpoint for server instance using the certificate.
create ENDPOINT Endpoint_Mirroring STATE=STARTED AS TCP(LISTENER_PORT=7024,
LISTENER_IP=ALL)
FOR DATABASE_MIRRORING(AUTHENTICATION=CERTIFICATE
HOST_C_CERT,ENCRYPTION=REQUIRED
ALGORITHMAES,ROLE=ALL);
Backup the HOST_C certificate and copy it to other system HOST-B
BACKUP CERTIFICATE HOST_C_CERT TO FILE='C:backupHOST_C_CERT.cer'
INBOUND A FOR B
To configure HOST_A for inbond connections:
1. create login on HOST-A for HOST-B
use master;
create login HOST_B_LOGIN with PASSWORD = 'Motorola1'
2. Create a user for that login
create user HOST_B_USER FOR LOGIN HOST_B_LOGIN;
GO
3. Associate the certificate with the user:
create CERTIFICATE HOST_B_CERT AUTHORIZATION HOST_B_USER FROMFILE =
'C:backupHOST_B_CERT.cer'
4. 4. Grant connect permissions on the login for the remote mirroring end point
Grant CONNECT on ENDPOINT::Endpoint_Mirroring TO [HOST_B_LOGIN];
GO
INBOUND A FOR C
To configure HOST_A for inbond connections:
1. create login on HOST-A for HOST-C
use master;
create login HOST_C_LOGIN with PASSWORD = 'Motorola1'
2. Create a user for that login
create user HOST_C_USER FOR LOGIN HOST_C_LOGIN;
GO
3. Associate the certificate with the user:
create CERTIFICATE HOST_C_CERT AUTHORIZATION HOST_C_USER FROMFILE =
'C:backupHOST_C_CERT.cer'
4. Grant connect permissions on the login for the remote mirroring end point
Grant CONNECT on ENDPOINT::Endpoint_Mirroring TO [HOST_C_LOGIN];
GO
5. INBOUND B FOR A
To configure HOST_B for inbond connections:
1. create login on HOST-B for HOST-A
use master;
create login HOST_A_LOGIN with PASSWORD = 'Motorola1'
2. Create a user for that login
create user HOST_A_USER FOR LOGIN HOST_A_LOGIN;
GO
3. Associate the certificate with the user:
create CERTIFICATE HOST_A_CERT AUTHORIZATION HOST_A_USER FROMFILE =
'C:backupHOST_A_CERT.cer'
4. Grant connect permissions on the login for the remote mirroring end point
Grant CONNECT on ENDPOINT::Endpoint_Mirroring TO [HOST_A_LOGIN];
GO
INBOUND B FOR C
To configure HOST_B for inbond connections:
1. create login on HOST-B for HOST-C
use master;
create login HOST_C_LOGIN with PASSWORD = 'Motorola1'
6. 2. Create a user for that login
create user HOST_C_USER FOR LOGIN HOST_C_LOGIN;
GO
3. Associate the certificate with the user:
create CERTIFICATE HOST_C_CERT AUTHORIZATION HOST_C_USER FROMFILE =
'C:backupHOST_C_CERT.cer'
4. Grant connect permissions on the login for the remote mirroring end point
Grant CONNECT on ENDPOINT::Endpoint_Mirroring TO [HOST_C_LOGIN];
GO
INBOUND C FOR A
To configure HOST_C for inbond connections:
1. create login on HOST-C for HOST-A
use master;
create login HOST_A_LOGIN with PASSWORD = 'Motorola1'
2. Create a user for that login
create user HOST_A_USER FOR LOGIN HOST_A_LOGIN;
GO
3. Associate the certificate with the user:
create CERTIFICATE HOST_A_CERT AUTHORIZATION HOST_A_USER FROMFILE =
'C:backupHOST_A_CERT.cer'
7. 4. Grant connect permissions on the login for the remote mirroring end point
Grant CONNECT on ENDPOINT::Endpoint_Mirroring TO [HOST_A_LOGIN];
GO
INBOUND C FOR B
To configure HOST_C for inbond connections:
1. create login on HOST-C for HOST-B
use master;
create login HOST_B_LOGIN with PASSWORD = 'Motorola1'
2. Create a user for that login
create user HOST_B_USER FOR LOGIN HOST_B_LOGIN;
GO
3. Associate the certificate with the user:
create CERTIFICATE HOST_B_CERT AUTHORIZATION HOST_B_USER FROMFILE =
'C:backupHOST_B_CERT.cer'
4. Grant connect permissions on the login for the remote mirroring end point
Grant CONNECT on ENDPOINT::Endpoint_Mirroring TO [HOST_B_LOGIN];
GO