Microsoft KB Archive/279511

From BetaArchive Wiki
Knowledge Base


FIX: DBCC SHRINKFILE with Empty Option May Not Move Heap and Text Pages

Article ID: 279511

Article Last Modified on 3/14/2006



APPLIES TO

  • Microsoft SQL Server 7.0 Standard Edition



This article was previously published under Q279511

BUG #: 57330 (SQLBUG_70)

SYMPTOMS

Executing a DBCC SHRINKFILE (data_filename, EMPTYFILE) command on a multifile database with mostly heap or text pages may not empty pages from the first extent of the data file. Hence, the file cannot be dropped after the shrink operation is completed using ALTER DATABASE.

CAUSE

The allocation code sometimes reallocates pages out of the first extent of a file that DBCC SHRINKFILE (data_filename, EMPTYFILE) was trying to clear.

WORKAROUND

There are two ways to work around this problem:

  • If the table is a heap, create a clustered index before executing the DBCC SHRINKFILE (data_filename, EMPTYFILE) command.
  • If the table is a heap or contains at least one text or image column, transfer the table to another file group before executing the DBCC SHRINKFILE (data_filename, EMPTYFILE) command.


STATUS

Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 3 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

274799 INF: How to Obtain Service Pack 3 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0


For more information, contact your primary support provider.


Additional query words: shrinkfile emptyfile

Keywords: kbbug kbfix KB279511