Solved

Defragmenting the Hard drive to improve SQL DB performance

Posted on 2010-11-15
4
601 Views
Last Modified: 2012-06-22
Hi All,

Recently my SQL DB has really slowed down and while trying to look for things to optimse to try and improve the situation we found the following;


1. MCafee Antivirus scanning

2. The DB was sitting on a RAID 5 Volume.

3. File fragmentation is at 86%


We are trying to do the following to optimse the following to correct the situation.
1. For the Antivirus, we have put the DB files under exceptions option.
2. We have created a RAID 10 volume and that is where we will move the Db data files
3. We would like to leave the log file on the current volume. But because Fragmentation is resource intensive we wanted to move the log files to another volume and then defrag the current volume. My question is, if you move the busy DB files to another volume and defrag the former volume and then copy back the files, is there a benefit. When you copy the files to another volume, which is nicely fragmented is there a benefit or it gets fragmented the same way? I need your advice on this one.
0
Comment
Question by:ackimc
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
Ernie Beek earned 167 total points
ID: 34135840
'When you copy the files to another volume, which is nicely fragmented is there a benefit or it gets fragmented the same way?'

I assume the first fragmented should be defragmented...

When you write a file or DB (they're both files) to a clean or defragmented drive, the computer will try to write the file in contingeous free blocks. on a fragmented drive that isn't possible because the empty blocks are spread throughout the disk. After defragmenting the free blocks should (almost) all be contingeous so the fille to be written would also be.
This should mean an improvement in the time neede accessing the file.
0
 
LVL 47

Assisted Solution

by:dlethe
dlethe earned 333 total points
ID: 34136141
defragging rarely makes any significant improvement outside of marrketing literature from defrag software vendors.

why not exsmine root cause?
sql server does 64kb I/O.   is NTFS set up for 64KB on an ALIGNED partition? is raid10 set up for 64KB stripe?
if not, you could be leaving well over half your performance on the table
0
 

Author Comment

by:ackimc
ID: 34142826
Hi all,

Am now inclined to looking at other issues as well, after reading your comments here is what we found;

1. Using performance monitor, we noticed that during peak hours we are having disk queues

2. We restored the DB on the back and ran the command DBCC Showcontig, we noticed that tables commonly used had extent fragmentation up to 99.99%, I suspect this could be a big problem. Our application developers had give us the impression that there is auto indexing within the application. My question is can I rebuild indexes while we are running live, am worried about the server becoming too slow. Any ideas or how best can we do this. Which one should we do first, rebuild indexes first or defragment the drive first.

Dlethe, where do I check to see if SQL Server is set top use 64kb I/O and NTFS?

0
 
LVL 47

Assisted Solution

by:dlethe
dlethe earned 333 total points
ID: 34142854
This walks you through checking/setting NTFS parms & alignment
http://theether.net/kb/100104

To check the RAID controller, you need to check the raid controller using whatever software came with it.  You want each disk to read/write exactly either 32KB or 64KB at a time .

Now above is just a summary of some biggies, certainly the types of things that will make a much bigger gain then messing with defragging.

You might want to check the msft i/o tuning guide for SQL as well
http://technet.microsoft.com/en-us/library/cc966412.aspx
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hyper-convergence systems have taken the IT world by storm and have quickly started to change our point of view of how the data center should and could be architected. In this article, I’ll explain the benefits of employing a hyper-converged system …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now