Database files seriously fragmented on hard drive

  • Hello all.

    So I have a drive that is 69% fragmented according to windows server 2003 R2's Disk defrag tool. Unfortunately most of the fragmentation is coming from a few database files that I have that are > 20GB in size. I have tried diskeeper and a few other freeware defrag programs, but nothing seems to be able to make the drive any less than 69% defragmented.

    What can I do to alleviate this problem?

    Link to my blog http://notyelf.com/

  • Sounds like that's being caused by auto-growth. Look at a. making the files big enough that they don't need to auto-grow a lot, and b. making your auto-growth factor somewhat bigger (so that it buys you some time.

    If you have anything shrinking your files (logs or db files), turn it off. It's probably the main reason your file fragmentation is so high.

    Finally - is diskeeper telling you you NEED to defrag? Because it tends to get "lazy" when you won't get any perf gains out of furthewr defragmentation (read - it basically doesn't do much in the way of defragging if it doesn't think it will help speed-wise).

    If you can afford the downtime - you might benefit from copying the files off of that volume, defragging again and then copying them back on once the defrag is done.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Can't you degrag the file on the drive? If it's really fragmented, I'd take some downtime on a weekend and try to clean it up.

  • I have found the easiest method of defragmenting database files is to backup and restore the database. When SQL Server restores a database, it creates brand new files for the database and will create those files as contiguously as is possible on the storage array.

    Once that is done - make sure you modify the settings of the database to get a controlled autogrowth and then monitor the usage so you can manually grow the file instead of relying on autogrowth.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

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

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