FIX: AUTO-SHRINK Option or DBCC SHRINKDATABASE May Slow Down SQL Server 2000 Performance (296386)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q296386
BUG: 353307 (SHILOH_BUGS)

SYMPTOMS

If a database is full or nearly full, and a large number of the tables in the database do not have clustered indexes, the AUTO-SHRINK database option or DBCC SHRINKDATABASE command may cause severe performance degradation for SQL Server 2000.

The performance may degrade to the point where queries do not return results in a timely fashion. It takes longer for new connections to connect, resulting in connection timeouts. SQL Server 2000 may appear to stop responding (hang).

RESOLUTION

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

290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack

WORKAROUND

To work around this problem, you can do the following:
  • Create a clustered index on all of your tables.
  • Turn off the AUTO-SHRINK option for the database.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft SQL Server 2000 Service Pack 2.

MORE INFORMATION

To turn off the AUTO-SHRINK option for a database, for example Pubs, run the following command from Query Analyzer from the 'master' database, after logging in as 'sa':
ALTER DATABASE pubs SET AUTO_SHRINK OFF
				
You can also turn off AUTO-SHRINK by using SQL Server Enterprise Manager (SEM). For more information, see the "Setting Database Options" topic in SQL Server Books Online.

Modification Type:MajorLast Reviewed:10/17/2003
Keywords:kbbug kbfix KB296386