Skip to content

Commit e4c49a2

Browse files
authored
Merge pull request #101170 from MashaMSFT/20200114_crosssubrepl
Added cross-sub geo-replication (AzB 1645790)
2 parents d938b18 + 8f93ed2 commit e4c49a2

File tree

4 files changed

+84
-8
lines changed

4 files changed

+84
-8
lines changed
34.6 KB
Loading

articles/sql-database/sql-database-active-geo-replication.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,79 @@ If you decide to create the secondary with lower compute size, the log IO percen
119119

120120
For more information on the SQL Database compute sizes, see [What are SQL Database Service Tiers](sql-database-purchase-models.md).
121121

122+
## Cross-subscription geo-replication
123+
124+
To setup active geo-replication between two databases belonging to different subscriptions (whether under the same tenant or not), you must follow the special procedure described in this section. The procedure is based on SQL commands and requires:
125+
126+
- Creating a privileged login on both servers
127+
- Adding the IP address to the allow list of the client performing the change on both servers (such as the IP address of the host running SQL Server Management Studio).
128+
129+
The client performing the changes needs network access to the primary server. Although the same IP address of the client must be added to the allow list on the secondary server, network connectivity to the secondary server is not strictly required.
130+
131+
### On the master of the primary server
132+
133+
1. Add the IP address to the allow list of the client performing the changes (for more information see, [Configure firewall](sql-database-firewall-configure.md)).
134+
1. Create a login dedicated to setup active geo-replication (and adjust the credentials as needed):
135+
136+
```sql
137+
create login geodrsetup with password = 'ComplexPassword01'
138+
```
139+
140+
1. Create a corresponding user and assign it to the dbmanager role:
141+
142+
```sql
143+
create user geodrsetup for login gedrsetup
144+
alter role geodrsetup dbmanager add member geodrsetup
145+
```
146+
147+
1. Take note of the SID of the new login using this query:
148+
149+
```sql
150+
select sid from sys.sql_logins where name = 'geodrsetup'
151+
```
152+
153+
### On the source database on the primary server
154+
155+
1. Create a user for the same login:
156+
157+
```sql
158+
create user geodrsetup for login geodrsetup
159+
```
160+
161+
1. Add the user to the db_owner role:
162+
163+
```sql
164+
alter role db_owner add member geodrsetup
165+
```
166+
167+
### On the master of the secondary server
168+
169+
1. Add the IP address to the allow list of the client performing the changes. It must the same exact IP address of the primary server.
170+
1. Create the same login as on the primary server, using the same username password, and SID:
171+
172+
```sql
173+
create login geodrsetup with password = 'ComplexPassword01', sid=0x010600000000006400000000000000001C98F52B95D9C84BBBA8578FACE37C3E
174+
```
175+
176+
1. Create a corresponding user and assign it to the dbmanager role:
177+
178+
```sql
179+
create user geodrsetup for login geodrsetup;
180+
alter role dbmanager add member geodrsetup
181+
```
182+
183+
### On the master of the primary server
184+
185+
1. Login to the master of the primary server using the new login.
186+
1. Create a secondary replica of the source database on the secondary server (adjust database name and servername as needed):
187+
188+
```sql
189+
alter database dbrep add secondary on server <servername>
190+
```
191+
192+
After the initial setup, the users, logins, and firewall rules created can be removed.
193+
194+
122195
## Keeping credentials and firewall rules in sync
123196

124197
We recommend using [database-level IP firewall rules](sql-database-firewall-configure.md) for geo-replicated databases so these rules can be replicated with the database to ensure all secondary databases have the same IP firewall rules as the primary. This approach eliminates the need for customers to manually configure and maintain firewall rules on servers hosting both the primary and secondary databases. Similarly, using [contained database users](sql-database-manage-logins.md) for data access ensures both primary and secondary databases always have the same user credentials so during a failover, there is no disruptions due to mismatches with logins and passwords. With the addition of [Azure Active Directory](../active-directory/fundamentals/active-directory-whatis.md), customers can manage user access to both primary and secondary databases and eliminating the need for managing credentials in databases altogether.

articles/sql-database/sql-database-scale-resources.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ All three flavors of Azure SQL Database offer some ability to dynamically scale
5050
- A [Managed Instance](sql-database-managed-instance.md) uses [vCores](sql-database-managed-instance.md#vcore-based-purchasing-model) mode and enables you to define maximum CPU cores and maximum of storage allocated to your instance. All databases within the instance will share the resources allocated to the instance.
5151
- [Elastic pools](sql-database-elastic-pool-scale.md) enable you to define maximum resource limit per group of databases in the pool.
5252

53-
Initiating scale up or scale down action in any of the flavors would restart database engine process and move it to a different virtual machine if needed. Moving database engine process to a new virtual machine is **online process** where you can continue using your existing Azure SQL Database service while the process is in progress. Once the target database engine is fully initialized and ready to process the queries, the connections will be [switched from source to target database engine](sql-database-single-database-scale.md#impact-of-changing-service-tier-or-rescaling-compute-size).
53+
Initiating scale up or scale down action in any of the flavors would restart database engine process and move it to a different virtual machine if needed. Moving database engine process to a new virtual machine is **online process** where you can continue using your existing Azure SQL Database service while the process is in progress. Once the target database engine is fully initialized and ready to process the queries, the connections will be [switched from source to target database engine](sql-database-single-database-scale.md#impact).
54+
5455

5556
> [!NOTE]
5657
> You can expect a short connection break when the scale up/scale down process is finished. If you have implemented [Retry logic for standard transient errors](sql-database-connectivity-issues.md#retry-logic-for-transient-errors), you will not notice the failover.

articles/sql-database/sql-database-single-database-scale.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ ms.date: 04/26/2019
1616

1717
This article describes how to scale the compute and storage resources available for an Azure SQL Database in the provisioned compute tier. Alternatively, the [serverless compute tier](sql-database-serverless.md) provides compute auto-scaling and bills per second for compute used.
1818

19-
## Change compute size (vCores or DTUs)
20-
2119
After initially picking the number of vCores or DTUs, you can scale a single database up or down dynamically based on actual experience using the [Azure portal](sql-database-single-databases-manage.md#manage-an-existing-sql-database-server), [Transact-SQL](https://docs.microsoft.com/sql/t-sql/statements/alter-database-transact-sql?view=azuresqldb-current#examples-1), [PowerShell](/powershell/module/az.sql/set-azsqldatabase), the [Azure CLI](/cli/azure/sql/db#az-sql-db-update), or the [REST API](https://docs.microsoft.com/rest/api/sql/databases/update).
2220

2321
The following video shows dynamically changing the service tier and compute size to increase available DTUs for a single database.
@@ -27,7 +25,7 @@ The following video shows dynamically changing the service tier and compute size
2725
> [!IMPORTANT]
2826
> Under some circumstances, you may need to shrink a database to reclaim unused space. For more information, see [Manage file space in Azure SQL Database](sql-database-file-space-management.md).
2927
30-
### Impact of changing service tier or rescaling compute size
28+
## Impact
3129

3230
Changing the service tier or compute size of mainly involves the service performing the following steps:
3331

@@ -42,7 +40,7 @@ Changing the service tier or compute size of mainly involves the service perform
4240
> [!IMPORTANT]
4341
> No data is lost during any step in the workflow. Make sure that you have implemented some [retry logic](sql-database-connectivity-issues.md) in the applications and components that are using Azure SQL Database while the service tier is changed.
4442
45-
### Latency of changing service tier or rescaling compute size
43+
## Latency
4644

4745
The estimated latency to change the service tier or rescale the compute size of a single database or elastic pool is parameterized as follows:
4846

@@ -55,7 +53,7 @@ The estimated latency to change the service tier or rescale the compute size of
5553
> [!TIP]
5654
> To monitor in-progress operations, see: [Manage operations using the SQL REST API](https://docs.microsoft.com/rest/api/sql/operations/list), [Manage operations using CLI](/cli/azure/sql/db/op), [Monitor operations using T-SQL](/sql/relational-databases/system-dynamic-management-views/sys-dm-operation-status-azure-sql-database) and these two PowerShell commands: [Get-AzSqlDatabaseActivity](/powershell/module/az.sql/get-azsqldatabaseactivity) and [Stop-AzSqlDatabaseActivity](/powershell/module/az.sql/stop-azsqldatabaseactivity).
5755
58-
### Cancelling service tier changes or compute rescaling operations
56+
## Cancelling changes
5957

6058
A service tier change or compute rescaling operation can be canceled.
6159

@@ -84,7 +82,7 @@ else {
8482
}
8583
```
8684

87-
### Additional considerations when changing service tier or rescaling compute size
85+
## Additional considerations
8886

8987
- If you are upgrading to a higher service tier or compute size, the database max size does not increase unless you explicitly specify a larger size (maxsize).
9088
- To downgrade a database, the database used space must be smaller than the maximum allowed size of the target service tier and compute size.
@@ -94,7 +92,7 @@ else {
9492
- The restore service offerings are different for the various service tiers. If you are downgrading to the **Basic** tier, there is a lower backup retention period. See [Azure SQL Database Backups](sql-database-automated-backups.md).
9593
- The new properties for the database are not applied until the changes are complete.
9694

97-
### Billing during compute rescaling
95+
## Billing
9896

9997
You are billed for each hour a database exists using the highest service tier + compute size that applied during that hour, regardless of usage or whether the database was active for less than an hour. For example, if you create a single database and delete it five minutes later your bill reflects a charge for one database hour.
10098

@@ -120,6 +118,10 @@ You are billed for each hour a database exists using the highest service tier +
120118
> [!IMPORTANT]
121119
> Under some circumstances, you may need to shrink a database to reclaim unused space. For more information, see [Manage file space in Azure SQL Database](sql-database-file-space-management.md).
122120
121+
### Geo-replicated database
122+
123+
To change the database size of a replicated secondary database, change the size of the primary database. This change will then be replicated and implemented on the secondary database as well.
124+
123125
## P11 and P15 constraints when max size greater than 1 TB
124126

125127
More than 1 TB of storage in the Premium tier is currently available in all regions except: China East, China North, Germany Central, Germany Northeast, West Central US, US DoD regions, and US Government Central. In these regions, the storage max in the Premium tier is limited to 1 TB. The following considerations and limitations apply to P11 and P15 databases with a maximum size greater than 1 TB:

0 commit comments

Comments
 (0)