2

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?

Uwe Keim
  • 2,370
  • 4
  • 29
  • 46

1 Answers1

3

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?

Rob Moir
  • 31,664
  • 6
  • 58
  • 86
  • 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... – Rob Moir Oct 19 '13 at 10:47
  • 1
    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