镜像

CREATE ENDPOINT AughtEightDagobahMirror
AUTHORIZATION sa
STATE = STARTED
AS TCP(LISTENER_PORT=5022,LISTENER_IP=ALL)
FOR DATA_MIRRORING
(ROLE =PARTNER, AUTHENTICATION = WINDOWS NEGOTIATE,ENCRYPTION=REQUIRED ALGORITHM RC4)



--AughtEight 主体服务器,Dagobah是镜像服务器,Tatooine是见证服务器
USE master
GO
CREATE ENDPOINT AughtEightDagobahPrincipal
AS TCP(LISTENER_PORT=5022)
FOR DATA_MIRRORING(ROLE=PARTNER,ENCRYPTION=REQUIRED ALGORITHM RC4);
GO

CREATE LOGIN[AughtEight\DagobahSQL] FROM WINDOWS;
GO
CREATE LOGIN [AughtEight\TatooineSQL] FROM WINDOWS;
GO

GRANT CONNECT ON ENDPOINT::AughtEightDagobahPrincipal
to [AughtEight\TatooineSQL];
GRANT CONNECT ON ENDPOINT::AughtEightDagobahPrincipal
TO [AughtEight\DagobahSQL];
GO

--RUN on Dagobah
USE master
GO
CREATE ENDPOINT AughtEightDagobahMirror
AS TCP(LISTENER_PORT =5023)
FOR DATA_MIRRORING (ROLE=PARTNER,ENCRYPTION=REQUIRED ALGORITHM RC4);
GO

CREATE LOGIN [AughtEight\AughtEightSQL] FROM WINDOWS;
CREATE LOGIN [AughtEight\DagobahSQL] FROM WINDOWS;
GO

GRANT CONNECT ON ENDPOINT::AughtEightDagobahPrincipal
to [AughtEight\AughtEightSQL];
GRANT CONNECT ON ENDPOINT::AughtEightDagobahPrincipal
TO [AughtEight\DagobahSQL];
GO


--Run on Tatooine
USE master
GO
CREATE ENDPOINT AughtEightDagobahMirror
AS TCP(LISTENER_PORT =5024)
FOR DATA_MIRRORING (ROLE=WITNESS,ENCRYPTION=REQUIRED ALGORITHM RC4);
GO

CREATE LOGIN [AughtEight\AughtEightSQL] FROM WINDOWS;
CREATE LOGIN [AughtEight\DagobahSQL] FROM WINDOWS;
GO

GRANT CONNECT ON ENDPOINT::AughtEightDagobahPrincipal
TO [AughtEight\AughtEightSQL];
GRANT CONNECT ON ENDPOINT::AughtEightDagobahPrincipal
TO [AughtEight\DagobahSQL];
GO

摘自:《SQL SERVER2008 DBA 入门》

posted @ 2011-12-20 17:16  _cc  阅读(354)  评论(0编辑  收藏  举报