{"id":1823,"date":"2013-10-24T10:00:00","date_gmt":"2013-10-24T17:00:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/dataplatforminsider\/2013\/10\/24\/backup-and-restore-enhancements-in-sql-server-2014-ctp2\/"},"modified":"2024-01-22T22:49:07","modified_gmt":"2024-01-23T06:49:07","slug":"backup-and-restore-enhancements-in-sql-server-2014-ctp2","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2013\/10\/24\/backup-and-restore-enhancements-in-sql-server-2014-ctp2\/","title":{"rendered":"Backup and Restore Enhancements in SQL Server 2014 CTP2"},"content":{"rendered":"
SQL Server 2014 CTP2 includes three SQL Server Backup and Restore enhancements.\u00a0 These enhancements enable using Windows Azure for backups<\/a>, providing options to ease and automate backup management<\/a>, and improved security for backups through encryption<\/a>.\u00a0<\/p>\n In addition, to enable backup to Windows Azure from previous versions of SQL Server, a stand-alone tool<\/a>\u00a0is now available.\u00a0 A brief description of the tool and the link to the download center is included at the end of this article.<\/p>\n The three enhancements are described in detail below:<\/p>\n Support for SQL Server backup to and restore from the Windows Azure was introduced in SQL Server 2012 SP1 CU2 with Transact-SQL, SMO and PowerShell support. In the current release, the feature is further enhanced to include UI support.\u00a0 Backup and Restore tasks, and maintenance plans now include URL as a destination option when backing up or restoring a database.<\/p>\n Following are the UI changes in SSMS:<\/p>\n 2. \u00a0If you click the <\/span>Create…<\/strong> button, you will see a new dialog titled <\/span>Backup to URL \u2013 Create Credential\u00a0<\/strong>as shown below.<\/span><\/p>\n 3. \u00a0When you select <\/span>URL<\/strong> as the destination, you will only see certain options enabled on the <\/span>Media Options<\/strong> page. If you want to overwrite a backup stored in Windows Azure storage, you can do so using Transact-SQL using the WITH FORMAT option.<\/span><\/p>\n \u00a0 Maintenance Plan Wizard has similar changes to the Define a Backup<\/strong> Page to support backup to Windows Azure storage.<\/p>\n In the Restore task, you now have the option of selecting URL<\/strong> as the device to restore from.\u00a0 If you select URL, you are asked to specify the SQL Credential to authenticate to the Windows Azure storage.\u00a0<\/p>\n \u00a0<\/span> 2. \u00a0When you select <\/span>URL<\/strong> as the media type and click <\/span>Add<\/strong>, you see a new dialog\u00a0 –<\/span>Connect to Windows Azure Storage<\/strong>, which allows you to specify the SQL Credential to authenticate to the storage account.<\/span><\/p>\n \u00a0 Here is the link to the topic that describes the feature in detail: \u00a0SQL Server Backup to URL<\/a><\/p>\n Built on top of the SQL Server Backup to URL technology, SQL Server 2014 CTP2 includes the option to let SQL Server create and manage the backup strategy. SQL Server creates a backup strategy intelligently, one that is based on recoverability to a point in time within the specified retention period and transaction activity on the database. The destination for the backup file is Windows Azure Storage.\u00a0 Once you configure this feature either for a database or for an entire instance, SQL Server manages the backup frequency for full and log backups.\u00a0 It supports point in time restore based on the retention time period you specify when configuring SQL Server Managed Backup. It also supports the use of encryption.\u00a0 Encryption is also a new feature released in SQL Server 2014 CTP2 and is described later in this blog post.<\/p>\n Following are sample Transact-SQL statements for configuring SQL Server Managed Backup to Windows Azure.\u00a0<\/span><\/p>\n For a database:<\/p>\n For an instance of SQL Server:<\/p>\n Important: <\/strong>To create a backup certificate to use when configuring smart backup, use the steps described in the Encrypted Backup section below.<\/strong><\/p>\n Here is the link to the topic that describes the feature in detail: \u00a0SQL Server Managed Backup to Windows Azure<\/a><\/p>\n To secure you backup data, you can now select to encrypt when you create a backup.\u00a0 The encryption options include an encryption algorithm and a certificate or asymmetric key to be used for the encryption.\u00a0 Only asymmetric keys residing in the Extended Key Management is supported.<\/p>\n Multiple encryption algorithms up to AES 256 bit are supported giving you a variety of algorithms to choose from. Adding backup encryption to a TDE encrypted database, gives additional protection for your data.\u00a0<\/p>\n You can control the process using Transact-SQL, SMO, PowerShell, or SSMS. Encryption options can also be used when configuring SQL Server Managed Backup to Windows Azure, therefore providing additional security for your off-site data.<\/p>\n It is very important that the certificate or key used for encrypting must be backed up to a different location than the backup that the certificate or key is used to encrypt.\u00a0 Without this certificate or key the backup file cannot be restored.<\/p>\n Important<\/strong>: Restore validates the thumbprint of the certificate during the restore operation. Therefore, the certificate used to create the backup must be retained in its original state.\u00a0 Renewing the expiry date for example changes the thumbprint and thus can render the certificate unusable.<\/p>\n Below are some simple steps you can follow to test out the feature.\u00a0<\/p>\n 1. \u00a0Create a Database Master Key for the master database on the instance<\/span><\/p>\n 2. \u00a0Create an encryption certificate\u00a0<\/span><\/p>\n The Backup Options page of the Back Up Database<\/strong> Task dialog has the new encryption options.<\/p>\n \u00a0 \u00a0Maintenance Plan Wizard has similar changes to the\u00a0Define a Backup<\/strong>\u00a0Page to support backup to Windows Azure storage.<\/p>\n Here is the topic that describes the feature in detail: \u00a0Backup Encryption<\/a>\u00a0<\/span><\/p>\n This stand-alone tool can be configured to redirect SQL Server backups to Windows Azure storage.\u00a0 To be used for SQL Server versions that do not have the built in ability to backup to Windows Azure, it also includes the options to encrypt and compress during backup.<\/p>\n\n<\/a>SQL Server Management Studio Support for SQL Server Backup to URL (Windows Azure storage)<\/h1>\n
Backup UI Changes:\u00a0<\/strong><\/h2>\n
\n
<\/a><\/p>\n\n
\n
<\/a>
<\/span><\/p>\n\n
\n
<\/a><\/p>\nRestore UI Changes:\u00a0<\/h2>\n
\n
<\/a><\/p>\n
<\/a><\/div>\n
<\/a><\/p>\n\n<\/a>SQL Server Managed Backup to Windows Azure Storage<\/h1>\n
Use msdb;
GO
EXEC smart_admin.sp_set_db_backup
@database_name='TestDB'
,@enable_backup=1
,@retention_days =30
,@credential_name ='MyCredential'
,@encryption_algorithm ='AES_256'
,@encryptor_type= 'Certificate'
,@encryptor_name='MyServerCert01';
GO
<\/code><\/pre>\nUse msdb;
GO
EXEC smart_admin.sp_set_instance_backup
@enable_backup=1
,@retention_days=30
,@credential_name='sqlbackuptoURL',
,@encryption_algorithm ='AES_128'
,@encryptor_type= 'Certificate'
,@encryptor_name='MyBackupCert';
GO
<\/code><\/pre>\n\n<\/a>Encrypted Backup<\/h1>\n
USE master;
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '23987hxJ#KL95234nl0zBef';
<\/code><\/pre>\n<\/div>\nUse Master
GO
CREATE CERTIFICATE MyTestDBBackupEncryptCert
WITH SUBJECT = 'MyTestDB Backup Encryption Certificate';
<\/code>\u00a0<\/span><\/pre>\n3. Backup a database and choose the encryption option, specify an encryption algorithm, specify the certificate to use.<\/span><\/pre>\nBACKUP DATABASE [MyTestDB]
TO DISK = N'C:\\Program Files\\Microsoft SQL Server\\MSSQL12.MSSQLSERVER\\MSSQL\\Backup\\MyTestDB.bak'
WITH
ENCRYPTION
(
ALGORITHM = AES_256,
SERVER CERTIFICATE = MyTestDBBackupEncryptCert
),
STATS = 10
GO
<\/code><\/pre>\nBackup UI Changes:<\/h2>\n
<\/a><\/p>\n\n<\/a>SQL Server Backup to Windows Azure Tool<\/h2>\n