Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The fastest backup/restore strategy for Azure SQL databases?

What is the fastest way to backup/restore Azure SQL database?

The background: We have the database with size ~40 GB and restoring it from the .bacbac file (~4GB of compressed data) in the native way by Azure SQL Database Import/Export Service takes up to 6-8 hours. Creating .bacpac is also very long and takes ~2 hours.

UPD:

enter image description here

UPD. Creating the database (by the way transactional consistent) copy using CREATE DATABASE [DBBackup] AS COPY OF [DB] takes only 15 minutes with 40 GB database and the restore is simple database rename.

UPD. Dec, 2014. Let me share with you our experience about the fastest way of DB migration schema we ended up with.

First of all, the approach with data-tier application (.bacpac) turned out to be not viable for us after DB became slightly bigger and it also will not work for you if you have at least one non-clustered index with total size > 2 GB until you disable non-clustered indexes before export - it's due to Azure SQL transaction log limit.

We stick to Azure Migration Wizard that for data transfer just runs BCP for each table (parameters of BCP are configurable) and it's ~20% faster than approach with .bacpac.

Here are some pitfalls we encountered with the Migration Wizard:

  1. We run into encoding troubles for non-Unicode strings. Make sure that BCP import and export runs with same collation. It's -C ... configuration switch, you can find parameters with which BCP calling in .config file for MW application.
  2. Take into account that MW (at least the version that is actual at the moment of this writing) runs BCP with parameters that will leave the constraints in non-trusted state, so do not forget to check all non-trusted constraints after BCP import.
like image 720
Eugene D. Gubenkov Avatar asked Mar 18 '14 14:03

Eugene D. Gubenkov


People also ask

Which backup is the fastest in SQL?

If you need better throughput for your backups and restores so they complete faster, look no further than Pure Storage® FlashBlade® unified fast file and object (UFFO) storage. FlashBlade is a highly parallel, massive throughput device.

What type of backup is fastest type to restore a database from scratch?

Full Backup But it's also the quickest to restore from because all the files you need are contained in the same backup set. Full backups on a regular schedule require the most storage out of each method.

Which Azure SQL Database service tier provides the fastest recovery time for a database?

Fast geo-recovery - When active geo-replication is configured, the Business Critical tier has a guaranteed Recovery Point Objective (RPO) of 5 seconds and Recovery Time Objective (RTO) of 30 seconds for 100% of deployed hours.

How long does it take to restore an Azure SQL Database?

Most database restores finish in less than 12 hours. For a single subscription, you have the following limitations on the number of concurrent restore requests.


1 Answers

There are multiple ways to do backup, restore and copy jobs on Azure.

  1. Point in time restore.

Azure Service takes full backups, multiple differential backups and t-log backups every 5 minutes.

  1. Geo Restore

same as Point in time restore. Only difference is that it picks up a redundant copy from a different blob storage stored in a different region.

  1. Geo-Replication

Same as SQL Availability Groups. 4 Replicas Async with read capabilities. Select a region to become a hot standby.

More on Microsoft Site here. Blog here.

like image 141
Faces Of IT Avatar answered Oct 18 '22 12:10

Faces Of IT