[AlwaysOn] 创建SQL Server高可用性组T-SQL语法:AVAILABILITY GROUP ON子句

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 ALTER AVAILABILITY GROUP (Transact-SQL).

<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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/81227/viewspace-2654360/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值