FIX: Error message when you run the DBCC SHRINKFILE command or the DBCC SHRINKDATABASE command on a server that contains a SQL Server 2008 database: "5205 : DBCC SHRINKFILE: Moving Page <FileId>:<PageId> failed"

Extended support for SQL Server 2005 ended on April 12, 2016

If you are still running SQL Server 2005, you will no longer receive security updates and technical support. We recommend upgrading to SQL Server 2014 and Azure SQL Database to achieve breakthrough performance, maintain security and compliance, and optimize your data platform infrastructure. Learn more about the options for upgrading from SQL Server 2005 to a supported version here.

Bug #: 50003715 (SQL Hotfix)
Microsoft distributes 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 fix release.
SYMPTOMS
When you run the DBCC SHRINKFILE command or the DBCC SHRINKDATABASE command on a server that contains a Microsoft SQL Server 2008 database, you receive an error message that resembles the following:
5205 : DBCC SHRINKFILE: Moving Page FileId:PageId failed.
CAUSE
This problem occurs if the "Check for Page Type 20" routine runs against type 20 pages that are unallocated. Type 20 pages are known as bulk allocation pages. These pages are allocated during Online Indexing operations and during Bulk Inserts operations. As soon as the operations are complete, these pages are unallocated. However, in some scenarios, the pages may be left unallocated from an earlier build or version. When the "Check for Page Type 20" routine is performed against a page of this kind, the DBCC SHRINKFILE command or the DBCC SHRINKDATABASE command returns the error message that is mentioned in the "Symptoms" section.
RESOLUTION

Service pack information

To resolve this problem, obtain the latest service pack for SQL Server 2005. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
913089 How to obtain the latest service pack for SQL Server 2005

Cumulative update information

To resolve this problem, apply Cumulative Update 2 for SQL Server 2008, and then rerun the DBCC SHRINKFILE command or the DBCC SHRINKDATABASE command.

The fix for this issue was first released in Cumulative Update 2. For more information about how to obtain this cumulative update package for SQL Server 2008, click the following article number to view the article in the Microsoft Knowledge Base:
958186 Cumulative update package 2 for SQL Server 2008
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 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:
956909 The SQL Server 2008 builds that were released after SQL Server 2008 was released
WORKAROUND
To work around this problem, find the index that the page belongs to and then rebuild the index. To do this, use the ALTER INDEX command.

For more information about the ALTER INDEX command, see the SQL Server 2008 Books Online topic ALTER INDEX (Transact-SQL) on the following Microsoft TechNet Web site:
STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
MORE INFORMATION
For more information about what files are changed, and for information about any prerequisites to apply the cumulative update package that contains the hotfix that is described in this Microsoft Knowledge Base article, click the following article number to view the article in the Microsoft Knowledge Base:
958186 Cumulative update package 2 for SQL Server 2008
REFERENCES
For more information about the DBCC SHRINKFILE command, see the SQL Server 2008 Books Online topic DBCC SHRINKFILE (Transact-SQL) on the following Microsoft TechNet Web site: For more information about the DBCC SHRINKDATABASE command, see the SQL Server 2008 Books Online topic DBCC SHRINKDATABASE (Transact-SQL) on the following Microsoft TechNet Web site: For more information about the list of builds that are available after the release of SQL Server 2008, click the following article number to view the article in the Microsoft Knowledge Base:
956909 The SQL Server 2008 builds that were released after SQL Server 2008 was released
For more information about the Incremental Servicing Model for SQL Server, click the following article number to view the article in the Microsoft Knowledge Base:
935897 An Incremental Servicing Model is available from the SQL Server team to deliver hotfixes for reported problems
For more information about the naming schema for SQL Server updates, click the following article number to view the article in the Microsoft Knowledge Base:
822499New naming schema for Microsoft SQL Server software update packages
For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates
shrink failure allocation bulk
Properties

Article ID: 959376 - Last Review: 12/16/2008 00:47:27 - Revision: 2.0

Microsoft SQL Server 2008 Workgroup, Microsoft SQL Server 2008 Enterprise, Microsoft SQL Server 2008 Developer, Microsoft SQL Server 2008 Standard, Microsoft SQL Server 2005 Developer Edition, Microsoft SQL Server 2005 Enterprise Edition, Microsoft SQL Server 2005 Standard Edition, Microsoft SQL Server 2005 Workgroup Edition

  • kbbug kbexpertiseadvanced kbqfe kbfix KB959376
Feedback