两台服务器不在域中,也不想加域,所以采用使用证书方法,整个过程分以下几步:
一.创建证书
在服务器A上运行
use master;
create master key encryption by password='sql2015';
create certificate host_A_cert with subject='host_a_certificate',start_date='01/01/2015',expiry_date='01/01/9999';
create endpoint endpoint_54mirror state=started
as
tcp(listener_port=5022,listener_ip=all)
for database_mirroring(authentication=certificate host_a_cert,encryption=required algorithm aes,role=partner);
go
--备份出证书
backup certificate host_a_cert to file='c:\host_a_certificate.cer';
在服务器B上运行
use master;
create master key encryption by password='sql2015';
create certificate host_B_cert with subject='host_B_certificate',start_date='01/01/2015&