Skip to content

Commit eeb79fd

Browse files
authored
Merge pull request #245122 from AbhishekMallick-MS/Jul-17-2023-CSRHANA
CSR for HANA & SQL DBs GA updates
2 parents 5a6bf1a + eedc793 commit eeb79fd

6 files changed

+173
-37
lines changed

articles/backup/backup-azure-sql-restore-cli.md

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
title: Restore SQL server databases in Azure VMs using Azure Backup via CLI
33
description: Learn how to use CLI to restore SQL server databases in Azure VMs in the Recovery Services vault.
44
ms.topic: how-to
5-
ms.date: 08/11/2022
5+
ms.date: 07/18/2023
66
ms.service: backup
77
ms.custom: devx-track-azurecli
8-
author: jyothisuri
9-
ms.author: jsuri
8+
author: AbhishekMallick-MS
9+
ms.author: v-abhmallick
1010
---
1111

1212
# Restore SQL databases in an Azure VM using Azure CLI
@@ -24,11 +24,11 @@ In this article, you'll learn how to:
2424
2525
This article assumes you've an SQL database running on Azure VM that's backed-up using Azure Backup. If you've used [Back up an SQL database in Azure using CLI](backup-azure-sql-backup-cli.md) to back up your SQL database, then you're using the following resources:
2626

27-
* A resource group named *SQLResourceGroup*
28-
* A vault named *SQLVault*
29-
* Protected container named *VMAppContainer;Compute;SQLResourceGroup;testSQLVM*
30-
* Backed-up database/item named *sqldatabase;mssqlserver;master*
31-
* Resources in the *westus2* region
27+
* A resource group named `SQLResourceGroup`.
28+
* A vault named `SQLVault`.
29+
* Protected container named `VMAppContainer;Compute;SQLResourceGroup;testSQLVM`.
30+
* Backed-up database/item named `sqldatabase;mssqlserver;master`.
31+
* Resources in the `westus` region.
3232

3333
>[!Note]
3434
>See the [SQL backup support matrix](sql-support-matrix.md) to know more about the supported configurations and scenarios.
@@ -144,7 +144,7 @@ Name Operation Status Item Name
144144
be7ea4a4-0752-4763-8570-a306b0a0106f Restore InProgress master [testSQLVM] AzureWorkload 2022-06-21T03:51:06.898981+00:00 0:00:05.652967
145145
```
146146

147-
The response provides you the job name. You can use this job name to track the job status using [az backup job show](/cli/azure/backup/job#az-backup-job-show) command.
147+
The response provides you with the job name. You can use this job name to track the job status using [az backup job show](/cli/azure/backup/job#az-backup-job-show) command.
148148

149149
## Restore and overwrite
150150

@@ -199,7 +199,7 @@ Name Operation Status Item Name
199199
1730ec49-166a-4bfd-99d5-93027c2d8480 Restore InProgress master [testSQLVM] AzureWorkload 2022-06-21T04:04:11.161411+00:00 0:00:03.118076
200200
```
201201

202-
The response provides you the job name. You can use this job name to track the job status using the [az backup job show](/cli/azure/backup/job#az-backup-job-show) command.
202+
The response provides you with the job name. You can use this job name to track the job status using the [az backup job show](/cli/azure/backup/job#az-backup-job-show) command.
203203

204204
## Restore to a secondary region
205205

@@ -359,11 +359,43 @@ The output appears as:
359359
}
360360
```
361361

362-
The response provides you the job name. You can use this job name to track the job status using the [az backup job show](/cli/azure/backup/job#az-backup-job-show) command.
362+
The response provides you with the job name. You can use this job name to track the job status using the [az backup job show](/cli/azure/backup/job#az-backup-job-show) command.
363363

364364
> [!NOTE]
365365
> If you don't want to restore the entire chain but only a subset of files, follow the steps as documented [here](restore-sql-database-azure-vm.md#partial-restore-as-files).
366366
367+
## Cross Subscription Restore
368+
369+
With Cross Subscription Restore (CSR), you have the flexibility of restoring to any subscription and any vault under your tenant if restore permissions are available. By default, CSR is enabled on all Recovery Services vaults (existing and newly created vaults).
370+
371+
>[!Note]
372+
>- You can trigger Cross Subscription Restore from Recovery Services vault.
373+
>- CSR is supported only for streaming based backup and is not supported for snapshot-based backup.
374+
>- Cross Regional Restore (CRR) with CSR is not supported.
375+
376+
377+
```azurecli
378+
az backup vault create
379+
380+
```
381+
382+
Add the parameter `cross-subscription-restore-state` that enables you to set the CSR state of the vault during vault creation and updating.
383+
384+
```azurecli
385+
az backup recoveryconfig show
386+
387+
```
388+
389+
Add the parameter `--target-subscription-id` that enables you to provide the target subscription as the input while triggering Cross Subscription Restore for SQL or HANA datasources.
390+
391+
**Example**:
392+
393+
```azurecli
394+
az backup vault create -g {rg_name} -n {vault_name} -l {location} --cross-subscription-restore-state Disable
395+
az backup recoveryconfig show --restore-mode alternateworkloadrestore --backup-management-type azureworkload -r {rp} --target-container-name {target_container} --target-item-name {target_item} --target-resource-group {target_rg} --target-server-name {target_server} --target-server-type SQLInstance --target-subscription-id {target_subscription} --target-vault-name {target_vault} --workload-type SQLDataBase --ids {source_item_id}
396+
397+
```
398+
367399
## Next steps
368400

369401
* Learn how to [manage SQL databases that are backed up using Azure CLI](backup-azure-sql-manage-cli.md).
103 KB
Loading

articles/backup/restore-sql-database-azure-vm.md

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
title: Restore SQL Server databases on an Azure VM
33
description: This article describes how to restore SQL Server databases that are running on an Azure VM and that are backed up with Azure Backup. You can also use Cross Region Restore to restore your databases to a secondary region.
44
ms.topic: conceptual
5-
ms.date: 02/20/2023
5+
ms.date: 07/18/2023
66
ms.service: backup
7-
author: jyothisuri
8-
ms.author: jsuri
7+
author: AbhishekMallick-MS
8+
ms.author: v-abhmallick
99
---
1010
# Restore SQL Server databases on Azure VMs
1111

@@ -28,7 +28,7 @@ Azure Backup can restore SQL Server databases that are running on Azure VMs as f
2828
Before you restore a database, note the following:
2929

3030
- You can restore the database to an instance of a SQL Server in the same Azure region.
31-
- The destination server must be registered to the same vault as the source.
31+
- The destination server must be registered to the same vault as the source. If you want to restore backups to a different vault, [enable Cross Subscription Restore](#cross-subscription-restore).
3232
- If you have multiple instances running on a server, all the instances should be up and running. Otherwise the server won't appear in the list of destination servers for you to restore the database to. For more information, refer to [the troubleshooting steps](backup-sql-server-azure-troubleshoot.md#faulty-instance-in-a-vm-with-multiple-sql-server-instances).
3333
- To restore a TDE-encrypted database to another SQL Server, you need to first [restore the certificate to the destination server](/sql/relational-databases/security/encryption/move-a-tde-protected-database-to-another-sql-server).
3434
- [CDC](/sql/relational-databases/track-changes/enable-and-disable-change-data-capture-sql-server) enabled databases should be restored using the [Restore as files](#restore-as-files) option.
@@ -203,7 +203,7 @@ To restore the database files to the *original path on the source server*, remov
203203
```
204204

205205
>[!Note]
206-
>You shouldn’t have the same database files on the target server (restore with replace).  Also, you can [enable instant file initialization on the target server to reduce the file initialization time overhead]( /sql/relational-databases/databases/database-instant-file-initialization?view=sql-server-ver16).
206+
>You shouldn’t have the same database files on the target server (restore with replace).  Also, you can [enable instant file initialization on the target server to reduce the file initialization time overhead]( /sql/relational-databases/databases/database-instant-file-initialization?view=sql-server-ver16&preserve-view=true).
207207
208208
To relocate the database files from the target restore server, you can frame a TSQL command using the `MOVE` clauses.
209209

@@ -220,7 +220,7 @@ To relocate the database files from the target restore server, you can frame a T
220220
GO
221221
```
222222

223-
If there are more than two files for the database, you can add additional `MOVE` clauses to the restore query. You can also use SSMS for database recovery using `.bak` files. [Learn more](/sql/relational-databases/backup-restore/restore-a-database-backup-using-ssms?view=sql-server-ver16).
223+
If there are more than two files for the database, you can add additional `MOVE` clauses to the restore query. You can also use SSMS for database recovery using `.bak` files. [Learn more](/sql/relational-databases/backup-restore/restore-a-database-backup-using-ssms?view=sql-server-ver16&preserve-view=true).
224224

225225
>[!Note]
226226
>For large database recovery, we recommend you to use TSQL statements. If you want to relocate the specific database files, see the list of database files in the JSON format created during the **Restore as Files** operation.
@@ -267,6 +267,32 @@ The secondary region restore user experience will be similar to the primary regi
267267

268268
:::image type="content" source="./media/backup-azure-sql-database/backup-center-jobs-inline.png" alt-text="Screenshot showing the filtered Backup jobs." lightbox="./media/backup-azure-sql-database/backup-center-jobs-expanded.png":::
269269

270+
271+
272+
## Cross Subscription Restore
273+
274+
Azure Backup now allows you to restore SQL database to any subscription (as per the following Azure RBAC requirements) from the restore point. By default, Azure Backup restores to the same subscription where the restore points are available.
275+
276+
With Cross Subscription Restore (CSR), you have the flexibility of restoring to any subscription and any vault under your tenant if restore permissions are available. By default, CSR is enabled on all Recovery Services vaults (existing and newly created vaults).
277+
278+
>[!Note]
279+
>- You can trigger Cross Subscription Restore from Recovery Services vault.
280+
>- CSR is supported only for streaming based backup and is not supported for snapshot-based backup.
281+
>- Cross Regional Restore (CRR) with CSR is not supported.
282+
283+
**Azure RBAC requirements**
284+
285+
| Operation type | Backup operator | Recovery Services vault | Alternate operator |
286+
| --- | --- | --- | --- |
287+
| Restore database or restore as files | `Virtual Machine Contributor` | Source VM that got backed up | Instead of a built-in role, you can consider a custom role which has the following permissions: <br><br> - `Microsoft.Compute/virtualMachines/write` <br> - `Microsoft.Compute/virtualMachines/read` |
288+
| | `Virtual Machine Contributor` | Target VM in which the database will be restored or files are created. | Instead of a built-in role, you can consider a custom role that has the following permissions: <br><br> - `Microsoft.Compute/virtualMachines/write` <br> - `Microsoft.Compute/virtualMachines/read` |
289+
| | `Backup Operator` | Target Recovery Services vault | |
290+
291+
By default, CSR is enabled on the Recovery Services vault. To update the Recovery Services vault restore settings, go to **Properties** > **Cross Subscription Restore** and make the required changes.
292+
293+
:::image type="content" source="./media/sap-hana-db-restore/cross-subscription-restore-settings-for-database.png" alt-text="Screenshot shows how to modify the Cross Subscription Restore settings on a Recovery Services vault for SQL database." lightbox="./media/sap-hana-db-restore/cross-subscription-restore-settings-for-database.png":::
294+
295+
270296
## Next steps
271297

272298
[Manage and monitor](manage-monitor-sql-database-backup.md) SQL Server databases that are backed up by Azure Backup.

articles/backup/sap-hana-database-restore.md

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
title: Restore SAP HANA databases on Azure VMs
33
description: In this article, you'll learn how to restore SAP HANA databases that are running on Azure virtual machines. You can also use Cross Region Restore to restore your databases to a secondary region.
44
ms.topic: how-to
5-
ms.date: 07/14/2023
5+
ms.date: 07/18/2023
66
ms.service: backup
77
ms.custom: ignite-2022
8-
author: jyothisuri
9-
ms.author: jsuri
8+
author: AbhishekMallick-MS
9+
ms.author: v-abhmallick
1010
---
1111

1212
# Restore SAP HANA databases on Azure VMs
@@ -169,7 +169,7 @@ To restore the backup data as files instead of a database, select **Restore as F
169169
* `<LogFilesDir>`: The folder that contains the log backups, differential backups, and incremental backups. For Full BackUp Restore, because the log folder isn't created, add an empty directory.
170170
* `<PathToPlaceCatalogFile>`: The folder where the generated catalog file must be placed.
171171
172-
d. Restore by using the newly generated catalog file through HANA Studio, or run the SAP HANA HDBSQL tool restore query with this newly generated catalog. The HDBSQL queries are listed here:
172+
d. You can restore by using the newly generated catalog file through HANA Studio or run the SAP HANA HDBSQL tool restore query with this newly generated catalog. The HDBSQL queries are listed here:
173173
174174
* To open the HDBSQL prompt, run the following command:
175175
@@ -356,6 +356,53 @@ The secondary region restore user experience is similar to the primary region re
356356

357357
:::image type="content" source="./media/sap-hana-db-restore/hana-view-jobs-inline.png" alt-text="Screenshot that shows filtered backup jobs." lightbox="./media/sap-hana-db-restore/hana-view-jobs-expanded.png":::
358358

359+
## Cross Subscription Restore
360+
361+
Azure Backup now allows you to restore SAP HANA Database to any subscription (as per the following Azure RBAC requirements) from the restore point. By default, Azure Backup restores to the same subscription where the restore points are available.
362+
363+
With Cross Subscription Restore (CSR), you have the flexibility of restoring to any subscription and any vault under your tenant if restore permissions are available. By default, CSR is enabled on all Recovery Services vaults (existing and newly created vaults).
364+
365+
>[!Note]
366+
>- You can trigger Cross Subscription Restore from Recovery Services vault.
367+
>- CSR is supported only for streaming/Backint-based backups and is not supported for snapshot-based backup.
368+
>- Cross Regional Restore (CRR) with CSR is not supported.
369+
370+
**Azure RBAC requirements**
371+
372+
| Operation type | Backup operator | Recovery Services vault | Alternate operator |
373+
| --- | --- | --- | --- |
374+
| Restore database or restore as files | `Virtual Machine Contributor` | Source VM that got backed up | Instead of a built-in role, you can consider a custom role which has the following permissions: <br><br> - `Microsoft.Compute/virtualMachines/write` <br> - `Microsoft.Compute/virtualMachines/read` |
375+
| | `Virtual Machine Contributor` | Target VM in which the database will be restored or files are created. | Instead of a built-in role, you can consider a custom role that has the following permissions: <br><br> - `Microsoft.Compute/virtualMachines/write` <br> - `Microsoft.Compute/virtualMachines/read` |
376+
| | `Backup Operator` | Target Recovery Services vault | |
377+
378+
By default, CSR is enabled on the Recovery Services vault. To update the Recovery Services vault restore settings, go to **Properties** > **Cross Subscription Restore** and make the required changes.
379+
380+
:::image type="content" source="./media/sap-hana-db-restore/cross-subscription-restore-settings-for-database.png" alt-text="Screenshot shows how to modify the Cross Subscription Restore settings on a Recovery Services vault for HANA database." lightbox="./media/sap-hana-db-restore/cross-subscription-restore-settings-for-database.png":::
381+
382+
**Cross Subscription Restore using Azure CLI**
383+
384+
```azurecli
385+
az backup vault create
386+
387+
```
388+
389+
Add the parameter `cross-subscription-restore-state` that enables you to set the CSR state of the vault during vault creation and updating.
390+
391+
```azurecli
392+
az backup recoveryconfig show
393+
394+
```
395+
396+
Add the parameter `--target-subscription-id` that enables you to provide the target subscription as the input while triggering Cross Subscription Restore for SQL or HANA datasources.
397+
398+
**Example**:
399+
400+
```azurecli
401+
az backup vault create -g {rg_name} -n {vault_name} -l {location} --cross-subscription-restore-state Disable
402+
az backup recoveryconfig show --restore-mode alternateworkloadrestore --backup-management-type azureworkload -r {rp} --target-container-name {target_container} --target-item-name {target_item} --target-resource-group {target_rg} --target-server-name {target_server} --target-server-type SQLInstance --target-subscription-id {target_subscription} --target-vault-name {target_vault} --workload-type SQLDataBase --ids {source_item_id}
403+
404+
```
405+
359406
## Next steps
360407

361408
- [Manage SAP HANA databases by using Azure Backup](sap-hana-db-manage.md)

articles/backup/tutorial-sap-hana-backup-cli.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.author: jsuri
1111

1212
# Tutorial: Back up SAP HANA databases in an Azure VM using Azure CLI
1313

14-
This tutorial describes how to back up SAP HANA database instance and SAP HANA System Replication (HSR) instance (preview) using Azure CLI.
14+
This tutorial describes how to back up SAP HANA database instance and SAP HANA System Replication (HSR) instance using Azure CLI.
1515

1616
Azure CLI is used to create and manage Azure resources from the Command Line or through scripts. This documentation details how to back up an SAP HANA database and trigger on-demand backups - all using Azure CLI. You can also perform these steps using the [Azure portal](./backup-azure-sap-hana-database.md).
1717

@@ -64,7 +64,7 @@ Location Name ResourceGroup
6464
westus2 saphanaVault saphanaResourceGroup
6565
```
6666

67-
# [HSR (preview)](#tab/hsr)
67+
# [HSR](#tab/hsr)
6868

6969
To create the Recovery Services vault for HSR instance protection, run the following command:
7070

@@ -113,7 +113,7 @@ To register and protect database instance, follow these steps:
113113
> The column “name” in the above output refers to the container name. This container name will be used in the next sections to enable backups and trigger them. Which in this case, is *VMAppContainer;Compute;saphanaResourceGroup;saphanaVM*.
114114
115115
116-
# [HSR (preview)](#tab/hsr)
116+
# [HSR](#tab/hsr)
117117
118118
To register and protect database instance, follow these steps:
119119
@@ -217,7 +217,7 @@ To get container name, run the following command. [Learn about this CLI command]
217217
218218
```
219219

220-
# [HSR (preview)](#tab/hsr)
220+
# [HSR](#tab/hsr)
221221

222222
To enable database instance backup, follow these steps:
223223

@@ -292,7 +292,7 @@ The response will give you the job name. This job name can be used to track the
292292
>[!NOTE]
293293
>Log backups are automatically triggered and managed by SAP HANA internally.
294294
295-
# [HSR (preview)](#tab/hsr)
295+
# [HSR](#tab/hsr)
296296

297297
To run an on-demand backup, run the following command:
298298

0 commit comments

Comments
 (0)