Skip to content

Commit cff8a9f

Browse files
authored
Merge pull request #8440 from sevend2/OrgaizationUpdate
AB#5015, AB#5016, AB#5017, AB#5018: SQL articles re-organization update
2 parents 22a0bb8 + 2d7b3a6 commit cff8a9f

4 files changed

Lines changed: 121 additions & 65 deletions

File tree

support/sql/database-engine/backup-restore/backup-restore-operations.md

Lines changed: 71 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: SQL Server backup and restore operation issues
33
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
55
ms.custom: sap:Database Backup and Restore
66
ms.reviewer: ramakoni
77
editor: v-jesits
@@ -23,7 +23,7 @@ Backup and restore operations are I/O intensive. Backup/Restore throughput depen
2323
RESTORE DATABASE successfully processed 315 pages in 0.372 seconds (6.604 MB/sec)
2424
```
2525
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) 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.
2727
2828
- 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.
2929
@@ -37,16 +37,15 @@ Backup and restore operations are I/O intensive. Backup/Restore throughput depen
3737
3838
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.
3939
40-
|Knowledge Base or Books Online link|Explanation and recommended actions|
40+
|Knowledge Base link|Explanation and recommended actions|
4141
|---|---|
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.|
4343
| [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.|
4444
| [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.|
4545
| [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.|
4646
| [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.|
4747
| [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.|
4848
| [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).|
5049
|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.|
5150
5251
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
5756
5857
## Issues that affect database restoration between different SQL Server versions
5958
59+
**Symptoms**
60+
6061
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:
6162
6263
> 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.
6364
65+
**Resolution**
66+
6467
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.
6568
6669
> [!NOTE]
@@ -83,40 +86,49 @@ For more information about how to generate scripts for your database, see [Scrip
8386
8487
## Backup job issues in Always On environments
8588
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**
8794
8895
- 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.
8996
- 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.
9097
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:
9299
93100
- [Configure backups on secondary replicas of an Always On availability group](/sql/database-engine/availability-groups/windows/configure-backup-on-availability-replicas-sql-server)
94101
- [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)
95102
96103
## Media-related errors when you restore a database from a backup
97104
105+
**Symptoms**
106+
98107
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:
99108
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.
103112
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.
106114
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).
108115
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**
110117
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).
112119
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**
114121
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.
117127
118128
## Backups fail because of permissions issues
119129
130+
**Symptoms**
131+
120132
When you try to run database backup operations, one of the following errors occurs.
121133
122134
- **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
135147
Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
136148
```
137149
150+
**Cause**
151+
138152
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.
139153
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).
141157
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.
144158
145159
## Backup or restore operations that use third-party backup applications fail
146160
@@ -161,19 +175,46 @@ SQL Server provides a Virtual Backup Device Interface (VDI) tool. This API enabl
161175
|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) |
162176
|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) |
163177
| 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) |
165178
166179
### More resources
167180
168181
[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)
169182
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**
171216
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).
177218
178219
## FAQ about SQL Server backup and restore operations
179220
@@ -213,9 +254,9 @@ SQL Server provides a Virtual Backup Device Interface (VDI) tool. This API enabl
213254
214255
## Reference topics for SQL Server backup and restore operations
215256
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:
217258
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.
219260
- The following table lists additional topics that you might want to review for specific tasks that are related to backup and restore operations.
220261
221262
|Reference|Description|

0 commit comments

Comments
 (0)