Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Long ... DBCC SHRINK DATABASE

Status
Not open for further replies.

JayKusch

MIS
Oct 30, 2001
3,199
US
Afternoon,

Once a DBCC ShrinkDatabase (DBname,0, TRUNCATEONLY) has been run on a DB, how long should it take for the DB ro release the free space it is holding back to the OS file system? This DB was 60GB and now states it has 47GB of free space, which it has yet to release.


Thanks

J. Kusch
 
it should be immediate for the data files (log files are shrunk when you next back the log up or truncate it). I cant see why the above command wouldnt work unless its something to do with the 0 (maybe you cant shrink to 0 % free to the os, though I havent read anything which says that). You could try it again and specify that as 5% maybe. Its probably a good idea to have some free space in the datafiles anyway.

The only other thought is that you cant shrink smaller than the model database, but being as your db was 60gb!!...

Matt

Brighton, UK
 
Use DBCC SHRINKFILE to shrink the physical file. DBCC SHRINKDATABASE will not shrink the files smaller than the minimum file size, SHRINKFILE allows you to set a new minimum size.

DBCC SHRINKFILE (1, 15000)

If you want to get the best answer for your question read faq183-874 and faq183-3179.
Terry L. Broadbent - DBA
SQL Server Page:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top