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).
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:
INF: How to Obtain the Latest SQL Server 2000 Service Pack
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.
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.
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.