SQL Server backup to URL is a new feature shipped with SQL Server 2014. Now, you do not need to manage backup tapes, tape drives, storage etc etc. All you need to do is to create a Windows Azure account, a storage and a container, remaining stuff Azure will handle your backup 😉
Pre-Requisite :
Let me now demonstrate in few easy steps how to take backup to URL.
Step 1 – Create Account, storage & container :
First of all you need to create a windows Azure account, a storage and a container as explained in this article.
Step 2 – Create Credential :
Once you have the details, you need to create the credential using given below script. But if you notice, this script requires two parameters namely IDENTITY & SECRET. So how will I get them? Actually IDENTITY is the storage name that we created in the previous article (Step 4) namely ‘raresql‘ and SECRET is the primary access key that we also picked up in the previous article (Step 5). Lets create a credential.
USE master GO CREATE CREDENTIAL [My_Credential] WITH IDENTITY ='raresql' ,SECRET = '/ByNUTZqJ6EcJR/VQcNmNj+zSu++iCfbcxlyWye6Ok9uY3L5nw3XkndmAnDjiKn' GO
Step 3 – Take backup to URL :
Once you created the credential, lets take a backup on URL using given below script, which requires two parameters, one is credential that we created in the above step and the second is the URL that we created in the previous article (Step 10).
BACKUP DATABASE AdventureWorks2012 TO URL = 'https://raresql.blob.core.windows.net/sql-backup/AdventureWorks2012.bak' WITH CREDENTIAL = 'My_Credential' ,STATS = 5; GO --OUTPUT
Step 4 – Verify backup to URL :
Lets go to the container inside the storage and check if the backup is available there or NOT. Because, we saw the confirmation report in the above step.
I am sure, you will be more than excited to try this solution, as this will eliminate your headache of maintaining the tape, its drives and last but not the least, its issues.
Leave a Reply