Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server
This topic outlines the considerations when restoring a database using a backup stored in Azure Blob Storage. This applies to backups created either by using SQL Server Backup to URL backup or by SQL Server managed backup to Microsoft Azure.
We recommend reviewing this topic if you have backups stored in Azure Blob Storage that you plan to restore, and then review the topics that describe the steps on how to restore a database which is the same for both on-premises and Azure backups.
The tools and methods that are used to restore a database from an on-premises backup apply to restoring a database from a cloud backup. The following sections describe these considerations and any differences you should know about when you use backups stored in Azure Blob Storage.
Since SQL Server must connect to an external source to retrieve the backup files, SQL Credential is used to authenticate to the storage account. Consequently, the RESTORE statement requires WITH CREDENTIAL option. For more information, see SQL Server Backup and Restore with Microsoft Azure Blob Storage.
If you are using the SQL Server managed backup to Microsoft Azure to manage your backups to the cloud, you can review all the available backups in the storage, by using the smart_admin.fn_available_backups system function. This system function returns all the available backups for a database in a table. As the results are returned in a table, you can filter or sort the results. For more information, see managed_backup.fn_available_backups (Transact-SQL).
To reduce restore write time, Add perform volume maintenance tasks user right to the SQL Server user account. For more information, see Database File Initialization. If restore is still slow with instant file initialization turned on, look at the size of the log file on the instance where the database was backed up. If the log is very large in size (multiple GBs), it would be expected that restore would be slow. During restore the log file must be zeroed which takes a significant amount of time. The initial restore of database transaction log files cannot benefit from instant file initialization.
To reduce restore times it is recommended that you use compressed backups. For backup sizes exceeding 25 GB, use AzCopy utility to download to the local drive and then perform the restore. For other backup best practices and recommendations, see SQL Server Backup to URL Best Practices and Troubleshooting.
In SQL Server 2016 (13.x) and later versions, block blob is preferred for Backup to URL.
BackupToUrl-\<instancename>-\<dbname>-action-\<PID>.log
. The log file includes information about each round trip to Azure Storage including timing that can be helpful in diagnosing the issue.Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayTraining
Certification
Microsoft Certified: Azure Database Administrator Associate - Certifications
Administer an SQL Server database infrastructure for cloud, on-premises and hybrid relational databases using the Microsoft PaaS relational database offerings.
Documentation
SQL Server Backup to URL for Microsoft Azure Blob Storage - SQL Server
Learn about the concepts, requirements, and components necessary for SQL Server to use the Microsoft Azure Blob Storage as a backup destination.
Back up to URL best practices & troubleshooting for Microsoft Azure Blob Storage - SQL Server
Learn about best practices and troubleshooting tips for SQL Server backup and restores to Azure Blob Storage.
Back up multiple databases: Azure Blob Storage - PowerShell
This article provides sample scripts that can be used to automate backups in SQL Server to Azure Blob Storage using PowerShell cmdlets.