Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[AlwaysOn] create SQL Server high availability group T-SQL syntax: REPLICA ON clause

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

REPLICA ON

Specify from 1 to 5 SQL Server instances to host availability copies in the new availability group. Specifies from one to five SQL server instances to host availability replicas in the new availability group. Each copy is specified by its server instance address, followed by a WITH (...) Clause. Each replica is specified by its server instance address followed by a WITH (...) Clause. At a minimum, you must specify a local server instance, which will be the initial master copy. Minimally, you must specify your local server instance, which becomes the initial primary replica. Alternatively, you can specify up to four secondary copies. Optionally, you can also specify up to four secondary replicas.

You need to add each secondary copy to the availability group. You need to join every secondary replica to the availability group. For more information, see alter availability group (Transact-SQL). For more information, see ALTER AVAILABILITY GROUP (Transact-SQL).

Comment Note

If you specify fewer than four secondary copies when you create an availability group, you can specify additional secondary copies at any time using the alter availability group T-SQL statement. 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 to remove any secondary copies from an existing availability group. You can also use this statement this remove any secondary replica from an existing availability group.

Specifies the address of the SQL Server instance that is the replica host. Specifies the address of the instance of SQL Server that is the host for an replica. The address format depends on whether the instance is a default instance or a named instance, and whether it is a stand-alone instance or a failover cluster instance (FCI), as follows: 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: The components of this address are as follows:

System_name

Is the NetBIOS name of the computer system on which the target SQL Server instance resides. Is the NetBIOS name of the computer system on which the target instance of SQL Server resides. This computer must be a WSFC node. This computer must be a WSFC node.

FCI_network_name

The network name used to access the SQL Server failover cluster. Is the network name that is used to access a SQL Server failover cluster. Use this option if the server instance participates as a SQL Server failover partner. Use this if the server instance participates as a SQL Server failover partner. Executing select @ @ servername on the FCI server instance returns its entire "fci_network_ name [\ instance_name]" string (that is, the full copy 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

Is the name of a SQL Server instance that is hosted by a system name or FCI network name and has HADR services enabled. 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 the default server instance, the instance name is optional. For a default server instance, instance_name is optional. The instance name is case-insensitive. The instance name is case insensitive. On a stand-alone server instance, the value name is the same as the value returned by executing select @ @ servername. On a stand-alone server instance, this value name is the same as the value returned by executing SELECT @ @ SERVERNAME.

\

Is a delimiter that is used only when specifying an instance name to separate it from the system name or FCI network name. Is a separator used only when specifying instance_name, in order to separate it from system_name or FCI_network_name.

For information about prerequisites for WSFC nodes and server instances, see prerequisites, limitations, and recommendations for always online availability groups (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).

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report