[AlwaysOn] 建立SQL Server高可用性組T-SQL語法:AVAILABILITY GROUP ON子句

cow977發表於2019-08-21

AVAILABILITY GROUP ON

指定構成分散式可用性組的兩個可用性組。Specifies two availability groups that constitute a distributed availability group. 每個可用性組都是其自己的Windows Server故障轉移群集(WSFC)的一部分。Each availability group is part of its own Windows Server Failover Cluster (WSFC). 建立分散式可用性組時,當前SQL Server例項上的可用性組將成為主可用性組。When you create a distributed availability group, the availability group on the current SQL Server Instance becomes the primary availability group. 第二個可用性組成為第二個可用性組。The second availability group becomes the secondary availability group.

您需要將輔助可用性組加入到分散式可用性組中。You need to join the secondary availability group to the distributed availability group. 有關詳細資訊,請參閱alter availability group(Transact-SQL)。For more information, see .

<ag_name> 指定構成分散式可用性組一半的可用性組的名稱。<ag_name> Specifies the name of the availability group that makes up one half of the distributed availability group.

LISTENER ='TCP://system-address:port'

指定與可用性組關聯的偵聽器的URL路徑。Specifies the URL path for the listener associated with the availability group.

LISTENER 子句是必需的。The LISTENER clause is required.

'TCP://system-address:port'

指定與可用性組關聯的偵聽器的URL。Specifies a URL for the listener associated with the availability group. URL引數如下:The URL parameters are as follows:

system-address

是一個字串,例如系統名、完全限定的域名或IP地址,它明確標識偵聽器。Is a string, such as a system name, a fully qualified domain name, or an IP address, that unambiguously identifies the listener.

port

是與可用性組的映象端點關聯的埠號。Is a port number that is associated with the mirroring endpoint of the availability group. 注意,這不是偵聽器的埠。Note that this is not the port of the listener.

AVAILABILITY_MODE = { SYNCHRONOUS_COMMIT | ASYNCHRONOUS_COMMIT | CONFIGURATION_ONLY }

指定在主副本可以提交給定主資料庫上的事務之前,主副本是否必須等待輔助可用性組確認將日誌記錄硬化(寫入)到磁碟。Specifies whether the primary replica has to wait for the secondary availability group to acknowledge the hardening (writing) of the log records to disk before the primary replica can commit the transaction on a given primary database.

同步提交 SYNCHRONOUS_COMMIT

指定主副本等待提交事務,直到在輔助可用性組上對它們進行了固化。Specifies that the primary replica waits to commit transactions until they have been hardened on the secondary availability group.您可以為最多兩個可用性組(包括主可用性組)指定同步提交。You can specify SYNCHRONOUS_COMMIT for up to two availability groups, including the primary availability group.

非同步提交 ASYNCHRONOUS_COMMIT

指定主副本提交事務,而不必等待此輔助可用性組固化日誌。Specifies that the primary replica commits transactions without waiting for this secondary availability group to harden the log. 您可以為最多兩個可用性組(包括主可用性組)指定非同步提交。You can specify ASYNCHRONOUS_COMMIT for up to two availability groups, including the primary availability group.

AVAILABILITY_MODE 子句是必需的。The AVAILABILITY_MODE clause is required.

FAILOVER_MODE = { MANUAL }

指定分散式可用性組的故障轉移模式。Specifies the failover mode of the distributed availability group.

手動 MANUAL

啟用資料庫管理員計劃的手動故障轉移或強制的手動故障轉移(通常稱為強制故障轉移)。Enables planned manual failover or forced manual failover (typically called forced failover) by the database administrator.

FAILOVER_MODE 子句是必需的,唯一的選項是手動。The FAILOVER_MODE clause is required, and the only option is MANUAL. 不支援自動故障轉移到輔助可用性組。Automatic failover to the secondary availability group is not supported.

SEEDING_MODE = { AUTOMATIC | MANUAL }

指定輔助可用性組最初的種子設定方式。Specifies how the secondary availability group is initially seeded.

自動 AUTOMATIC

啟用直接播種。Enables direct seeding. 此方法透過網路為輔助可用性組種子。This method seeds the secondary availability group over the network. 此方法不需要備份和還原輔助可用性組副本上的主資料庫副本。This method does not require you to backup and restore a copy of the primary database on the replicas of the secondary availability group.

手動 MANUAL

設定手動播種(預設的)。Specifies manual seeding (default). 此方法要求您在原始複製品上建立一個資料庫備份,並手動恢復原始複製品上的備份。This method requires you to create a backup of the database on the primary replica and manually restore that backup on the replica(s) of the secondary availability group.


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/81227/viewspace-2654360/,如需轉載,請註明出處,否則將追究法律責任。

相關文章