Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Does anyone know the diff between shrink database or file? and what would the pros and cons? in what circumstances you wish to do either one?

thanks

share|improve this question

migrated from stackoverflow.com Sep 8 '10 at 14:57

This question came from our site for professional and enthusiast programmers.

2 Answers 2

up vote 3 down vote accepted

Basically, DBCC SHRINKFILE shrinks one file, but DBCC SHRINKDATABASE shrinks all files. This is well documented in Books Online: see the entry for DBCC SHRINKDATABASE. The sections "How DBCC SHRINKDATABASE works" and "Best practices" should answer your questions.

share|improve this answer

As for some pros/cons, read this article from Paul Randal, and his advice against SHRINKDATABASE. Just throwing it out there for you.

share|improve this answer
    
nice article but not what i'm after –  user53735 Sep 9 '10 at 0:54
1  
btw.. is there a way to fix fragmentation after shrink the database? –  user53735 Sep 9 '10 at 0:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.