开发学院数据库MSSQL Server Microsoft SQL Server 2005数据库镜像语句 阅读

Microsoft SQL Server 2005数据库镜像语句

 2008-11-10 10:10:20 来源:WEB开发网   
核心提示:Microsoft SQL Server 2005数据库镜像语句: SERVER 1CREATE ENDPOINT DbMirroringSTATE=STARTEDAS TCP(LISTENER_PORT=5023)FOR DATABASE_MIRRORING(ROLE=PARTNER,ENCRYPTION=SUPPO

Microsoft SQL Server 2005数据库镜像语句:

  SERVER 1
  CREATE ENDPOINT DbMirroring
  STATE=STARTED
  AS TCP(LISTENER_PORT=5023)
  FOR DATABASE_MIRRORING(ROLE=PARTNER,ENCRYPTION=SUPPORTED)
  ALTER DATABASE AdventureWorks SET PARTNER='TCP://192.168.5.106:5022'
  SERVER 2
  CREATE ENDPOINT DbMirroring
  STATE=STARTED
  AS TCP(LISTENER_PORT=5022)
  FOR DATABASE_MIRRORING(ROLE=PARTNER,ENCRYPTION=SUPPORTED)
  ALTER DATABASE AdventureWorks SET PARTNER='TCP://192.168.5.106:5023'

见证服务器

  CREATE ENDPOINT DbMirroring
  STATE=STARTED
  AS TCP(LISTENER_PORT=5033)
  FOR DATABASE_MIRRORING(ROLE=WITNESS,ENCRYPTION=SUPPORTED)
  ALTER DATABASE AdventureWorks SET PARTNER='TCP://192.168.5.106:5033'

执行下面的代码就可以将镜像服务器设为主体服务器,主体服务器设置为镜像服务器:

  USE MASTER
  Go
  ALTER DATABASE AdventureWorks SET PARTNER FAILOVER
  Go

Tags:Microsoft SQL Server

编辑录入:爽爽 [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接