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.

Our provider told me today that I should stop Microsoft SQL Server and other database systems like MySQL when using the Windows Disk Defragmenter.

Otherwise, the database might get corrupted.

Since I never heard about such a scenario and have some doubts, my question is:

Is it true that the Defragmenter might damage open files?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Defragmenting the disk while SQL Services are running is as safe as running defrag with the services stopped or on other, non database related data(*).

Windows own Defrag application, as well as pretty much all the alternatives, all use the file system defrag APIs built into the OS and file system, so there shouldn't be any great risk from defragging open files.

Your performance on that drive will take a serious hit, however, which might be worth thinking about depending on how responsive you need the database to be, as you're leaving it available, but that's about all you need to worry about.

(*) I wouldn't advise any major disk maintenance operations unless you had a backup, but of course you have a backup - it's your SQL database, right?

share|improve this answer
1  
Thanks, Rob. Yes, I do have backups :-) –  Uwe Keim Oct 19 '13 at 9:12
1  
@UweKeim Glad to hear it... but reading through some of the questions here, you'd be surprised and disappointed and quite understanding of why I laboured that point a bit... –  RobM Oct 19 '13 at 10:47
    
Well, I do think I have a backup by looking at the backup files I have from the system. To be really sure, I would have to do a restore test every week or so which I honestly don't do until now. –  Uwe Keim Oct 19 '13 at 11:15
add comment

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.