Microsoft distributes Microsoft SQL Server 2008 R2 or Microsoft SQL Server 2008 fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 or SQL Server 2008 fix release.
Symptoms
Microsoft SQL Server 2008 R2 or Microsoft SQL Server 2008 might mark database data files as sparse even when the physical files are marked as not sparse in the file system.
Notes-
To determine whether the database data files are marked as sparse in the SQL Server metadata, run the following statement, and then check whether the Is_Sparse column is set to a nonzero value in the result set:
Use
<database name>
select is_sparse , physical_name from sys.database_files
-
To query the status of the physical files in the file system, run the following Windows command after the database is offline:
fsutil sparse queryflag
<files path>\<database file>
If you receive the following output, the file is marked as sparse in the file system:
This file is set as sparse.
-
Both the SQL Server metadata and the file system metadata must be marked as sparse for only database data files that are part of a database snapshot.
Cause
This issue occurs because the file system incorrectly marks a whole database data file as sparse after an alternative stream that was originally marked as sparse is removed. The alternative stream is removed when a DBCC CHECKDB command ends.
Notes-
Internal Database Snapshot Usage is an NTFS feature that is used by the DBCC CHECKDB family of commands. When you run DBCC commands, the database engine creates a database snapshot alternative stream and brings it to a transactional consistent state. The DBCC command runs checks against the alternative stream. The alternative stream is dropped after the DBCC command is finished.
-
The design that causes this issue was introduced in Windows Server 2003 in which Windows volume-level backups are used to back up database files. SQL Server metadata stores a copy of the sparse attributes for the data files in the system tables. However, SQL Server does not update the Is_Sparse information after the sparse attribute is removed from the file system.
-
This issue also occurs after you migrate a database from Windows Server 2003 to a later version of a Windows operating system.
For example, you migrate databases from Windows Server 2003 to Windows Server 2008 or to Windows Server 2008 R2.
Resolution
To resolve this issue in SQL Server 2008 R2 or in SQL Server 2008, apply the following hotfix, and then bring the database online. When database is brought online, SQL Server checks whether the metadata of the physical database file is marked as sparse in the file system. If it is marked as not sparse, the SQL Server metadata is updated.
Note To remove sparse attributes from the file system, copy the database files, and then use the new copy of the files for the database. For more information about this process, visit the following MSDN website:How to remove sparse attributes from the file system
Cumulative update information
SQL Server 2008 Service Pack 3
The fix for this issue was first released in cumulative update package 1 for SQL Server 2008 Service Pack 3. For more information about this cumulative update package, click the following article number to view the article in the Microsoft Knowledge Base:
2617146 Cumulative update package 1 for SQL Server 2008 Service Pack 3Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 fix release. Microsoft recommends that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2629969 The SQL Server 2008 builds that were released after SQL Server 2008 Service Pack 3 was released Microsoft SQL Server 2008 hotfixes are created for specific SQL Server service packs. You must apply a SQL Server 2008 Service Pack 3 hotfix to an installation of SQL Server 2008 Service Pack 3. By default, any hotfix that is provided in a SQL Server service pack is included in the next SQL Server service pack.
SQL Server 2008 Service Pack 1
The fix for this issue was first released in cumulative update package 16 for SQL Server 2008 Service Pack 1. For more information about this cumulative update package, click the following article number to view the article in the Microsoft Knowledge Base:
2582282 Cumulative update package 16 for SQL Server 2008 Service Pack 1Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 fix release. Microsoft recommends that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
970365 The SQL Server 2008 builds that were released after SQL Server 2008 Service Pack 1 was released Microsoft SQL Server 2008 hotfixes are created for specific SQL Server service packs. You must apply a SQL Server 2008 Service Pack 1 hotfix to an installation of SQL Server 2008 Service Pack 1. By default, any hotfix that is provided in a SQL Server service pack is included in the next SQL Server service pack.
SQL Server 2008 Service Pack 2
The fix for this issue was first released in cumulative update package 6 for SQL Server 2008 Service Pack 2. For more information about this cumulative update package, click the following article number to view the article in the Microsoft Knowledge Base:
2582285 Cumulative update package 6 for SQL Server 2008 Service Pack 2Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 fix release. Microsoft recommends that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2402659 The SQL Server 2008 builds that were released after SQL Server 2008 Service Pack 2 was released Microsoft SQL Server 2008 hotfixes are created for specific SQL Server service packs. You must apply a SQL Server 2008 Service Pack 2 hotfix to an installation of SQL Server 2008 Service Pack 2. By default, any hotfix that is provided in a SQL Server service pack is included in the next SQL Server service pack.
SQL Server 2008 R2 CU9
The fix for this issue was first released in cumulative update package 9 for SQL Server 2008 R2. For more information about how to obtain this cumulative update package for SQL Server 2008 R2, click the following article number to view the article in the Microsoft Knowledge Base:
2567713 Cumulative update package 9 for SQL Server 2008 R2 Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
981356 The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 was released
SQL Server 2008 R2 Service Pack 1 CU2
The fix for this issue was first released in cumulative update package 2. For more information about how to obtain this cumulative update package for SQL Server 2008 R2 SP1, click the following article number to view the article in the Microsoft Knowledge Base:
2567714 Cumulative update package 2 for SQL Server 2008 R2 Service Pack 1Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 SP1 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2567616 The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 Service Pack 1 was released
Hotfix information
A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing the problem described in this article. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.
If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix. Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft website:http://support.microsoft.com/contactus/?ws=supportNote The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.
Prerequisites
To apply this hotfix, you must have SQL Server 2008 R2 installed.
Restart requirement
You do not have to restart the computer after you apply this hotfix.
Hotfix replacement information
This hotfix does not replace a previously released hotfix.
File information
The global version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
File name |
File version |
File size |
Date |
Time |
Platform |
---|---|---|---|---|---|
Sqlservr.exe |
2009.100.1800.0 |
121,829,216 |
08-Jul-2011 |
11:55 |
IA-64 |
Sqlservr.exe |
2009.100.1800.0 |
62,027,616 |
08-Jul-2011 |
12:28 |
x64 |
Sqlservr.exe |
2009.100.1800.0 |
42,911,584 |
08-Jul-2011 |
13:22 |
x86 |
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
More Information
The following table provides more information about the products or tools that automatically check for this condition on your instance of SQL Server and on the versions of the SQL Server product against which the rule is evaluated.
Rule software |
Rule title |
Rule description |
Product versions against which the rule is evaluated |
---|---|---|---|
System Center Advisor |
SQL Server database files marked as sparse files |
System Center Advisor checks if this SQL Server instance contains database files that are marked as sparse. Only database snapshot files should be marked as files. If normal database files are marked as sparse, then Advisor generates an alert. Advisor relies on the is_sparse column in the catalog view sys.master_files. Review the details that are provided in the “Information Collected” section of the advisor alert, and check the sparse status at the OS level for the affected files. After you clear the OS sparse status, you can apply the hotfix discussed in this article to refresh the SQL Server metadata and synchronize with the OS settings. |
SQL Server 2008 SQL Server 2008 R2 SQL Server 2012 |
References
For more information about DBCC commands, visit the following MSDN website:
General information about DBCC commandsFor more information about the Fsutil statement, visit the following MSDN website:
General information about the Fsutil statementFor more information about this issue in Windows Server 2003, click the following article numbers to view the articles in the Microsoft Knowledge Base:
973886 You cannot restore large files in the NTFS file system when all the data streams that have sparse attributes are deleted in the 64-bit version of Windows XP SP2 or in Windows Server 2003 SP2
932021 Error message when you run the "chkdsk" command together with the "/v" switch on a Windows Server 2003-based computer: "Correcting sparse file record segment <number>"