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: learn-pr/wwl-data-ai/backup-restore-databases/2-backup-restore-sql-server-running-azure-virtual-machines.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,8 @@ metadata:
6
6
prefetch-feature-rollout: true
7
7
title: Back up and restore SQL Server running on Azure virtual machines
8
8
description: "Back up and restore SQL Server running on Azure virtual machines"
Even if you do nothing else to increase your availability with features like AGs or active geo-replication, you must have a solid backup and recovery strategy. If for some reason a feature fails, you'll have to restore databases from backups.
1
+
Planning and implementing a robust policy for data recovery is essential to mitigate the risks associated with user errors or technology failures. This involves exploring various options for backing up and restoring databases, including on-site and off-site solutions, cloud-based services, and automated backup systems. By understanding the different methods for data back up and recovery, organizations can safeguard their critical information and maintain operational continuity in the face of unforeseen challenges.
2
2
3
-
## Learning objectives
4
-
5
-
In this module, you'll learn:
6
-
7
-
- Database backup and restore options for IaaS
8
-
- Virtual machine backup and restore options for IaaS
9
-
- Backup and restore options for PaaS
3
+
Even if you do nothing else to increase your availability with features like AGs or active geo-replication, you must have a solid backup and recovery strategy.
Copy file name to clipboardExpand all lines: learn-pr/wwl-data-ai/backup-restore-databases/includes/3-backup-sql-server-virtual-machine.md
+9-11Lines changed: 9 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,10 @@
1
-
Azure Backup can back up VMs that contain SQL Server. These backups would contain not just SQL Server databases; they would contain everything that is in the VM so it could be restored as a whole. While this option may not be right for everyone, it can potentially protect against problems like ransomware.
1
+
Azure Backup offers the capability to back up virtual machines (VMs) that host SQL Server. These backups contain not only the SQL Server databases but also all other contents within the VM, allowing for a complete restoration if needed. Although this approach may not be suitable for every scenario, it provides a robust safeguard against issues such as ransomware attacks.
2
2
3
-
VM-level backups are SQL Server-aware, also known as applicationaware, so they'll create an application-consistent backup. This means that if you restore a VM-level backup, it will not ‘break’ SQL Server. If using this option, when looking in the SQL Server log you'll see that the I/O has been momentarily frozen and then starts again when complete. If this causes issues with availability features like AGs, you may want to consider another backup strategy.
3
+
VM-level backups are SQL Server-aware, also known as application-aware, ensuring the creation of application-consistent backups. This means that restoring a VM-level backup won't disrupt SQL Server functionality. When using this option, the SQL Server log indicates that the I/O has been momentarily frozen and then resumed upon completion.
4
4
5
-
Combining SQL Server backups with snapshots can potentially cause issues. If snapshot delays cause backup failures, set following registry key:
5
+
Combining SQL Server backups with snapshots can potentially cause issues. If snapshot delays cause backup failures, set following value on the `[HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\BCDRAGENT]` key:
6
6
7
-
[HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\BCDRAGENT]
8
-
9
-
"USEVSSCOPYBACKUP"="TRUE"
7
+
**"USEVSSCOPYBACKUP"**="TRUE"
10
8
11
9
## Use local disks or a network share for backup files
12
10
@@ -16,11 +14,11 @@ As with on premises SQL Server instances, databases can be backed up to disks at
16
14
17
15
Another option is to configure backup to URL for the SQL Server instance installed in the VM. Unlike backups made on premises, backup and restore from URL for an IaaS VM is effectively a local option.
18
16
19
-
Backup to URL requires an Azure storage account and uses the Azure blob storage service. Inside the storage account, there are containers, and the blobs are stored there. Unlike a path on your local disk, the path to a backup file will look something like `https://ACCOUNTNAME.blob.core.windows.net/ContainerName/MyDatabase.bak`. You can include more folder names under your container for easier identification of backups (for example, FULL, DIFF, LOG).
17
+
Back up to URL requires an Azure storage account and uses the Azure blob storage service. Inside the storage account, there are containers, and the blobs are stored there. Unlike a path on your local disk, the path to a backup file looks something like `https://ACCOUNTNAME.blob.core.windows.net/ContainerName/MyDatabase.bak`. You can include more folder names under your container for easier identification of backups (for example, FULL, DIFF, LOG).
20
18
21
-
To backup to or restore from a URL, authentication must be established between the SQL Server instance and Azure. Remember that inside of an Azure VM, SQL Server doesn't know it's running on Azure. A SQL Server Credential can be composed of the Azure storage account name and access key authentication or a Shared Access Signature. If the former is used, the backup will be stored as a page blob and if the latter, it will be stored as a block blob. Starting with SQL Server 2016, only block blob is available so you should use a Shared Access Signature. From a cost perspective, block blobs are also cheaper, and Shared Access Signature tokens offer better security control.
19
+
To back up to or restore from a URL, authentication must be established between the SQL Server instance and Azure. Remember that inside of an Azure VM, SQL Server doesn't know it's running on Azure. A SQL Server Credential can be composed of the Azure storage account name and access key authentication or a Shared Access Signature. If the former is used, the backup is stored as a page blob and if the latter, it's stored as a block blob. Starting with SQL Server 2016, only block blob is available so you should use a Shared Access Signature. From a cost perspective, block blobs are also cheaper, and Shared Access Signature tokens offer better security control.
22
20
23
-
Restoring from a URL is as simple as restoring from disk or a network share. In the SQL Server Management Studio UI, select URL from the backup media type in the Wizard. If using Transact-SQL, instead of using FROM DISK, you would use FROM URL with the appropriate location and backup file name(s). Here are some sample statements:
21
+
Restoring from a URL is as simple as restoring from disk or a network share. In the SQL Server Management Studio UI, select URL from the backup media type in the Wizard. If using Transact-SQL, instead of using FROM DISK, you would use FROM URL with the appropriate location and backup file name. Here are some sample statements:
24
22
25
23
The following statement would back up a transaction log.
26
24
@@ -41,13 +39,13 @@ WITH NORECOVERY
41
39
42
40
Any IaaS VM that has SQL Server installed can use the SQL Server resource provider. One of its options is the ability to configure automated backups so Azure takes care of backing up SQL Server databases. It requires the use of a storage account.
43
41
44
-
One benefit of implementing backups this way is that you can manage retention times for the backups. Another benefit is that you can ensure RPO due to the ability to take database and transaction log backups all in one easy-to-configure place. The image below shows an example of what configuring an automated backup looks like in the Azure portal.
42
+
One benefit of implementing backups this way is that you can manage retention times for the backups. Another benefit is that you can ensure RPO due to the ability to take database and transaction log backups all in one easy-to-configure place. The following image shows an example of what configuring an automated backup looks like in the Azure portal.
45
43
46
44
:::image type="content" source="../media/module-77-high-availability-final-15.png" alt-text="Configuring automated backups for SQL Server in a VM in the Azure portal":::
47
45
48
46
The automated backup option is currently only available for Windows Server-based SQL Server installations.
49
47
50
48
> [!IMPORTANT]
51
-
> You choose one method of backing up databases with IaaS-based SQL Server deployments. For example, if you use automated backups, especially with transaction log backups, do not also configure those at the instance level inside the VM. You could cause problems with the log chain with restoring a database if things are uncoordinated, because each log backup clears the log and you must have an entire unbroken chain of log backups in order to do a log restore. For example, if transaction log backups happen inside the guest as well as at the Azure level, you may have to piece together the backups to do a restore.
49
+
> You choose one method of backing up databases with IaaS-based SQL Server deployments. For example, if you use automated backups, especially with transaction log backups, don't also configure those at the instance level inside the VM. You could cause problems with the log chain with restoring a database if things are uncoordinated, because each log backup clears the log and you must have an entire unbroken chain of log backups in order to do a log restore. For example, if transaction log backups happen inside the guest and at the Azure level, you may have to piece together the backups to do a restore.
52
50
53
51
While the backups can be automated, restores can't be. You would need to configure and use the restore from URL functionality within SQL Server.
Copy file name to clipboardExpand all lines: learn-pr/wwl-data-ai/backup-restore-databases/includes/4-use-azure-sql-database.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,36 +1,40 @@
1
1
2
-
Back up and restore on SQL Server PaaS offering work differently than on IaaS. Backups are generated automatically for Azure SQL Database, and Azure SQL Managed Instance. A full backup is created once a week, a differential every 12 hours, and transaction log backups every 5 – 10 minutes. All backups are located in read-access, geo-redundant (RA-GRS) blobs replicated to a datacenter that is paired based on Azure rules. That means backups are safe from an outage in a single data center.
2
+
Back up and restore on SQL Server PaaS offering work differently than on IaaS. Backups are generated automatically for Azure SQL Database, and Azure SQL Managed Instance. A full backup is created once a week, a differential every 12 hours, and transaction log backups every 5 to 10 minutes. All backups are located in read-access, geo-redundant (RA-GRS) blobs replicated to a datacenter that is paired based on Azure rules. That means backups are safe from an outage in a single data center.
3
3
4
4
## Database backup and restore for SQL Database
5
5
6
-
SQL Database can assist you to be compliant with mandatory backups for regulatory purposes with retention policies. Backup policies can be configured per database as shown in the image below:
6
+
Database backups are an essential part of any business continuity and disaster recovery strategy because they help protect your data from corruption or deletion.
7
+
8
+
SQL Database can assist you to be compliant with mandatory backups for regulatory purposes with retention policies. Backup policies can be configured per database as shown in the following image:
7
9
8
10
:::image type="content" source="../media/module-77-high-availability-final-16.png" alt-text="Configuring automated backups for Azure SQL Database":::
9
11
10
-
If the server containing the database is deleted, all backups will be deleted at the same time, and there's no way to recover them. If the server isn't deleted but the database is, you can restore the database normally.
12
+
If the server containing the database is deleted, all backups are deleted at the same time, and there's no way to recover them. If the server isn't deleted but the database is, you can restore the database normally.
11
13
12
14
Both SQL Database, and SQL Managed Instance have a feature called Accelerated Database Recovery (ADR). This feature is enabled by default, and its purpose is to decrease the time it takes to deal with long running transactions so they don't affect the recovery time. Although Accelerated Database Recovery was developed for Azure and was originally an Azure-based feature, ADR was implemented in SQL Server 2019 as well.
13
15
14
16
> [!NOTE]
15
-
> You can't restore SQL Database Managed Instance backups on SQL Database.
17
+
> You can't restore SQL Database Azure SQL Managed Instance backups on SQL Database.
18
+
19
+
Automated database backups are also avaialable on [Azure SQL Managed Instance](/azure/azure-sql/managed-instance/automated-backups-overview). SQL Server database engine backups are automatically managed by Microsoft, and stored on Microsoft-managed Azure storage accounts.
16
20
17
21
### Point in time restore
18
22
19
23
To restore a database to a specific point in time on SQL Database, you can use either Azure portal, Azure PowerShell, Azure CLI, or REST API.
20
24
21
25
> [](../media/restore-sql-database.png#lightbox)
22
26
23
-
The image above shows the SQL Database restore page on Azure portal, where you can restore a database to a specific point in time.
27
+
The following image shows the SQL Database restore page on Azure portal, where you can restore a database to a specific point in time.
24
28
25
29
Restore in place isn't supported on SQL Database, and SQL Managed Instance. You need to make sure the database doesn't exist before attempting the restore operation. By default, point in time retention policy is set to seven days, and you can change it to up to 35-days.
26
30
27
31
### Restore a deleted database
28
32
29
-
Both SQL Database, and SQL Managed Instance have a feature to restore a deleted database to the last point in time available before the `DROP DATABASE` took place.
33
+
Both SQL Database, and SQL Managed Instance have a feature to restore a deleted database to the last point in time available before the `DROP DATABASE` took place. To recover a deleted database to the deletion time by using the Azure portal, open the server's overview page and select **Deleted databases**. Select a deleted database that you want to restore, and then enter the name for the new database that will be created with data restored from the backup.
30
34
31
35
> [](../media/restore-sql-database-deleted.png#lightbox)
32
36
33
-
The image above shows how to restore a deleted database on SQL Database. The *deleted databases* page shows a list of deleted databases available to restore, the database deletion time in UTC, and the database creation time in UTC. Once you select the database, the *Create SQL Database - Restore database* page will open. On that page you'll find the earliest restore point in time available for the selected database.
37
+
The image shows how to restore a deleted database on SQL Database. The *deleted databases* page shows a list of deleted databases available to restore, the database deletion time in UTC, and the database creation time in UTC. Once you select the database, the *Create SQL Database - Restore database* page opens. On that page you find the earliest restore point in time available for the selected database.
34
38
35
39
## Database backup and restore for SQL Managed Instance
36
40
@@ -47,4 +51,4 @@ WITH COPY_ONLY
47
51
```
48
52
49
53
> [!NOTE]
50
-
> You can't restore SQL Database Managed Instance backups on SQL Database.
54
+
> You can't restore SQL Database SQL Managed Instance backups on SQL Database.
0 commit comments