5、RD = 'test_1234';CREATE CERTIFICATE HOST_C_cert WITH SUBJECT = 'HOST_C certificate', START_DATE = '07/18/2012';这个MASTERKEY对于每个sqlserver实例唯一的,如果数据库中已经创建了MASTERKEY,可以用如下的sql删除之后重新执行:DROP MASTER KEY 2、创建连接的端点--主体服务器执行:CREATE ENDPOINT Endpoint_Mirroring STATE = STARTED AS TCP ( LIST
6、ENER_PORT=5022 , LISTENER_IP = ALL ) FOR DATABASE_MIRRORING ( AUTHENTICATION = CERTIFICATE HOST_A_cert , ENCRYPTION = REQUIRED ALGORITHM AES , ROLE = ALL );--镜像服务器执行:CREATE ENDPOINT Endpoint_Mirroring STATE = STARTED AS TCP ( LISTENER_PORT=5022 , LISTENER_IP = ALL ) FOR DATABASE_M
7、IRRORING ( AUTHENTICATION = CERTIFICATE HOST_B_cert , ENCRYPTION = REQUIRED ALGORITHM AES , ROLE = ALL ); --见证服务器执行:CREATE ENDPOINT Endpoint_Mirroring STATE = STARTED AS TCP ( LISTENER_PORT=5022 , LISTENER_IP = ALL ) FOR DATABASE_MIRRORING ( AUTHENTICATION = CERTIFICATE HOST_C_cer