September 05, 2007 05:05 PM

Does Your Database Need a Defrag?

Rating: (0)
SQL Server Magazine
InstantDoc ID #96983

Keeping SQL Server databases running smoothly is an ongoing task for DBAs, particularly in the area of database maintenance. Database performance can slow over time, caused by everything from limited server system memory or storage to performance-throttling server load driven by an increasing number of users.

Rick Pleczko, President and CEO at Idera, explains in an email interview that database maintenance is a vital task that DBAs need to pay attention to. "Keeping up with database maintenance is extremely important. Just like your car, if you don't keep up with maintenance then performance and availability suffer and eventually a significant breakdown occurs," says Pleczko. "In the world of SQL Server this can cause significant business interruption while problems are fixed or, even worse, data loss. It's a case of pay me now or pay me a lot more later."

In a recent issue of SQL Server Magazine, reader Eric Peterson suggests that defragmentation could help solve some performance-related issues. (See Reader to Reader, "Queries Dragging? Try Defragging," July 2007, InstantDoc ID 96059.) "Did you ever have a user tell you a query is taking a lot longer to compete than before, even though nothing in it has changed? If so, there's a good chance that the indexes in the table that the query ran against have become fragmented," explains Peterson. "Fixing this problem is a two-step process. First, you need to first determine which indexes have become fragmented. Second, you need to defrag those indexes."

To help address database index defragmentation, SQL Magazine Contributing Editor Kevin Kline suggests DBAs take a look at SQLIndexDefragAll, a free defragmentation script developed by Microsoft. "SQLIndexDefragAll defragments indexes on all unexcluded SQL Server databases," says Kline. "You can also use this job to defragment indexes within a specific SQL Server instance, database, or table." (See Tool Time with Kevin Kline, "DBA Automation Scripts," September 2007, InstantDoc ID 96463.)

Pleczko agrees that defragmentation tasks can be accomplished by using scripts and other tools for limited numbers of SQL Servers. He also argues that attempting to accomplish that task for "fifty or a hundred SQL Servers" is difficult to manage without automated tools, and suggests that Idera's recently upgraded SQL defrag manager 1.2 provides a solution for DBAs looking to automate defragmentation duties across multiple servers. Defrag manager provides central management and reporting of defrag operations, can be configured to defrag indexes automatically, and can point out areas where defragmentation could lead to performance improvements.

"We've seen cases where expensive application re-architecture projects have been initiated to solve a fragmentation related problem," says Pleczko. "[That] problem could have been solved very cheaply by simply automating and keeping up with maintenance activities."

SQL Defrag Manager 1.2 is $995 per SQL Server instance. For additional information email info@idera.com or visit the Idera Web site at http://www.idera.com.

Add a Comment

@ macknife - Thanks for the input--those are great comments.

Do you have any other tips about improving database performance? Are there certain utilities or products you would suggest that DBAs look into using for their defragmentation needs?

Jeff9/25/2007 10:26:47 AM


It can also be worthwhile, depending on how your database grows, to check the disk fragmentation as well. If you have sufficient space allocated for your database so that the data files do not have to automatically grow, disk fragmentation may not be an issue, but if your database is not allocated sufficient disk space and constantly grows to accommodate new data, then it is very probable that the data files will be fragmented across the disk(s). Defragging the disk(s) and allocating sufficient disk space for data growth without files growing automatically might be something that should be done prior to checking index fragmentation. Once the disk has been defragged, defragging the indexes will then be even more worthwile.

Michael9/13/2007 7:38:03 AM


You must log on before posting a comment.

Are you a new visitor? Register Here
GOOGLE LINKS
SPONSORED LINKS
FEATURED LINKS