熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> SQL Server >> 正文

Microsoft SQL Server 2005數據庫鏡像語句

2013-11-15 14:48:30  來源: SQL Server 

  Microsoft SQL Server 數據庫鏡像語句:

  SERVER

  CREATE ENDPOINT DbMirroring
  STATE=STARTED
  AS TCP(LISTENER_PORT=)
  FOR DATABASE_MIRRORING(ROLE=PARTNERENCRYPTION=SUPPORTED)
  ALTER DATABASE AdventureWorks SET PARTNER=TCP://:

  SERVER

  CREATE ENDPOINT DbMirroring
  STATE=STARTED
  AS TCP(LISTENER_PORT=)
  FOR DATABASE_MIRRORING(ROLE=PARTNERENCRYPTION=SUPPORTED)
  ALTER DATABASE AdventureWorks SET PARTNER=TCP://:

  見證服務器

  CREATE ENDPOINT DbMirroring
  STATE=STARTED
  AS TCP(LISTENER_PORT=)
  FOR DATABASE_MIRRORING(ROLE=WITNESSENCRYPTION=SUPPORTED)
  ALTER DATABASE AdventureWorks SET PARTNER=TCP://:

  執行下面的代碼就可以將鏡像服務器設為主體服務器主體服務器設置為鏡像服務器:

  USE MASTER
  Go
  ALTER DATABASE AdventureWorks SET PARTNER FAILOVER
  Go


From:http://tw.wingwit.com/Article/program/SQLServer/201311/22360.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.