Setting Up Database Mirroring Using Certificates 3
Setting Up Database Mirroring Using Certificates 3
USE master;
CREATE MASTER KEY ENCRYPTION BY PASSWORD =
'<1_Strong_Password!>';
GO
USE master;
CREATE CERTIFICATE HOST_A_cert
WITH SUBJECT = 'HOST_A certificate',
expiry_date='03/23/2080' ;
GO
USE master;
CREATE MASTER KEY ENCRYPTION BY PASSWORD =
'<Strong_Password_#2>';
GO
USE master;
CREATE LOGIN HOST_B_login WITH PASSWORD =
'1Sample_Strong_Password!@#';
GO
--Backup the new certificate and copy it over to the Mirror server
Backup Certificate principal_user_new_Mar23
To File ='C:\RELEASES\principal_user_new_Mar23.cer' -- You need to
change the drive location to appropriate folder on your server
Go
--Backup the new certificate and copy it over to the Principal server
Backup Certificate mirror_cert_new_Mar23
To File ='C:\RELEASES\mirror_cert_new_Mar23.cer'-- You need to change
the drive location to appropriate folder on your server
Go
3) Ensure the certificates backed up in step 1 and 2 are copied across. That
is, the certificate backed up in step 1 on the principal needs to be copied over
to the mirror and the certificate backed up in step 2 on the mirror server needs
to be copied over to the principal server in the appropriate folder.
Use master
Go
-- Create a new SQL login with complex password
Create Login principal_new_Mar23 With Password ='P@ssw0rd'
GO
-- Associate a user with the new Login