Defragmenting and SQL server

Chiefcrowe

Diamond Member
Sep 15, 2008
5,056
199
116

what is the proper way to defragment a machine with SQL databases on it?

thanks,
 

JDMnAR1

Lifer
May 12, 2003
11,984
1
0
In general, unless you have grown the databases on the fly, don't. If you sized the DBs properly and haven't had to expand them, they are already contiguous on the disk, regardless of how much space they are actually using. (When you allocate space to a DB initially, SQL server grabs all of that space on disk no matter what is used at the time.) If you have had to grow them multiple times, then you may have disk fragmentation and you need to stop SQL services prior to defrag.