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

发布时间:2020-08-09 12:06:53 作者:cow977
来源:ITPUB博客 阅读:206

REPLICA ON

指定从1到5个SQL Server实例来承载新可用性组中的可用性副本。Specifies from one to five SQL server instances to host availability replicas in the new availability group. 每个副本都由其服务器实例地址指定,后跟一个WITH(…)子句。Each replica is specified by its server instance address followed by a WITH (...) clause. 至少,必须指定本地服务器实例,该实例将成为初始主副本。Minimally, you must specify your local server instance, which becomes the initial primary replica. 或者,您还可以指定最多四个辅助副本。Optionally, you can also specify up to four secondary replicas.

您需要将每个辅助副本加入到可用性组中。You need to join every secondary replica to the availability group. 有关详细信息,请参阅alter availability group(Transact-SQL)。For more information, see ALTER AVAILABILITY GROUP (Transact-SQL).

注释 Note

如果在创建可用性组时指定的辅助副本少于四个,则可以随时使用alter availability group T-SQL语句指定其他辅助副本。If you specify less than four secondary replicas when you create an availability group, you can an additional secondary replica at any time by using the ALTER AVAILABILITY GROUP Transact-SQL statement. 您还可以使用此语句从现有可用性组中删除任何辅助副本。You can also use this statement this remove any secondary replica from an existing availability group.

<server_instance> 指定作为副本主机的SQL Server实例的地址。 <server_instance> Specifies the address of the instance of SQL Server that is the host for an replica.地址格式取决于实例是默认实例还是命名实例,以及它是独立实例还是故障转移群集实例(FCI),如下所示:The address format depends on whether the instance is the default instance or a named instance and whether it is a standalone instance or a failover cluster instance (FCI), as follows:

{ 'system_name[\instance_name]' | 'FCI_network_name[\instance_name]' }

此地址的组成部分如下:The components of this address are as follows:

system_name

是目标SQL Server实例所在的计算机系统的NetBIOS名称。Is the NetBIOS name of the computer system on which the target instance of SQL Server resides. 此计算机必须是WSFC节点。This computer must be a WSFC node.

FCI_network_name

用于访问SQL Server故障转移群集的网络名称。Is the network name that is used to access a SQL Server failover cluster. 如果服务器实例作为SQL Server故障转移伙伴参与,请使用此选项。Use this if the server instance participates as a SQL Server failover partner. 在FCI服务器实例上执行select @@servername将返回其整个“fci_network_name[\instance_name]”字符串(即完整副本名)。Executing SELECT @@SERVERNAME on an FCI server instance returns its entire ' FCI_network_name[\ instance_name]' string (which is the full replica name).

instance_name

是由系统名称或FCI网络名称托管且已启用HADR服务的SQL Server实例的名称。Is the name of an instance of a SQL Server that is hosted by system_name or FCI_network_name and that has HADR service is enabled. 对于默认服务器实例,实例名称是可选的。For a default server instance, instance_name is optional. 实例名不区分大小写。The instance name is case insensitive. 在独立服务器实例上,该值名称与执行select @@servername返回的值相同。On a stand-alone server instance, this value name is the same as the value returned by executing SELECT @@SERVERNAME.

\

是仅在指定实例名称时使用的分隔符,以便将其与系统名称或FCI网络名称分隔开。Is a separator used only when specifying instance_name, in order to separate it from system_name or FCI_network_name.

有关WSFC节点和服务器实例的先决条件的信息,请参阅有关“始终在线”可用性组(SQL Server)的先决条件、限制和建议。For information about the prerequisites for WSFC nodes and server instances, see Prerequisites, Restrictions, and Recommendations for Always On Availability Groups (SQL Server).

推荐阅读:
  1. 使用alwayson后收缩数据库日志的方法
  2. mysql 中如何表示不等于符号

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

alwayson 语法 高可

上一篇:【80/90年代共同记忆!】用容器技术重温经典,复活坦克大战!

下一篇:为什么数字化转型不仅需要技术,也需要人的改变?

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》