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
The Azure extension for [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] can perform backups automatically for the system and user databases that are part of the instance of [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] enabled by Azure Arc.
16
+
The Azure extension for [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] can perform backups automatically for the system and user databases of the instance of [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] enabled by Azure Arc.
17
17
18
18
This article explains how you can:
19
19
@@ -22,35 +22,49 @@ This article explains how you can:
Backup files are stored in the default backup location of the SQL instance.
26
+
27
+
You can enable automated backups through Azure portal or via `az` CLI.
26
28
27
-
You can enable automated backups through Azure portal or via `az` CLI by setting the retention days property to a value between 1 and 35 days.
29
+
To enable automated backups, set the retention days to a nonzero value.
28
30
29
31
### Supported license types
30
32
31
-
Automated backups are only supported for license types of PAID or PAYG.
33
+
Automated backups are only available for licenses with Software Assurance, SQL subscription, or pay-as-you-go. For details, see [Feature availability depending on license type](overview.md#feature-availability-depending-on-license-type).
32
34
33
35
## Backup frequency and retention days
34
36
35
-
Two properties can be configured when you enable automated backups:
37
+
You can configure two properties for automated backups:
36
38
37
-
-**retention days** - number of days to retain the backup files. Use a number between 1 and 35.
38
-
-**backup schedule** - the schedule at which the full, differential, and transaction log backups should be performed. Full backups can be configured to run on a daily or weekly basis. Differential backups can be configured to run either every 12 hours or every 24 hours. Transaction log backups can be configured to run in increments of 5 minutes.
39
+
-**retention days** - number of days to retain the backup files. Use a number between 1 and 35. If the backup retention day is set to 0, automated backup is disabled and no backups are taken, even though backup policy is retained.
40
+
-**backup schedule** - the schedule at which the full, differential, and transaction log backups should be performed. Depends on backup type:
41
+
- Full backups: Daily or weekly
42
+
- Differential backups: Every 12 hours or every 24 hours
43
+
- Transaction log backups: Increments of 5 minutes.
39
44
40
-
Backups can also be configured to run on a **default** schedule which is as follows:
45
+
You can also run backups on a **default** schedule:
41
46
47
+
- Retention period: 7 days
42
48
- Full backups: every 7 days
43
49
- Differential backups: every 24 hours
44
-
- Transaction log backups: every 15 minutes
50
+
- Transaction log backups: every 5 minutes
51
+
52
+
## Backup schedule level
53
+
54
+
You can schedule backups at
55
+
56
+
- Instance level
57
+
- Database level (available from [extension version 1.1.2594.118](release-notes.md#march-12-2024) or later)
58
+
59
+
If both database and instance level backup schedule is set, database level schedule takes precedence over the instance level backup schedule. If you delete the database level backup schedule, the instance level backup schedule applies.
45
60
46
61
## Assign permissions
47
62
48
-
The backup service within the Azure extension for Arc-enabled SQL Server uses [NT AUTHORITY\SYSTEM] account to perform the backups. If you are [operating SQL Server enabled by Arc with least privilege](configure-least-privilege.md), backup is performed by local Windows account [NT Service\SQLServerExtension].
49
-
50
-
If you are using Azure extension for SQL Server [version 1.1.2504.99](release-notes.md#november-14-2023) or later, the necessary permissions are granted to [NT AUTHORITY\SYSTEM] automatically and you do not need to perform any additional steps to assign permissions.
51
-
52
-
**For earlier extensions only**, follow the below steps to assign permission to [NT AUTHORITY\SYSTEM] account.
63
+
The backup service within the Azure extension for Arc-enabled SQL Server uses [NT AUTHORITY\SYSTEM] account to perform the backups. If you're [operating SQL Server enabled by Arc with least privilege](configure-least-privilege.md), A local Windows account - [NT Service\SQLServerExtension] - performs the backup.
53
64
65
+
If you use Azure extension for SQL Server [version 1.1.2504.99](release-notes.md#november-14-2023) or later, the necessary permissions are granted to [NT AUTHORITY\SYSTEM] automatically. You don't need to assign permissions manually.
66
+
67
+
**For earlier extensions only**, follow the below steps to assign permission to [NT AUTHORITY\SYSTEM] account.
54
68
55
69
> [!NOTE]
56
70
> This requirement applies to the preview release.
@@ -79,15 +93,21 @@ If you are using Azure extension for SQL Server [version 1.1.2504.99](release-no
79
93
80
94
1. Run the preceding code for each user and system database (except `tempdb`).
81
95
82
-
## Enable automated backups
96
+
## Configure automated backups
83
97
84
-
After you have assigned permissions, you can enable automated backups.
98
+
Automated backups are disabled by default.
99
+
100
+
After you assigned permissions, you can schedule automated backups. After the automated backups are configured, the Arc SQL extension initiates a backup to the default backup location.
101
+
102
+
The backups are native SQL Server backups, so all backup history is available in the backup related tables in the msdb database.
103
+
104
+
### Instance level
85
105
86
106
### [Azure portal](#tab/azure)
87
107
88
108
To enable automated backups in Azure portal:
89
109
90
-
1. Disable any existing backup routines.
110
+
1. Disable any existing external backup routines.
91
111
1. Browse to the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] you want to enable automated backups.
92
112
1. Select **Backups**.
93
113
1. Select **Configure policies**.
@@ -96,55 +116,146 @@ To enable automated backups in Azure portal:
96
116
- Set a schedule for the full, differential, and transactional log backups.
97
117
1. Select **Apply** to enable this configuration.
98
118
99
-
Once the automated backups are configured, the Arc SQL extension will initiate a backup of all the databases to the default backup location configured.
100
-
101
-
Once the backups are enabled, a full backup for each user database is initiated right away. The backups are native [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] backups which means all backup history is available in the backup related tables in the `msdb` database.
119
+
Set retention period and frequency to meet business requirements. The retention policy should be greater than the full backup frequency. As a measure of safety, the automated backup process always keeps backups sets of at least one full backup frequency plus the retention days.
102
120
103
121
### [Azure CLI](#tab/az)
104
122
105
123
To enable automated backups using `az` CLI:
106
124
107
125
1. Disable any existing backup routines.
108
-
1. After you disable existing backup routines, run the following command:
109
-
110
-
a. Add the extension:
126
+
1. If necessary, add the arcdata extension:
111
127
112
128
```azurecli
113
-
--Install the arcdata extension if not already done
114
129
az extension add --name arcdata
115
130
```
116
131
117
-
b. Configure either the default schedule or a custom schedule:
132
+
1. Configure either the default schedule or a custom schedule:
118
133
119
134
**Default schedule**
120
135
121
136
```azurecli
122
-
az sql server-arc backups-policy set --name <arc-server-name> --resource-group <resourcegroup> --retention-days <retentiondays>
137
+
az sql server-arc backups-policy set --name <arc-server-name> --resource-group <resourcegroup> --default-policy
123
138
```
124
139
125
140
Example:
126
141
127
142
```azurecli
128
-
az sql server-arc backups-policy set --name MyArcServer_SQLServerPROD --resource-group my-rg --retention-days 24
143
+
az sql server-arc backups-policy set --name MyArcServer_SQLServerPROD --resource-group MyResourceGroup --default-policy
129
144
```
130
145
131
146
**Custom schedule**
132
147
133
148
```azurecli
134
-
az sql server-arc backups-policy set --name <arc-server-name> --resource-group <resourcegroup> --retention-days <retentiondays> --full-backup-days <num of days> --diff-backup-hours <12 or 24 hours> --tlog-backup-mins <num in minutes>
149
+
az sql server-arc backups-policy set --name <arc-server-name> --resource-group <resourcegroup> --retention-days <number of days> --full-backup-days <num of days> --diff-backup-hours <12 or 24 hours> --tlog-backup-mins <number of minutes>
135
150
```
136
151
137
152
Example:
138
153
139
154
```azurecli
140
-
az sql server-arc backups-policy set --name MyArcServer_SQLServerPROD --resource-group my-rg --retention-days 24 --full-backup-days 7 --diff-backup-hours 24 --tlog-backup-mins 30
155
+
az sql server-arc backups-policy set --name MyArcServer_SQLServerPROD --resource-group MyResourceGroup --retention-days 24 --full-backup-days 7 --diff-backup-hours 24 --tlog-backup-mins 30
141
156
```
142
157
158
+
> [!NOTE]
159
+
> If the backup retention day is set to 0, automated backup is disabled and no backups are taken.
160
+
143
161
---
144
162
163
+
### Database level
164
+
165
+
### [Azure portal](#tab/azure)
166
+
167
+
To configure individual custom database level backup in the portal:
- Set a value for backup retention days - between 1 and 35.
176
+
- Set a schedule for the full, differential, and transactional log backups.
177
+
1. Select **Apply** to enable this configuration.
178
+
179
+
Set retention period and frequency to meet business requirements. The retention policy should be greater than the full backup frequency. As a measure of safety, the automated backup process always keeps backups sets of at least one full backup frequency plus the retention days.
180
+
181
+
### [Azure CLI](#tab/az)
182
+
183
+
To enable automated backups on a database level using az CLI:
184
+
185
+
1. Disable any existing backup routines.
186
+
2. If necessary, add the arcdata extension:
187
+
188
+
```azurecli
189
+
az extension add --name arcdata
190
+
```
191
+
192
+
1. Configure either the default schedule or a custom schedule:
193
+
194
+
**Default schedule**
195
+
196
+
```azurecli
197
+
az sql db-arc backups-policy set --name <sql-database-name> --server <arc-server-name> --resource-group <resourcegroup> --default-policy
198
+
```
199
+
200
+
Example:
201
+
202
+
```azurecli
203
+
az sql db-arc backups-policy set --name MyDatabaseName--server MyArcServer_SQLServerPROD --resource-group MyResourceGroup --default-policy
204
+
```
205
+
206
+
**Custom schedule**
207
+
208
+
```azurecli
209
+
az sql db-arc backups-policy set --name <sql-database-name> --server <arc-server-name> --resource-group <resourcegroup> --retention-days <number of days> --full-backup-days <num of days> --diff-backup-hours <12 or 24 hours> --tlog-backup-mins <number of minutes>
210
+
```
211
+
212
+
Example:
213
+
214
+
```azurecli
215
+
az sql db-arc backups-policy set --name MyDatabaseName --server MyArcServer_SQLServerPROD --resource-group MyResourceGroup --retention-days 30 --full-backup-days 7 --diff-backup-hours 12 --tlog-backup-mins 10
216
+
```
217
+
218
+
---
219
+
220
+
## Disable automated backup
221
+
222
+
If the backup retention day is set to 0, automated backup is disabled and no backups are taken, even though backup policy is retained. Setting the backup retention to a nonzero value enables the policy again.
223
+
224
+
This setting applies to both database and instance level backup. If database level backup schedule is disabled, no backups are taken for the database even if instance level backup is scheduled.
225
+
226
+
## Delete automated backup
227
+
228
+
From the portal for individual database level backup scheduling page, select **Revert backup policy to instance level** to delete the database level backup policy.
229
+
230
+
To delete instance level backup schedule, you can do it through CLI. Once deleted, no backup is taken either in instance level or database level. You must configure a new backup schedule to take the backup again.
231
+
232
+
### Delete Instance Level Policy
233
+
234
+
```azurecli
235
+
az sql server-arc backups-policy delete --name <arc-server-name> --resource-group <resourcegroup>
236
+
```
237
+
238
+
Example:
239
+
240
+
```azurecli
241
+
az sql server-arc backups-policy delete --name MyArcServer_SQLServerPROD --resource-group MyResourceGroup
To view the current backup policy for a given Arc-enabled [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)], run the following command:
258
+
To view the current backup policy for a [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)], run the following command:
148
259
149
260
```azurecli
150
261
az sql server-arc backups-policy show --name <arc-server-name> --resource-group <resourcegroup>
@@ -153,7 +264,7 @@ az sql server-arc backups-policy show --name <arc-server-name> --resource-group
153
264
Example:
154
265
155
266
```azurecli
156
-
az sql server-arc backups-policy show --name MyArcServer_SQLServerPROD --resource-group my-rg
267
+
az sql server-arc backups-policy show --name MyArcServer_SQLServerPROD --resource-group MyResourceGroup
157
268
```
158
269
159
270
Output:
@@ -175,7 +286,7 @@ When the built-in automated backups are enabled on an instance of [!INCLUDE [ssn
175
286
## Considerations
176
287
177
288
- The backup files are stored in the default backup location.
178
-
- To find the default backup location for a [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] instance (on [!INCLUDE [sssql19-md](../../includes/sssql19-md.md)] and later) run:
289
+
- To find the default backup location for a [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] instance (on [!INCLUDE [sssql19-md](../../includes/sssql19-md.md)] and later), run:
@@ -186,19 +297,20 @@ When the built-in automated backups are enabled on an instance of [!INCLUDE [ssn
186
297
1. Connect to the Arc-enabled SQL Server from SSMS.
187
298
1. Go to **Server properties** > **Database Settings** > **Database default locations**.
188
299
189
-
- The backup policy is configured at the instance level and applies to all the databases on the instance.
300
+
- The backup policy configured at the instance level applies to all the databases on the instance.
301
+
- If both database and instance level backup schedules are set, database level takes precedence over the instance level backup schedule. Deleting the database level backup schedule reverts back to instance level backup schedule, if there's any.
190
302
- The value for `--name` should be the name of the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] enabled by Azure Arc, which is usually in the `[Servername_SQLservername]` format.
191
303
- The value for `--retention-days` can be from 0-35.
192
-
- A value of `0` for `--retention-days` indicates to not perform automated backups for the instance.
193
-
- The backup files are written to the default backup location as configured at the instance level.
304
+
- A value of `0` for `--retention-days` indicates to not perform automated backups for the instance or the database.
305
+
- The backup files are written to the default backup location as configured at the SQL Server instance level.
194
306
- If there are multiple [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] instances on the same host where the Azure extension for [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] is installed, you need to configure automated backups separately for each instance.
195
-
- If you change the `--retention-days` after the `--backups-policy` is already configured, any change will take effect going forward and isn't retroactively applied.
307
+
- If you change the `--retention-days` after the `--backups-policy` is already configured, any change takes effect going forward and isn't retroactively applied.
196
308
197
309
## Limitations
198
310
311
+
- The user databases need to be in full recovery model for the backups to be performed. Databases that aren't in full recovery model aren't automatically backed up.
199
312
- Automated backups are currently not supported for Always On failover cluster instances (FCI).
200
-
- Automated backups are not supported on any instance that hosts an availability group (AG) replica.
201
-
- The user databases need to be in full recovery model for the backups to be performed. Databases that aren't in full recovery model are not automatically backed up.
313
+
- Automated backups aren't supported on any instance that hosts an availability group (AG) replica.
202
314
- Automated backups are only available for licenses with Software Assurance, SQL subscription, or pay-as-you-go. For details, see [Feature availability depending on license type](overview.md#feature-availability-depending-on-license-type).
0 commit comments