Shrinking the database size (SQL 7)
We have a SQL 7 database that grew to about 50GB. Needless to say we've done
some work to minimize the size of it, but we've come to a problem trying
to release all the unused space to the OS. (Amount of data is about 13 GB).
We've tried to run the "Shrink Database" option in Ent. Mgr., and after working
for a long time, it simply stops responding, so we have to kill it with Task
Manager. Then, we created a SQL Job and scheduled it to run in the middle
of the night. That time it completed (about 14 hours later), and it shrunk
the file by 5 GB.
The statements we're using are:
1. DBCC SHRINKDATABASE (<db_name>, TRUNCATEONLY)
to let SQL determine how much it can take off
2. DBCC SHRINKDATABASE (<db_name>, 10)
to force it to leave 10% of free space (actually we've tried different options
5%, 10%, 50% and no setting seems to matter.
We'd appreciate your input for we are wasting valuable space on our server.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL