Using Azure Blob Storage for Offsite SQL Backups

By Tom Nonmacher

Microsoft's Azure Blob Storage is an ideal solution for offsite backups, especially for SQL databases. With its global redundancy and massive scalability, Azure Blob Storage provides a highly reliable and cost-effective offsite storage option. Moreover, its integration with SQL Server 2012 and 2014, MySQL 5.6, DB2 10.5 and Azure SQL makes it a versatile choice for many organizations.

To illustrate the process, let's consider an example with SQL Server 2014. First, you need to create a credential for Azure storage. This credential is used by SQL Server to connect to the Azure Blob Storage. The credential includes the storage account name and a secret key.


-- SQL code goes here
CREATE CREDENTIAL MyAzureBlobStorage
WITH IDENTITY = 'myStorageAccount',
SECRET = 'myAccessKey';

Once the credential is created, you can backup your SQL Server database to Azure Blob Storage by specifying the URL of the blob storage and the name of the credential. The URL of the blob storage would be in the format: 'https://.blob.core.windows.net//'.


-- SQL code goes here
BACKUP DATABASE MyDatabase
TO URL = 'https://myStorageAccount.blob.core.windows.net/mycontainer/mybackup.bak'
WITH CREDENTIAL = 'MyAzureBlobStorage',
STATS = 10;

Similarly, you can use Azure Blob Storage for offsite backups of MySQL databases too. MySQL's mysqldump utility can be used to create a backup of your database, which can then be uploaded to Azure Blob Storage. DB2 also provides a similar utility, db2backup, for creating backups of DB2 databases. These backups can then be uploaded to Azure Blob Storage for offsite storage.

When it comes to Azure SQL, the process is even simpler. Azure SQL provides automated backups, which are stored in Azure Blob Storage by default. You can configure the retention period for these backups according to your needs. In case of a disaster, you can easily restore your Azure SQL database from these backups.

In conclusion, Azure Blob Storage provides a scalable, reliable and cost-effective solution for offsite backups of SQL databases. Its integration with various SQL technologies and the ease of backup and restore operations make it a valuable asset for any organization that relies on SQL databases.




E9750A
Please enter the code from the image above in the box below.