Microsoft SQL Server
SERVER
CREATE ENDPOINT DbMirroring
STATE=STARTED
AS TCP(LISTENER_PORT=
FOR DATABASE_MIRRORING(ROLE=PARTNER
ALTER DATABASE AdventureWorks SET PARTNER=
SERVER
CREATE ENDPOINT DbMirroring
STATE=STARTED
AS TCP(LISTENER_PORT=
FOR DATABASE_MIRRORING(ROLE=PARTNER
ALTER DATABASE AdventureWorks SET PARTNER=
見證服務器
CREATE ENDPOINT DbMirroring
STATE=STARTED
AS TCP(LISTENER_PORT=
FOR DATABASE_MIRRORING(ROLE=WITNESS
ALTER DATABASE AdventureWorks SET PARTNER=
執行下面的代碼就可以將鏡像服務器設為主體服務器
USE MASTER
Go
ALTER DATABASE AdventureWorks SET PARTNER FAILOVER
Go
From:http://tw.wingwit.com/Article/program/SQLServer/201311/22360.html