You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/relational-databases/backup-restore/sql-server-backup-to-url.md
+28-39Lines changed: 28 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,49 +16,22 @@ ms.author: mathoma
16
16
17
17
This topic introduces the concepts, requirements and components necessary to use the Microsoft Azure Blob storage service as a backup destination. The backup and restore functionality are same or similar to when using DISK or TAPE, with a few differences. These differences and a few code examples are included in this topic.
18
18
19
-
## Requirements, Components, and Concepts
20
-
**In this section:**
21
-
22
-
-[Security](#security)
23
-
24
-
-[Introduction to Key Components and Concepts](#intorkeyconcepts)
25
-
26
-
-[Microsoft Azure Blob storage service](#Blob)
27
-
28
-
-[SQL Server Components](#sqlserver)
29
-
30
-
-[Limitations](#limitations)
31
-
32
-
-[Support for Backup/Restore Statements](#Support)
33
-
34
-
-[Using Backup Task in SQL Server Management Studio](../../relational-databases/backup-restore/sql-server-backup-to-url.md#BackupTaskSSMS)
35
-
36
-
-[SQL Server Backup to URL Using Maintenance Plan Wizard](../../relational-databases/backup-restore/sql-server-backup-to-url.md#MaintenanceWiz)
37
-
38
-
-[Restoring from Azure storage Using SQL Server Management Studio](../../relational-databases/backup-restore/sql-server-backup-to-url.md#RestoreSSMS)
39
-
40
-
### <aname="security"></a> Security
41
-
The following are security considerations and requirements when backing up to or restoring from the Microsoft Azure Blob storage service.
42
-
43
-
- When creating a container for the Microsoft Azure Blob storage service, we recommend that you set the access to **private**. Setting the access to private restricts the access to users or accounts able to provide the necessary information to authenticate to the Azure account.
44
-
45
-
> [!IMPORTANT]
46
-
> [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] requires that either an Azure account name and access key authentication or a Shared Access Signature and access token be stored in a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Credential. This information is used to authenticate to the Azure account when performing backup or restore operations.
47
-
48
-
- The user account that is used to issue BACKUP or RESTORE commands should be in the **db_backup operator** database role with **Alter any credential** permissions.
49
-
50
-
### <aname="intorkeyconcepts"></a> Introduction to Key Components and Concepts
51
-
The following two sections introduce the Microsoft Azure Blob storage service, and the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] components used when backing up to or restoring from the Microsoft Azure Blob storage service. It is important to understand the components and the interaction between them to do a backup to or restore from the Microsoft Azure Blob storage service.
19
+
20
+
## Overview
21
+
It is important to understand the components and the interaction between them to do a backup to or restore from the Microsoft Azure Blob storage service.
52
22
53
23
Creating an Azure Storage account within your Azure subscription is the first step in this process. This storage account is an administrative account that has full administrative permissions on all containers and objects created with the storage account. [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] can either use the Azure storage account name and its access key value to authenticate and write and read blobs to the Microsoft Azure Blob storage service or use a Shared Access Signature token generated on specific containers granting it read and write rights. For more information on Azure Storage Accounts, see [About Azure Storage Accounts](https://azure.microsoft.com/documentation/articles/storage-create-storage-account/) and for more information about Shared Access Signatures, see [Shared Access Signatures, Part 1: Understanding the SAS Model](https://azure.microsoft.com/documentation/articles/storage-dotnet-shared-access-signature-part-1/). The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Credential stores this authentication information and is used during the backup or restore operations.
54
24
55
25
### <aname="blockbloborpageblob"></a> Backup to block blob vs. page blob
56
26
There are two types of blobs that can be stored in the Microsoft Azure Blob storage service: block and page blobs. SQL Server backup can use either blob type depending upon the Transact-SQL syntax used: If the storage key is used in the credential, page blob will be used; if the Shared Access Signature is used, block blob will be used.
57
27
58
-
Backup to block blob is only available in SQL Server 2016 or later version. We recommend you to backup to block blob instead of page block if you are running SQL Server 2016 or later version. The main reasons are:
28
+
Backup to block blob is only available in SQL Server 2016 or later version. Backup to block blob instead of page blob if you are running SQL Server 2016 or later.
29
+
The main reasons are:
59
30
- Shared Access Signature is a safer way to authorize blob access compared to storage key.
60
31
- You can backup to multiple block blobs to get better backup and restore performance, and support larger database backup.
61
32
-[Block blob](https://azure.microsoft.com/pricing/details/storage/blobs/) is cheaper than [page blob](https://azure.microsoft.com/pricing/details/storage/page-blobs/).
33
+
- Customers that need to backup to page blobs via a proxy server will need to use backuptourl.exe.
34
+
62
35
63
36
Backup of a large database to blob storage is subject to the limitations listed in [Managed instance T-SQL differences, limitations, and known issues](/azure/sql-database/sql-database-managed-instance-transact-sql-information#backup).
64
37
@@ -91,7 +64,17 @@ Backup of a large database to blob storage is subject to the limitations listed
91
64
92
65
For information on other examples where credentials are used, see [Create a SQL Server Agent Proxy](../../ssms/agent/create-a-sql-server-agent-proxy.md).
93
66
94
-
### <aname="limitations"></a> Limitations
67
+
## <aname="security"></a> Security
68
+
The following are security considerations and requirements when backing up to or restoring from the Microsoft Azure Blob storage service.
69
+
70
+
- When creating a container for the Microsoft Azure Blob storage service, we recommend that you set the access to **private**. Setting the access to private restricts the access to users or accounts able to provide the necessary information to authenticate to the Azure account.
71
+
72
+
> [!IMPORTANT]
73
+
> [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] requires that either an Azure account name and access key authentication or a Shared Access Signature and access token be stored in a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Credential. This information is used to authenticate to the Azure account when performing backup or restore operations.
74
+
75
+
- The user account that is used to issue BACKUP or RESTORE commands should be in the **db_backup operator** database role with **Alter any credential** permissions.
76
+
77
+
## <aname="limitations"></a> Limitations
95
78
96
79
- Backup to premium storage is not supported.
97
80
@@ -112,7 +95,13 @@ Backup of a large database to blob storage is subject to the limitations listed
112
95
- Specifying backupset options - **RETAINDAYS** and **EXPIREDATE** are not supported.
113
96
114
97
-[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] has a maximum limit of 259 characters for a backup device name. The BACKUP TO URL consumes 36 characters for the required elements used to specify the URL - 'https://.blob.core.windows.net//.bak', leaving 223 characters for account, container, and blob names put together.
98
+
99
+
- If your server accesses Azure via a proxy server, you must use trace flag 1819 and then set the WinHTTP proxy configuration via one of the following methods:
100
+
- The [proxycfg.exe](/windows/win32/winhttp/proxycfg-exe--a-proxy-configuration-tool) utility on Windows XP or Windows Server 2003 and earlier.
101
+
- The [netsh.exe](/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc731131) utility on Windows Vista and Windows Server 2008 or later.
115
102
103
+
## Supported arguments & statements
104
+
116
105
### <aname="Support"></a> Support for Backup/Restore Statements
@@ -202,7 +191,7 @@ Backup of a large database to blob storage is subject to the limitations listed
202
191
203
192
For more information about Restore arguments, see [RESTORE Arguments (Transact-SQL)](../../t-sql/statements/restore-statements-arguments-transact-sql.md).
204
193
205
-
## <aname="BackupTaskSSMS"></a> Using Back Up Task in SQL Server Management Studio
194
+
## <aname="BackupTaskSSMS"></a> Back up up with SSMS
206
195
You can back up a database to URL through the Back Up task in SQL Server Management Studio using a SQL Server Credential.
207
196
208
197
> [!NOTE]
@@ -236,13 +225,13 @@ When you select **URL** as the destination, certain options in the **Media Optio
236
225
237
226
[Create Credential - Authenticate to Azure Storage](../../relational-databases/backup-restore/create-credential-authenticate-to-azure-storage.md)
238
227
239
-
## <aname="MaintenanceWiz"></a> SQL Server Backup to URL Using Maintenance Plan Wizard
228
+
## <aname="MaintenanceWiz"></a> Back up with maintenance plan
240
229
Similar to the backup task described previously, the Maintenance Plan Wizard in SQL Server Management Studio includes **URL** as one of the destination options, and other supporting objects required to backup to Azure storage like the SQL Credential. It has the same For more information, see the **Define Backup Tasks** section in [Using Maintenance Plan Wizard](../../relational-databases/maintenance-plans/use-the-maintenance-plan-wizard.md#SSMSProcedure).
241
230
242
231
> [!NOTE]
243
232
> To create a striped backup set, a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] file-snapshot backup, or a SQL credential using Shared Access token, you must use Transact-SQL, Powershell or C# rather than the Backup task in Maintenance Plan Wizard.
244
233
245
-
## <aname="RestoreSSMS"></a> Restoring from Microsoft Azure storage Using SQL Server Management Studio
234
+
## <aname="RestoreSSMS"></a> Restore with SSMS
246
235
The Restore Database task includes **URL** as a device to restore from. The following steps describe using the Restore task to restore from the Microsoft Azure Blob storage service:
247
236
248
237
1. Right-click **Databases** and select **Restore Database...**.
@@ -259,7 +248,7 @@ The Restore Database task includes **URL** as a device to restore from. The fol
259
248
260
249
3.**Add:** Used to register an existing container that you do not have a shared access signature for. See [Connect to a Microsoft Azure Subscription](../../relational-databases/backup-restore/connect-to-a-microsoft-azure-subscription.md).
261
250
262
-
4.**OK:**SQL Server connects to Microsoft Azure storage using the SQL Credential information you provided and opens the **Locate Backup File in Microsoft Azure** dialog. The backup files residing in the storage container are displayed on this page. Select the file you want to use to restore and click **OK**. This takes you back to the **Select Backup Devices** dialog, and clicking **OK** on this dialog takes you back to the main **Restore** dialog where you will be able complete the restore.
251
+
4.**OK:**SQL Server connects to Microsoft Azure storage using the SQL Credential information you provided and opens the **Locate Backup File in Microsoft Azure** dialog. The backup files residing in the storage container are displayed on this page. Select the file you want to use to restore and click **OK**. This takes you back to the **Select Backup Devices** dialog, and clicking **OK** on this dialog takes you back to the main **Restore** dialog where you will be able complete the restore.
0 commit comments