Skip to content

Commit 03ead2f

Browse files
author
Steve Stein
authored
Merge pull request #664 from stummsft/live
Updates and fixes for disitributed availability groups
2 parents d9d6658 + b700739 commit 03ead2f

2 files changed

Lines changed: 75 additions & 68 deletions

File tree

docs/t-sql/statements/alter-availability-group-transact-sql.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ ALTER AVAILABILITY GROUP group_name
5353
| GRANT CREATE ANY DATABASE
5454
| DENY CREATE ANY DATABASE
5555
| FAILOVER
56-
| FORCE_FAILOVER_ALLOW_DATA_LOSS | ADD LISTENER ‘dns_name’ ( <add_listener_option> )
56+
| FORCE_FAILOVER_ALLOW_DATA_LOSS
57+
| ADD LISTENER ‘dns_name’ ( <add_listener_option> )
5758
| MODIFY LISTENER ‘dns_name’ ( <modify_listener_option> )
5859
| RESTART LISTENER ‘dns_name’
5960
| REMOVE LISTENER ‘dns_name’
@@ -124,7 +125,7 @@ ALTER AVAILABILITY GROUP group_name
124125
<modify_availability_group_spec>::=
125126
<ag_name> WITH
126127
(
127-
LISTENER = 'TCP://system-address:port'
128+
LISTENER_URL = 'TCP://system-address:port'
128129
| AVAILABILITY_MODE = { SYNCHRONOUS_COMMIT | ASYNCHRONOUS_COMMIT }
129130
| SEEDING_MODE = { AUTOMATIC | MANUAL }
130131
)
@@ -469,15 +470,15 @@ Initiates a manual failover of the availability group without data loss to the s
469470
> NetBIOS recognizes only the first 15 chars in the dns_name. If you have two WSFC clusters that are controlled by the same Active Directory and you try to create availability group listeners in both of clusters using names with more than 15 characters and an identical 15 character prefix, you will get an error reporting that the Virtual Network Name resource could not be brought online. For information about prefix naming rules for DNS names, see [Assigning Domain Names](http://technet.microsoft.com/library/cc731265\(WS.10\).aspx).
470471
471472
JOIN AVAILABILITY GROUP ON
472-
Joins to a *distributed availability group*. When you create a distributed availability group, the availability group on the cluster where it is created is the primary availability group. The availability group that joins the distributed availability group is the secondary availability group.
473+
Joins to a *distributed availability group*. When you create a distributed availability group, the availability group on the cluster where it is created is the primary availability group. When you execute JOIN, the local server instance's availability group is the secondary availability group.
473474

474475
\<ag_name>
475476
Specifies the name of the availability group that makes up one half of the distributed availability group.
476477

477-
LISTENER **='**TCP**://***system-address***:***port***'**
478+
LISTENER_URL **='**TCP**://***system-address***:***port***'**
478479
Specifies the URL path for the listener associated with the availability group.
479480

480-
The LISTENER clause is required.
481+
The LISTENER_URL clause is required.
481482

482483
**'**TCP**://***system-address***:***port***'**
483484
Specifies a URL for the listener associated with the availability group. The URL parameters are as follows:
@@ -486,7 +487,7 @@ Initiates a manual failover of the availability group without data loss to the s
486487
Is a string, such as a system name, a fully qualified domain name, or an IP address, that unambiguously identifies the listener.
487488

488489
*port*
489-
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.
490+
Is a port number that is associated with the mirroring endpoint of the availability group. Note that this is not the port for client connectivity that is configured on the listener.
490491

491492
AVAILABILITY_MODE **=** { SYNCHRONOUS_COMMIT | ASYNCHRONOUS_COMMIT }
492493
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.

docs/t-sql/statements/create-availability-group-transact-sql.md

Lines changed: 68 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -45,70 +45,76 @@ manager: craigg
4545
```SQL
4646

4747
CREATE AVAILABILITY GROUP group_name
48-
WITH (<with_option_spec> [ ,...n ] )
49-
FOR [ DATABASE database_name [ ,...n ] ]
50-
REPLICA ON <add_replica_spec> [ ,...n ]
51-
AVAILABILITY GROUP ON <add_availability_group_spec> [ ,...2 ]
52-
[ LISTENER ‘dns_name’ ( <listener_option> ) ]
48+
{ <availability_group_spec> | <distributed_availability_group_spec> }
5349
[ ; ]
54-
55-
<with_option_spec>::=
56-
AUTOMATED_BACKUP_PREFERENCE = { PRIMARY | SECONDARY_ONLY| SECONDARY | NONE }
57-
| FAILURE_CONDITION_LEVEL = { 1 | 2 | 3 | 4 | 5 }
58-
| HEALTH_CHECK_TIMEOUT = milliseconds
59-
| DB_FAILOVER = { ON | OFF }
60-
| DTC_SUPPORT = { PER_DB | NONE }
61-
| BASIC
62-
| DISTRIBUTED
63-
| REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT = { integer }
64-
| CLUSTER_TYPE = { WSFC | EXTERNAL | NONE }
65-
66-
<add_replica_spec>::=
67-
<server_instance> WITH
68-
(
69-
ENDPOINT_URL = 'TCP://system-address:port',
70-
AVAILABILITY_MODE = { SYNCHRONOUS_COMMIT | ASYNCHRONOUS_COMMIT | CONFIGURATION_ONLY },
71-
FAILOVER_MODE = { AUTOMATIC | MANUAL | EXTERNAL }
72-
[ , <add_replica_option> [ ,...n ] ]
73-
)
74-
75-
<add_replica_option>::=
76-
SEEDING_MODE = { AUTOMATIC | MANUAL }
77-
| BACKUP_PRIORITY = n
78-
| SECONDARY_ROLE ( {
79-
[ ALLOW_CONNECTIONS = { NO | READ_ONLY | ALL } ]
80-
[,] [ READ_ONLY_ROUTING_URL = 'TCP://system-address:port' ]
81-
} )
82-
| PRIMARY_ROLE ( {
83-
[ ALLOW_CONNECTIONS = { READ_WRITE | ALL } ]
84-
[,] [ READ_ONLY_ROUTING_LIST = { ( ‘<server_instance>’ [ ,...n ] ) | NONE } ]
85-
} )
86-
| SESSION_TIMEOUT = integer
87-
88-
<add_availability_group_spec>::=
89-
<ag_name> WITH
50+
51+
<availability_group_spec>::=
52+
[ WITH (<with_option_spec> [ ,...n ] ) ]
53+
FOR [ DATABASE database_name [ ,...n ] ]
54+
REPLICA ON <add_replica_spec> [ ,...n ]
55+
[ LISTENER ‘dns_name’ ( <listener_option> ) ]
56+
57+
<with_option_spec>::=
58+
AUTOMATED_BACKUP_PREFERENCE = { PRIMARY | SECONDARY_ONLY| SECONDARY | NONE }
59+
| FAILURE_CONDITION_LEVEL = { 1 | 2 | 3 | 4 | 5 }
60+
| HEALTH_CHECK_TIMEOUT = milliseconds
61+
| DB_FAILOVER = { ON | OFF }
62+
| DTC_SUPPORT = { PER_DB | NONE }
63+
| BASIC
64+
| REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT = { integer }
65+
| CLUSTER_TYPE = { WSFC | EXTERNAL | NONE }
66+
67+
<add_replica_spec>::=
68+
<server_instance> WITH
69+
(
70+
ENDPOINT_URL = 'TCP://system-address:port',
71+
AVAILABILITY_MODE = { SYNCHRONOUS_COMMIT | ASYNCHRONOUS_COMMIT | CONFIGURATION_ONLY },
72+
FAILOVER_MODE = { AUTOMATIC | MANUAL | EXTERNAL }
73+
[ , <add_replica_option> [ ,...n ] ]
74+
)
75+
76+
<add_replica_option>::=
77+
SEEDING_MODE = { AUTOMATIC | MANUAL }
78+
| BACKUP_PRIORITY = n
79+
| SECONDARY_ROLE ( {
80+
[ ALLOW_CONNECTIONS = { NO | READ_ONLY | ALL } ]
81+
[,] [ READ_ONLY_ROUTING_URL = 'TCP://system-address:port' ]
82+
} )
83+
| PRIMARY_ROLE ( {
84+
[ ALLOW_CONNECTIONS = { READ_WRITE | ALL } ]
85+
[,] [ READ_ONLY_ROUTING_LIST = { ( ‘<server_instance>’ [ ,...n ] ) | NONE } ]
86+
} )
87+
| SESSION_TIMEOUT = integer
88+
89+
<listener_option> ::=
90+
{
91+
WITH DHCP [ ON ( <network_subnet_option> ) ]
92+
| WITH IP ( { ( <ip_address_option> ) } [ , ...n ] ) [ , PORT = listener_port ]
93+
}
94+
95+
<network_subnet_option> ::=
96+
‘four_part_ipv4_address’, ‘four_part_ipv4_mask’
97+
98+
<ip_address_option> ::=
99+
{
100+
‘four_part_ipv4_address’, ‘four_part_ipv4_mask’
101+
| ‘ipv6_address’
102+
}
103+
104+
<distributed_availability_group_spec>::=
105+
WITH (DISTRIBUTED)
106+
AVAILABILITY GROUP ON <add_availability_group_spec> [ ,...2 ]
107+
108+
<add_availability_group_spec>::=
109+
<ag_name> WITH
90110
(
91-
LISTENER_URL = 'TCP://system-address:port',
92-
AVAILABILITY_MODE = { SYNCHRONOUS_COMMIT | ASYNCHRONOUS_COMMIT },
93-
FAILOVER_MODE = MANUAL,
94-
SEEDING_MODE = { AUTOMATIC | MANUAL }
111+
LISTENER_URL = 'TCP://system-address:port',
112+
AVAILABILITY_MODE = { SYNCHRONOUS_COMMIT | ASYNCHRONOUS_COMMIT },
113+
FAILOVER_MODE = MANUAL,
114+
SEEDING_MODE = { AUTOMATIC | MANUAL }
95115
)
96116

97-
<listener_option> ::=
98-
{
99-
WITH DHCP [ ON ( <network_subnet_option> ) ]
100-
| WITH IP ( { ( <ip_address_option> ) } [ , ...n ] ) [ , PORT = listener_port ]
101-
}
102-
103-
<network_subnet_option> ::=
104-
‘four_part_ipv4_address’, ‘four_part_ipv4_mask’
105-
106-
<ip_address_option> ::=
107-
{
108-
‘four_part_ipv4_address’, ‘four_part_ipv4_mask’
109-
| ‘ipv6_address’
110-
}
111-
117+
112118
```
113119

114120
## Arguments
@@ -179,7 +185,7 @@ CREATE AVAILABILITY GROUP group_name
179185
Used to create a basic availability group. Basic availability groups are limited to one database and two replicas: a primary replica and one secondary replica. This option is a replacement for the deprecated database mirroring feature on SQL Server Standard Edition. For more information, see [Basic Availability Groups &#40;Always On Availability Groups&#41;](../../database-engine/availability-groups/windows/basic-availability-groups-always-on-availability-groups.md). Basic availability groups are supported beginning in [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)].
180186

181187
DISTRIBUTED
182-
Used to create a distributed availability group. This option is used with the AVAILABILITY GROUP ON parameter to connect two availability groups in separate Windows Server Failover Clusters. For more information, see [Distributed Availability Groups &#40;Always On Availability Groups&#41;](../../database-engine/availability-groups/windows/distributed-availability-groups-always-on-availability-groups.md). Distributed availability groups are supported beginning in [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)].
188+
Used to create a distributed availability group. The DISTRIBUTED option cannot be combined with any other options or clauses. This option is used with the AVAILABILITY GROUP ON parameter to connect two availability groups in separate Windows Server Failover Clusters. For more information, see [Distributed Availability Groups &#40;Always On Availability Groups&#41;](../../database-engine/availability-groups/windows/distributed-availability-groups-always-on-availability-groups.md). Distributed availability groups are supported beginning in [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)].
183189

184190
REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT
185191
Introduced in SQL Server 2017. Used to set a minimum number of synchronous secondary replicas required to commit before the primary commits a transaction. Guarantees that SQL Server transaction waits until the transaction logs are updated on the minimum number of secondary replicas. The default is 0 which gives the same behavior as SQL Server 2016. The minimum value is 0. The maximum value is the number of replicas minus 1. This option relates to replicas in synchronous commit mode. When replicas are in synchronous commit mode, writes on the primary replica wait until writes on the secondary synchronous replicas are committed to the replica database transaction log. If a SQL Server that hosts a secondary synchronous replica stops responding, the SQL Server that hosts the primary replica marks that secondary replica as NOT SYNCHRONIZED and proceed. When the unresponsive database comes back online it is in a "not synced" state and the replica marked as unhealthy until the primary can make it synchronous again. This setting guarantees that the primary replica waits until the minimum number of replicas have committed each transaction. If the minimum number of replicas is not available then commits on the primary fail. For cluster type `EXTERNAL` the setting is changed when the availability group is added to a cluster resource. See [High availability and data protection for availability group configurations](../../linux/sql-server-linux-availability-group-ha.md).
@@ -367,7 +373,7 @@ CREATE AVAILABILITY GROUP group_name
367373
For more information about the session-timeout period, see [Overview of Always On Availability Groups &#40;SQL Server&#41;](../../database-engine/availability-groups/windows/overview-of-always-on-availability-groups-sql-server.md).
368374

369375
AVAILABILITY GROUP ON
370-
Specifies two availability groups that constitute a *distributed availability group*. Each availability group is part of its own Windows Server Failover Cluster (WSFC). 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.
376+
Specifies two availability groups that constitute a *distributed availability group*. Each availability group is part of its own Windows Server Failover Cluster (WSFC). When you create a distributed availability group, the availability group on the current SQL Server Instance becomes the primary availability group and the remote availability group becomes the secondary availability group.
371377

372378
You need to join the secondary availability group to the distributed availability group. For more information, see [ALTER AVAILABILITY GROUP &#40;Transact-SQL&#41;](../../t-sql/statements/alter-availability-group-transact-sql.md).
373379

0 commit comments

Comments
 (0)