Windows Defrag SQL Server 2005 SP2

  • I've been reading several articles and there appears to be a conflict of opinions. Is there any point running the Windows Defrag on an NTFS disk with the SQL Server databases held on the disk still open and being used. I am reading information which says the windows defrag doesn't run on open files, but another user on this forum has said it can be run whilst SQL-Server is up & running.

    I've recently joined a db team where my predecessor had set the auto grow option on a data file to 1Mb, hence we have mdf files split into over 15,000 fragments. I've already changed the auto grow setting and also resized the files to a sensibly large size anyway, but I now want to clean up the mess on the disk.

  • Having a window-level defragment while SQL Server on is not recommended. It may crash your server.

  • As long as the defrag software can handle the file being allocated to SQL (it must defrag via the Windows API) then there is no problem. I have been doing this for years on multiple servers with no issues. I use Sysinternals Contig (now offered by Microsoft) http://technet.microsoft.com/en-us/sysinternals/bb897428.aspx

    Other programs work as well. I have experimented with PerfectDisk as well with no problems.

    Of course as you mentions controlling the growth and appropriate size allocation is optimal.

    Francis

  • I think Diskeeper states they can handle this situation. I still recommend that SQL Server be off during defrag operations.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • And a good, full backup prior to doing the defrag can't hurt!

    -- You can't be late until you show up.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply