Backing up a database to storage

In order to back up the database to Azure Storage, first we need to open SQL Server Management Studio (SSMS), select the database we want to back up, and then select Tasks | Back Up.... The first step is shown in this screenshot:

New windows will open with options to select the Database (this will already be selected if we selected a proper database in the first step, but can be changed or we can select multiple databases), Backup type (usually a full backup is recommended) and finally, Destination. The default option is Disk, and we need to change this to an URL. A screenshot of these options is shown here:

After selecting the URL as the destination, we must select add in order to provide the path. This will open a new window in which we need to provide our Azure account information in order to access our Azure subscription. After this is done, we have access to our Azure subscription from SSMS and can select our storage account and blob where the backup will be stored. As Shared Access Signature (SAS) is used to perform the backup, we must create a new SAS and provide a date of expiration. Setting up a destination for the backup is shown in this screenshot:

Finally, we click OK and the backup is performed. Time to perform the backup depends on bandwidth, database size, and storage type. In this case, the storage type is usually standard, as storing backups to premium storage is overkill and we would be paying a premium service for an archive. After the backup is completed, we can see the file information in the Azure portal under the storage account in the blob we selected. An example of the file information in the Azure portal is shown here:

After the backup is performed, we can use this backup to restore the database in Azure. However, full backup can be only restored on an SQL Server running on an Azure Virtual Machine (IaaS). In order to restore a backup in the Azure SQL Database (PaaS), we must use BACPAC. BACPAC contains data and metadata of the SQL database. The process to backup BACPAC to Azure Storage is similar to the process of creating a full backup of the database.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset