You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: azure-sql/azure-hybrid-benefit.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,8 +120,10 @@ SQL Database and SQL Managed Instance customers have the following rights associ
120
120
121
121
|License footprint|What does Azure Hybrid Benefit for SQL Server get you?|
122
122
|---|---|
123
-
|SQL Server Enterprise Edition core customers with SA|<li>Can pay base rate on Hyperscale, General Purpose, or Business Critical SKU</li><br><li>One core on-premises = Four vCores in Hyperscale SKU</li><br><li>One core on-premises = Four vCores in General Purpose SKU</li><br><li>One core on-premises = One vCore in Business Critical SKU</li>|
124
-
|SQL Server Standard Edition core customers with SA|<li>Can pay base rate on Hyperscale, General Purpose, or Business Critical SKU</li><br><li>One core on-premises = One vCore in Hyperscale SKU</li><br><li>One core on-premises = One vCore in General Purpose SKU</li><br><li>Four cores on-premises = One vCore in Business Critical SKU</li>|
123
+
|SQL Server Enterprise Edition core customers with SA|<li>Can pay base rate on Hyperscale, General Purpose, or Business Critical SKU</li><br><li>One core on-premises = Four vCores in Hyperscale SKU<sup>1</sup></li><br><li>One core on-premises = Four vCores in General Purpose SKU</li><br><li>One core on-premises = One vCore in Business Critical SKU</li>|
124
+
|SQL Server Standard Edition core customers with SA|<li>Can pay base rate on Hyperscale, General Purpose, or Business Critical SKU</li><br><li>One core on-premises = One vCore in Hyperscale SKU<sup>1</sup></li><br><li>One core on-premises = One vCore in General Purpose SKU</li><br><li>Four cores on-premises = One vCore in Business Critical SKU</li>|
125
+
126
+
<sup>1</sup> Simplified pricing for SQL Database Hyperscale coming soon. Review the [Hyperscale pricing blog](https://aka.ms/hsignite2023) for details.
# Tutorial: Configure active geo-replication and failover (Azure SQL Database)
16
14
@@ -33,6 +31,8 @@ To add a secondary database, you must be the subscription owner or co-owner.
33
31
The secondary database has the same name as the primary database and has, by default, the same service tier and compute size. The secondary database can be a single database or a pooled database. For more information, see [DTU-based purchasing model](service-tiers-dtu.md) and [vCore-based purchasing model](service-tiers-vcore.md).
34
32
After the secondary is created and seeded, data begins replicating from the primary database to the new secondary database.
35
33
34
+
If your secondary replica is used _only_ for disaster recovery (DR) and doesn't have any read or write workloads, you can save on licensing costs by designating the database for standby when you configure a new active geo-replication relationship. Review [license-free standby replica](standby-replica-how-to-configure.md) to learn more.
35
+
36
36
> [!NOTE]
37
37
> If the partner database already exists, (for example, as a result of terminating a previous geo-replication relationship) the command fails.
38
38
@@ -42,27 +42,27 @@ After the secondary is created and seeded, data begins replicating from the prim
42
42
43
43
2. On the SQL Database page, select your database, scroll to **Data management**, select **Replicas**, and then select **Create replica**.
:::image type="content" source="media/active-geo-replication-configure-portal/azure-cli-create-geo-replica.png" alt-text="Screenshot that shows the Configure geo-replication option.":::
46
46
47
47
3. Select or create the server for the secondary database, and configure the **Compute + storage** options if necessary. You can select any region for your secondary server, but we recommend the [paired region](/azure/availability-zones/cross-region-replication-azure).
:::image type="content" source="media/active-geo-replication-configure-portal/azure-portal-create-and-configure-replica.png" alt-text="Screenshot that shows the Create and configure replica screen." lightbox="media/active-geo-replication-configure-portal/azure-portal-create-and-configure-replica.png":::
50
50
51
51
Optionally, you can add a secondary database to an elastic pool. To create the secondary database in a pool, select **Yes** next to **Want to use SQL elastic pool?** and select a pool on the target server. A pool must already exist on the target server. This workflow doesn't create a pool.
52
52
53
53
4. Click **Review + create**, review the information, and then click **Create**.
54
54
55
55
5. The secondary database is created and the deployment process begins.
56
56
57
-
:::image type="content" source="./media/active-geo-replication-configure-portal/azure-portal-geo-replica-deployment.png" alt-text="Screenshot that shows the deployment status of the secondary database.":::
57
+
:::image type="content" source="media/active-geo-replication-configure-portal/azure-portal-geo-replica-deployment.png" alt-text="Screenshot that shows the deployment status of the secondary database." lightbox="media/active-geo-replication-configure-portal/azure-portal-geo-replica-deployment.png":::
58
58
59
59
6. When the deployment is complete, the secondary database displays its status.
60
60
61
-
:::image type="content" source="./media/active-geo-replication-configure-portal/azure-portal-sql-database-secondary-status.png" alt-text="Screenshot that shows the secondary database status after deployment.":::
61
+
:::image type="content" source="media/active-geo-replication-configure-portal/azure-portal-sql-database-secondary-status.png" alt-text="Screenshot that shows the secondary database status after deployment." lightbox="media/active-geo-replication-configure-portal/azure-portal-sql-database-secondary-status.png":::
62
62
63
63
7. Return to the primary database page, and then select **Replicas**. Your secondary database is listed under **Geo replicas**.
64
64
65
-
:::image type="content" source="./media/active-geo-replication-configure-portal/azure-sql-db-geo-replica-list.png" alt-text="Screenshot that shows the SQL database primary and geo replicas.":::
65
+
:::image type="content" source="media/active-geo-replication-configure-portal/azure-sql-db-geo-replica-list.png" alt-text="Screenshot that shows the SQL database primary and geo replicas.":::
66
66
67
67
# [Azure CLI](#tab/azure-cli)
68
68
@@ -152,7 +152,7 @@ The secondary database can be switched to become the primary.
152
152
2. Scroll to **Data management**, and then select **Replicas**.
153
153
3. In the **Geo replicas** list, select the database you want to become the new primary, select the ellipsis, and then select **Forced failover**.
154
154
155
-
:::image type="content" source="./media/active-geo-replication-configure-portal/azure-portal-select-forced-failover.png" alt-text="Screenshot that shows selecting forced failover from the drop-down.":::
155
+
:::image type="content" source="media/active-geo-replication-configure-portal/azure-portal-select-forced-failover.png" alt-text="Screenshot that shows selecting forced failover from the drop-down." lightbox="media/active-geo-replication-configure-portal/azure-portal-select-forced-failover.png":::
Use Transact-SQL (T-SQL) create a geo-secondary in a subscription different from the subscription of the primary (whether under the same tenant of Microsoft Entra ID ([formerly Azure Active Directory](/azure/active-directory/fundamentals/new-name)) or not), follow the steps in this section.
232
+
233
+
1. Add the IP address of the client machine executing the T-SQL commands in this example, to the server firewalls of **both** the primary and secondary servers. You can confirm that IP address by executing the following query while connected to the primary server from the same client machine.
For more information, see [Configure firewall](firewall-configure.md).
240
+
241
+
2. In the `master` database on the **primary** server, create a SQL authentication login dedicated to active geo-replication setup. Adjust login name and password as needed.
242
+
243
+
```sql
244
+
create login geodrsetup with password ='ComplexPassword01';
245
+
```
246
+
247
+
3. In the same database, create a user for the login, and add it to the `dbmanager` role:
248
+
249
+
```sql
250
+
createusergeodrsetup for login geodrsetup;
251
+
alter role dbmanager add member geodrsetup;
252
+
```
253
+
254
+
4. Take note of the SID value of the new login. Obtain the SID value using the following query.
255
+
256
+
```sql
257
+
select sid fromsys.sql_loginswhere name ='geodrsetup';
258
+
```
259
+
260
+
5. Connect to the **primary** database (not the `master` database), and create a user for the same login.
261
+
262
+
```sql
263
+
createusergeodrsetup for login geodrsetup;
264
+
```
265
+
266
+
6. In the same database, add the user to the `db_owner` role.
267
+
268
+
```sql
269
+
alter role db_owner add member geodrsetup;
270
+
```
271
+
272
+
7. In the `master` database on the **secondary** server, create the same login as on the primary server, using the same name, password, and SID. Replace the hexadecimal SID value in the sample command below with the one obtained in Step 4.
273
+
274
+
```sql
275
+
create login geodrsetup with password ='ComplexPassword01', sid=0x010600000000006400000000000000001C98F52B95D9C84BBBA8578FACE37C3E;
276
+
```
277
+
278
+
8. In the same database, create a user for the login, and add it to the `dbmanager` role.
279
+
280
+
```sql
281
+
createusergeodrsetup for login geodrsetup;
282
+
alter role dbmanager add member geodrsetup;
283
+
```
284
+
285
+
9. Connect to the `master` database on the **primary** server using the new `geodrsetup` login, and initiate geo-secondary creation on the secondary server. Adjust database name and secondary server name as needed. Once the command is executed, you can monitor geo-secondary creation by querying the [sys.dm_geo_replication_link_status](/sql/relational-databases/system-dynamic-management-views/sys-dm-geo-replication-link-status-azure-sql-database) view in the **primary** database, and the [sys.dm_operation_status](/sql/relational-databases/system-dynamic-management-views/sys-dm-operation-status-azure-sql-database) view in the `master` database on the **primary** server. The time needed to create a geo-secondary depends on the primary database size.
286
+
287
+
```sql
288
+
alterdatabase [dbrep] add secondary on server [servername];
289
+
```
290
+
291
+
10. After the geo-secondary is successfully created, the users, logins, and firewall rules created by this procedure can be removed.
292
+
293
+
> [!NOTE]
294
+
> Cross-subscription geo-replication operations including setup and geo-failover are only supported using REST API & T-SQL commands.
295
+
>
296
+
> Adding a geo-secondary using T-SQL is not supported when connecting to the primary server over a [private endpoint](private-endpoint-overview.md). If a private endpoint is configured but public network access is allowed, adding a geo-secondary is supported when connected to the primary server from a public IP address. Once a geo-secondary is added, [public network access can be denied](connectivity-settings.md#deny-public-network-access).
297
+
>
298
+
> Creating a geo-secondary on a logical server in a different Microsoft Entra tenant is not supported when [Microsoft Entra-only authentication](authentication-azure-ad-only-authentication.md) is enabled on either primary or secondary logical server.
299
+
300
+
301
+
229
302
## Next steps
230
303
231
304
* To learn more about active geo-replication, see [active geo-replication](active-geo-replication-overview.md).
232
305
* To learn about auto-failover groups, see [Auto-failover groups](auto-failover-group-sql-db.md)
233
306
* For a business continuity overview and scenarios, see [Business continuity overview](business-continuity-high-availability-disaster-recover-hadr-overview.md).
307
+
* Save on licensing costs by designating your secondary DR replica for [standby](standby-replica-how-to-configure.md).
0 commit comments