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: support/sql/database-engine/backup-restore/backup-restore-operations.md
+71-30Lines changed: 71 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: SQL Server backup and restore operation issues
3
3
description: This article troubleshoots SQL Server backup and restore operation issues, such as the operation taking a long time, issues between different SQL Server versions.
4
-
ms.date: 09/10/2021
4
+
ms.date: 03/21/2025
5
5
ms.custom: sap:Database Backup and Restore
6
6
ms.reviewer: ramakoni
7
7
editor: v-jesits
@@ -23,7 +23,7 @@ Backup and restore operations are I/O intensive. Backup/Restore throughput depen
- In SQL Server 2016 and later versions, you can use XEvent [backup_restore_progress_trace](/sql/relational-databases/backup-restore/back-up-and-restore-of-sql-server-databases) to track the progress of backup and restore operations.
26
+
- In SQL Server 2016 and later versions, you can use XEvent [backup_restore_progress_trace](/sql/relational-databases/backup-restore/back-up-and-restore-of-sql-server-databases#monitor-progress-with-xevent) to track the progress of backup and restore operations.
27
27
28
28
- You can use the `percent_complete` column of [sys.dm_exec_requests](/sql/relational-databases/system-dynamic-management-views/sys-dm-exec-requests-transact-sql) to track the progress of in-flight backup and restore operations.
29
29
@@ -37,16 +37,15 @@ Backup and restore operations are I/O intensive. Backup/Restore throughput depen
37
37
38
38
1. Check whether you're experiencing any of the known issues that are listed in the following table. Consider whether you should implement the changes or apply the fixes and best practices that are discussed in the corresponding articles.
39
39
40
-
|Knowledge Base or Books Online link|Explanation and recommended actions|
40
+
|Knowledge Base link|Explanation and recommended actions|
41
41
|---|---|
42
-
| [Optimizing Backup and Restore Performance in SQL Server](https://technet.microsoft.com/library/ms190954%28v=sql.105%29.aspx)|The Books Online topic covers various best practices that you can use to improve the performance of Backup/Restore operations. For example, you can assign the `SE_MANAGE_VOLUME_NAME` special privilege to the Windows account that's running SQL Server to enable instant initialization of data files. This can produce significant performance gains.|
42
+
| [Optimizing Backup and Restore Performance in SQL Server](https://technet.microsoft.com/library/ms190954%28v=sql.105%29.aspx)|This article covers various best practices that you can use to improve the performance of Backup/Restore operations. For example, you can assign the `SE_MANAGE_VOLUME_NAME` special privilege to the Windows account that's running SQL Server to enable instant initialization of data files. This can produce significant performance gains.|
43
43
| [2920151 Recommended hotfixes and updates for Windows Server 2012 R2-based failover clusters](https://support.microsoft.com/help/2920151) <br/><br/> [2822241 Windows 8 and Windows Server 2012 update rollup: April 2013](https://support.microsoft.com/help/2822241)|Current system rollups can include fixes for known issues at the system level that can degrade the performance of programs such as SQL Server. Installing these updates can help prevent such issues.|
44
44
| [2878182 FIX: User mode processes in an application are unresponsive on servers that are running Windows Server 2012](https://support.microsoft.com/help/2878182) <br/><br/>|Backup operations are I/O intensive and can be affected by this bug. Apply this fix to help prevent these issues.|
45
45
| [Configure antivirus software to work with SQL Server](../security/antivirus-and-sql-server.md)|Antivirus software may hold locks on .bak files. This can affect the performance of backup and restore operations. Follow the guidance in this article to exclude backup files from virus scans.|
46
46
| [2820470 Delayed error message when you try to access a shared folder that no longer exists in Windows](https://support.microsoft.com/help/2820470)|Discusses an issue that occurs when you try to access a shared folder that no longer exists in Windows 2012 and later versions.|
47
47
| [967351 A heavily fragmented file in an NTFS volume may not grow beyond a certain size](https://support.microsoft.com/help/967351)|Discusses an issue that occurs when an NTFS file system is heavily fragmented.|
48
48
| [304101 Backup program is unsuccessful when you back up a large system volume](https://support.microsoft.com/help/304101)||
49
-
| [2455009 FIX: Slow performance when you recover a database if there are many VLFs inside the transaction log in SQL Server 2005, in SQL Server 2008 or in SQL Server 2008 R2](https://support.microsoft.com/help/2455009)|The presence of many virtual log files could affect the required time to restore a database. This is especially true during the recovery phase of the restore operation. For information about other possible issues that can be caused by the presence of many VLFs, see [Database operations take a long time to complete, or they trigger errors when the transaction log has numerous virtual log files](https://support.microsoft.com/help/2028436).|
50
49
|A backup or restore operation to a network location is slow|Isolate the issue to the network by trying to copy a similarly sized file to the network location from the server that's running SQL Server. Verify the performance.|
51
50
52
51
2. Check for error messages in the SQL Server error log and Windows event log for more pointers about the cause of the problem.
@@ -57,10 +56,14 @@ Backup and restore operations are I/O intensive. Backup/Restore throughput depen
57
56
58
57
## Issues that affect database restoration between different SQL Server versions
59
58
59
+
**Symptoms**
60
+
60
61
A SQL Server backup can't be restored to an earlier version of SQL Server than the version at which the backup was created. For example, you can't restore a backup that's taken on a SQL Server 2019 instance to a SQL Server 2017 instance. Otherwise, the following error message appears:
61
62
62
63
> Error 3169: The database was backed up on a server running version %ls. That version is incompatible with this server, which is running version %ls. Either restore the database on a server that supports the backup, or use a backup that is compatible with this server.
63
64
65
+
**Resolution**
66
+
64
67
Use the following method to copy a database that's hosted on a later version of SQL Server to an earlier version of SQL Server.
65
68
66
69
> [!NOTE]
@@ -83,40 +86,49 @@ For more information about how to generate scripts for your database, see [Scrip
83
86
84
87
## Backup job issues in Always On environments
85
88
86
-
If you encounter problems that affect backup jobs or maintenance plans in Always On environments, note the following:
89
+
**Symptoms**
90
+
91
+
You encounter problems that affect backup jobs or maintenance plans in Always On environments.
92
+
93
+
**Resolution**
87
94
88
95
- By default, the automatic backup preference is set to **Prefer Secondary**. This specifies that backups should occur on a secondary replica - except if the primary replica is the only replica online. You can't take differential backups of your database by using this setting. To change this setting, use SSMS on your current primary replica, and navigate to **Backup Preferences** page under **Properties** of your availability group.
89
96
- If you're using a maintenance plan or scheduled jobs to generate backups of your databases, make sure to create the jobs for each availability database on every server instance that hosts an availability replica for the availability group.
90
97
91
-
For more information about backups in an Always On environment, see the following topics:
98
+
For more information about backups in an Always On environment, see the following articles:
92
99
93
100
- [Configure backups on secondary replicas of an Always On availability group](/sql/database-engine/availability-groups/windows/configure-backup-on-availability-replicas-sql-server)
94
101
- [Offload supported backups to secondary replicas of an availability group](/sql/database-engine/availability-groups/windows/active-secondaries-backup-on-secondary-replicas-always-on-availability-groups)
95
102
96
103
## Media-related errors when you restore a database from a backup
97
104
105
+
**Symptoms**
106
+
98
107
If you receive error messages that indicate a file issue, this is symptomatic of a corrupted backup file. The following are some examples of errors that you could get if a backup set is corrupted:
99
108
100
-
- > 3241: The media family on device '%ls' is incorrectly formed. SQL Server cannot process this media family.
101
-
- > 3242: The file on device '%ls' is not a valid Microsoft Tape Format backup set.
102
-
- > 3243: The media family on device '%ls' was created using Microsoft Tape Format version %d.%d. SQL Server supports version %d.%d.
109
+
> 3241: The media family on device '%ls' is incorrectly formed. SQL Server cannot process this media family.
110
+
111
+
> 3242: The file on device '%ls' is not a valid Microsoft Tape Format backup set.
103
112
104
-
> [!NOTE]
105
-
> You can use the [Restore Header](/sql/t-sql/statements/restore-statements-headeronly-transact-sql) statement to check your backups.
113
+
> 3243: The media family on device '%ls' was created using Microsoft Tape Format version %d.%d. SQL Server supports version %d.%d.
106
114
107
-
These issues can occur because of issues that affect the underlying hardware (hard disks, network storage, and so on) or that are related to a virus or malware. Review Windows System event logs and hardware logs for reported errors, and take appropriate action (for example, upgrade firmware or fix networking issues).
108
115
109
-
To prevent these errors, enable the **Backup CHECKSUM** option when you run a backup to avoid backing up a corrupted database. For more information, see [Possible Media Errors During Backup and Restore (SQL Server)](/sql/relational-databases/backup-restore/possible-media-errors-during-backup-and-restore-sql-server).
116
+
**Cause**
110
117
111
-
You can also enable trace flag 3023 to enable a checksum when you run backups by using backup tools. For more information, see [How to enable the CHECKSUM option if backup utilities don't expose the option](https://support.microsoft.com/topic/how-to-enable-the-checksum-option-if-backup-utilities-do-not-expose-the-option-0d5efb4c-5dfc-0122-c7e3-312a5dd5af3b).
118
+
These issues can occur because of issues that affect the underlying hardware (hard disks, network storage, and so on) or that are related to a virus or malware. Review Windows System event logs and hardware logs for reported errors, and take appropriate action (for example, upgrade firmware or fix networking issues).
112
119
113
-
To fix these issues, you have to either locate another usable backup file or create a new backup set. Microsoft doesn't offer any solutions that can help retrieve data from a corrupted backup set.
120
+
**Resolution**
114
121
115
-
> [!NOTE]
116
-
> If a backup file restores successfully on one server but not on another, try different ways to copy the file between the servers. For example, try [robocopy](/windows-server/administration/windows-commands/robocopy) instead of a regular copy operation.
122
+
- You can use the [Restore Header](/sql/t-sql/statements/restore-statements-headeronly-transact-sql) statement to check your backup.
123
+
- To reduce the occurrence of these restore errors, enable the **Backup CHECKSUM** option when you run a backup to avoid backing up a corrupted database. For more information, see [Possible Media Errors During Backup and Restore (SQL Server)](/sql/relational-databases/backup-restore/possible-media-errors-during-backup-and-restore-sql-server).
124
+
- You can also enable trace flag 3023 to enable a checksum when you run backups by using backup tools. For more information, see [How to enable the CHECKSUM option if backup utilities don't expose the option](https://support.microsoft.com/topic/how-to-enable-the-checksum-option-if-backup-utilities-do-not-expose-the-option-0d5efb4c-5dfc-0122-c7e3-312a5dd5af3b).
125
+
- To fix these issues, you have to either locate another usable backup file or create a new backup set. Microsoft doesn't offer any solutions that can help retrieve data from a corrupted backup set.
126
+
- If a backup file restores successfully on one server but not on another, try different ways to copy the file between the servers. For example, try [robocopy](/windows-server/administration/windows-commands/robocopy) instead of a regular copy operation. Investigate whether the file is being modified during the copy operation on the network or the destination storage device.
117
127
118
128
## Backups fail because of permissions issues
119
129
130
+
**Symptoms**
131
+
120
132
When you try to run database backup operations, one of the following errors occurs.
121
133
122
134
- **Scenario 1**: When you run a backup from SQL Server Management Studio, the backup fails and returns the following error message:
@@ -135,12 +147,14 @@ When you try to run database backup operations, one of the following errors occu
135
147
Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
136
148
```
137
149
150
+
**Cause**
151
+
138
152
Either of these scenarios can occur if the SQL Server service account doesn't have Read and Write permissions to the folder that backups are being written to. Backup statements can be run either as part of a job step or manually from SQL Server Management Studio. In either case, they always run under the context of the SQL Server Service startup account. Therefore, if the service account doesn't have the necessary privileges, you receive the error messages that were noted earlier.
139
153
140
-
For more information, see [Backup Devices](/sql/relational-databases/backup-restore/backup-devices-sql-server).
154
+
**Resolution**
155
+
156
+
You can check the current permissions of the SQL Server Service account on a folder by navigating to the **Security** tab in the properties of the corresponding folder, selecting the **Advanced** button, and then using the **Effective Access** tab. For more information, see [Backup Devices](/sql/relational-databases/backup-restore/backup-devices-sql-server).
141
157
142
-
> [!NOTE]
143
-
> You can check the current permissions of SQL Service account on a folder by navigating to the **Security** tab in the properties of the corresponding folder, selecting the **Advanced** button, and then using the **Effective Access** tab.
144
158
145
159
## Backup or restore operations that use third-party backup applications fail
146
160
@@ -161,19 +175,46 @@ SQL Server provides a Virtual Backup Device Interface (VDI) tool. This API enabl
161
175
|Backups of case-sensitive databases failing| [2987610 FIX: Error when you back up a database that has case-sensitive collation by using VSS in SQL Server 2012 SP2](https://support.microsoft.com/help/2987610) |
162
176
|Third-party backups that are made by using VSS writer may fail and return 8229 errors.| [2987610 FIX: Error when you back up a database that has case-sensitive collation by using VSS in SQL Server 2012 SP2](https://support.microsoft.com/help/2987610) |
163
177
| Understanding how VDI backup works |[How It Works: SQL Server - VDI (VSS) Backup Resources](https://techcommunity.microsoft.com/t5/sql-server-support/how-it-works-sql-server-vdi-vss-backup-resources/ba-p/315695) |
164
-
|Azure Site recovery agent reports failure | [ASR Agent or other non-component VSS backup fails for a server hosting SQL Server 2008 R2](https://support.microsoft.com/help/4504103) |
165
178
166
179
### More resources
167
180
168
181
[How It Works: How many databases can be backed up simultaneously?](https://techcommunity.microsoft.com/t5/sql-server-support/how-it-works-how-many-databases-can-be-backed-up-simultaneously/ba-p/315874)
169
182
170
-
## Miscellaneous issues
183
+
## Backups might fail if change tracking is enabled
184
+
185
+
**Symptoms**
186
+
187
+
Backups might fail if change tracking is enabled on the databases and return errors that resemble the following one:
188
+
189
+
> Error: 3999, Severity: 17, State: 1.
190
+
> \<Time Stamp\> spid \<spid\> Failed to flush the commit table to disk in dbid 8 due to error 2601. Check the error log for more information.
191
+
192
+
**Resolution**
193
+
194
+
To solve the issue, see the following articles:
195
+
196
+
- [2682488 FIX: Backup operation fails in a SQL Server 2008, in a SQL Server 2008 R2 or in a SQL Server 2012 database after you enable change tracking](https://support.microsoft.com/help/2682488)
197
+
- [2603910 FIX: Backup fails in SQL Server 2008, in SQL Server 2008 R2 or in SQL Server 2012 if you enable change tracking on the database](https://support.microsoft.com/help/2603910)
198
+
199
+
## Issues restoring backups of encrypted databases
200
+
201
+
**Symptoms**
202
+
203
+
You encounter issues when restoring backups of encrypted databases.
204
+
205
+
**Resolution**
206
+
207
+
To solve the issue, see [Move a TDE Protected Database to Another SQL Server](/sql/relational-databases/security/encryption/move-a-tde-protected-database-to-another-sql-server).
208
+
209
+
## Fail to restore a CRM backup from the Enterprise edition
210
+
211
+
**Symptoms**
212
+
213
+
You fail to restore a CRM backup from the Enterprise edition on a Standard edition.
214
+
215
+
**Resolution**
171
216
172
-
|Symptom/scenario|Remedial actions or additional information|
173
-
|---|---|
174
-
|Backups might fail if change tracking is enabled on the databases and returns errors that resemble the following:<br/><br/>"Error: 3999, Severity: 17, State: 1. <br/><br/>\<Time Stamp\> spid \<spid\> Failed to flush the commit table to disk in dbid 8 due to error 2601. Check the error log for more information."<br/><br/><br/>|See the following Microsoft Knowledge Base articles:<ul><li> [2682488 FIX: Backup operation fails in a SQL Server 2008, in a SQL Server 2008 R2 or in a SQL Server 2012 database after you enable change tracking](https://support.microsoft.com/help/2682488)</li><li> [2603910 FIX: Backup fails in SQL Server 2008, in SQL Server 2008 R2 or in SQL Server 2012 if you enable change tracking on the database](https://support.microsoft.com/help/2603910) </li><li> [2522893 FIX: A backup operation on a SQL Server 2008 or SQL Server 2008 R2 database fails if you enable change tracking on this database](https://support.microsoft.com/help/2522893)</li><ul> |
175
-
|Issues restoring backups of encrypted databases| [Move a TDE Protected Database to Another SQL Server](/sql/relational-databases/security/encryption/move-a-tde-protected-database-to-another-sql-server) |
176
-
|Trying to restore a CRM backup from the Enterprise edition fails on a Standard edition| [2567984 "Database cannot be started in this edition of SQL Server" error when restoring a Microsoft Dynamics CRM database](https://support.microsoft.com/help/2567984) |
217
+
To solve the issue, see [2567984 "Database cannot be started in this edition of SQL Server" error when restoring a Microsoft Dynamics CRM database](https://support.microsoft.com/help/2567984).
177
218
178
219
## FAQ about SQL Server backup and restore operations
179
220
@@ -213,9 +254,9 @@ SQL Server provides a Virtual Backup Device Interface (VDI) tool. This API enabl
213
254
214
255
## Reference topics for SQL Server backup and restore operations
215
256
216
-
- For more information about backup and restore operations, see the following topics in Books Online:
257
+
- For more information about backup and restore operations, see the following article:
217
258
218
-
["Back Up and Restore of SQL Server Databases"](/sql/relational-databases/backup-restore/back-up-and-restore-of-sql-server-databases): This topic covers the concepts of the backup and restore operations for SQL Server databases, provides links to additional topics, and provides detailed procedures to run various backups or restore tasks (such as verifying backups, and backing up by using T-SQL or SSMS). This is the parent topic about this subject in SQL Server documentation.
259
+
["Back Up and Restore of SQL Server Databases"](/sql/relational-databases/backup-restore/back-up-and-restore-of-sql-server-databases): This article covers the concepts of the backup and restore operations for SQL Server databases, provides links to additional topics, and provides detailed procedures to run various backups or restore tasks (such as verifying backups, and backing up by using T-SQL or SSMS). This is the parent topic about this subject in SQL Server documentation.
219
260
- The following table lists additional topics that you might want to review for specific tasks that are related to backup and restore operations.
0 commit comments