Solved

Is it safe to defrag a server running Exchange?

Posted on 2008-10-30
14
1,451 Views
Last Modified: 2012-05-05
I know that there are certain things I need to be careful about backing up on an Exchange server.  Do similar rules apply to a generic defrag (not a database/Eseutil defrag)?  Running Windows Server 2003 R2 SP2 / Exchange 2003 SP2.
0
Comment
Question by:TechComposer
  • 6
  • 5
  • 2
  • +1
14 Comments
 
LVL 11

Expert Comment

by:willettmeister
ID: 22840144
We defrag out exchange servers but ensure that we exclude the database files themselves from being defragmented.  You can accomplish that by not defragmenting the drive that the database are on or using a tool like jkdefrag which can skip certain file types.
0
 
LVL 90

Expert Comment

by:John Hurst
ID: 22840191
Ditto - Using Perfect Disk on the server, we do not defrag Exchange databases.  ... T
0
 
LVL 2

Author Comment

by:TechComposer
ID: 22840228
Thanks, willetmeister.  I'll look into the tool.  I've been Googling a lot about this and am coming up with so many conflicting responses from so many people that seem to have exceptional credentials.  Is there a KB article on whether or not a disk-level defrag is acceptable on a drive containing Exchange databases?
0
 
LVL 11

Expert Comment

by:willettmeister
ID: 22841448
I haven't seen anything offical from microsoft.  
0
 
LVL 2

Author Comment

by:TechComposer
ID: 22841474
That's entirely frustrating, especially as this regards a fairly important, standard tool in Windows.
0
 
LVL 24

Expert Comment

by:flyguybob
ID: 22844820
This is about as close as you will find:
http://msexchangeteam.com/archive/2004/10/25/247342.aspx  - Nino's article is fantastic and still applies 4 1/2 years later.
http://msexchangeteam.com/archive/2004/10/25/247342.aspx.328804
http://support.microsoft.com/kb/328804
http://support.microsoft.com/kb/192185
http://support.microsoft.com/kb/256352

The Exchange databases might not be contiguous on disk, particularly if you have the .edb and .stm on the same disk or if you have multiple mailbox stores on the same phsyical disk but the online defrag keeps them contiguous as far as the database tables are concerned provided the given layout on the disk.  This online defrag process is usually executed between 0100 and 0500 unless it is modified.  The databases, log files, SMTP queue files, and executables should never need to be defragmented and doing so could cause corruption and require an offline defrag of the database using eseutil.  Offline defrags should never be part of a standard maintenance process and should only be used when required to repair database corruption and to reduce database size if there is a lot of whitespace and you don't have the option of moving all mailboxes to a new store and decomming the old store.

If you are experiencing performance problems then we should look at other things and resolve those issues first.  I would suggest running the ExTRA tool and analyze the server during periods of peak utilization.  The Exchange Troublshooting Assistant is available at www.exbpa.com and comes at no additional charge.

Years ago I ran DiskKeeper on my Exchagne servers, using the proper exclusions for Exchange and IIS (same ones I had for AV excusions) and never had a problem.  Regarding defrag in general I did have a co-worker nail the log files and corrupt their DB.  It was repaired rather quickly because it was small.  You will also notice that many of the "don't do its" surround what happens when a DB or the logs get scanned accidentially.

The unofficial official answer from Microsoft is best captured by Nino's blog (above).
0
 
LVL 2

Author Comment

by:TechComposer
ID: 22866262
Well, I'm working on running an offline defrag.  I started it at midnight PST, and it's now at 6%...nearly FOUR hours later.  Employees will begin to arrive in around 2 hours.  Can I cancel the defrag and remount the un-defragmented database, or must I wait for this process to complete?
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 24

Expert Comment

by:flyguybob
ID: 22866486
You should be able to safely cancel the offline defrag. It generates a second .stm and second .edb file and copies data to it.  Once it is complete it renames those temp files and deletes the original database files.

I take it that you have read the documenation and know that you don't need to run an offline defrag and should never do it as part of regular maintenance, correct?
0
 
LVL 2

Author Comment

by:TechComposer
ID: 22866521
I have read the documentation.  This is not a part of regular maintenance.  Many, MANY users have been moved on and off of this server in recent months.  Since performing all of these different moves, the I/O stats for store.exe have been redlining consistently.  The documents that I have read (the several links posted above) have lead me to believe that the particulars of this situation merit an offline defrag.  If I'm mistaken about this, please explain when exactly an offline defrag is necessary.

I have run the defrag with both the /t and /p options set.  The modified time of my original databases is still set at the time that I dismounted the store.  So, yes, it does appear that they have been untouched.
0
 
LVL 24

Expert Comment

by:flyguybob
ID: 22866793
Moving off and on the servers is common.  In and of itself it does not require one to perform an offline defrag.

A /p?  Was there corruption reported for the database (Isinteg will help to determine this)?

Did you run it with the /d option?  The /d is the defrag.  The /p is the "repair" option.


Offline defrags can be leveraged when the whitespace in the database is significant and you want to "recover" that whitespace.  You can view this by seeing the 1221 Event IDs noting that online defragmentation has been completed.  In all honesty, in these situations, I create a new store and move the users to the new mailbox store and decommission the old mailbox store.  Granted this is for Exchange 2003 Enterprise and not Standard Edition.  I digress...  If you have a large database and can recover 30% or more whitespace then it is possible to run the offline defrag to regain the space, reduce the size of your full backups, and reduce time required to restore the DB to a Recovery storage group.

There are other times that it should be run, such as when it would fix an error or when you are working with PSS/Customer Support.  Microsoft lists those times in the article below:
http://msexchangeteam.com/archive/2004/07/08/177574.aspx

0
 
LVL 24

Expert Comment

by:flyguybob
ID: 22866814
...and I had no clue that you were talking about an Eseutil /d defrag.  I thought we were focused on applications like Diskeeper and PowerDisk.  The offline defrag is a whole different ball of wax and there are several questions on here devoted to that.  I typed a few of them 2 years ago or more, if I recall correctly.  The other experts also posted some good info.
0
 
LVL 2

Author Comment

by:TechComposer
ID: 22866872
According to the KB articles posted above, /p (when used in conjunction with /d) does not instate the new database.  I wasn't focused on eseutil /d until you posted all the links regarding it... :)
0
 
LVL 24

Expert Comment

by:flyguybob
ID: 22867226
{quote} Well, I'm working on running an offline defrag.{quote}
This led me to believe that you were running an eseutil /d and not a repair.  The defrag does indeed create a new database.

{I have run the defrag with both the /t and /p options set.}
This was my confusion.  I was thinking just /p /t and not /d /p /t with the associated variables.

...and you really should not run a repair unless you have corruption in your database or it is required as part of a restore (again, because of corruption).  There are also arguments as to whether or not am Ex5.5 or E200x repaired database should run in production for an extended period of time.  ...and Ex5.5 is irrelevant since it's not in the scope of this question.  Again, going back to previous notes, it is better to create a new mailbox store, move users to the new DB, and decom the old DB.

0
 
LVL 24

Accepted Solution

by:
flyguybob earned 500 total points
ID: 22867251
I know my last statement about not running a repaired DB in production too long would raise some eyebrows.  Here is a link that is relevant to the discussion:
http://technet.microsoft.com/en-us/library/aa996773(EXCHG.65).aspx

Microsoft recommends that you follow these best practices when repairing a database:

Do not allow a repaired database to remain in production for an extended period of time.

Do not use the Eseutil repair option when backup is available.

Do not use Eseutil repair mode to expunge a -1018 error. For more information about error -1018, see Microsoft Knowledge Base article 812531, "Support WebCast: Microsoft Exchange: Understanding and Resolving Error -1018" (http://go.microsoft.com/fwlink/?linkid=3052&kbid=812531).

...and 1018 errors are a whole different ballgame that we don't even need to think about tangenting into oblivion if you have healthy disks and controllers.
0

Featured Post

Why spend so long doing email signature updates?

Do you spend loads of your time carrying out email signature updates? Not very interesting are they? Don’t let signature updates get you down. Let Exclaimer Cloud - Signatures for Office 365 make managing email signatures a breeze.

Join & Write a Comment

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
In this video we show how to create a User Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Mailb…
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…

743 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

12 Experts available now in Live!

Get 1:1 Help Now