I like to keep Exchange databases in their own volume, so one of the first things I do is move them.
Warning: Moving a mail database will make it unavailable while it is being moved, warn your users, or plan in some down time.
Solution
1. First see where the database is now. From within the Exchange admin center (https://localhost/ecp) > Servers > Databases > Select the database to be moved.
Note: Take a note of the database path, and the database filename (filename.edb). Copy the complete path to Notepad.
2. Create a folder on your ‘target’ volume, for the database to live in.
I don’t have many clients left that still have Exchange 2003, so this will probably be the last time I have to do this (famous last words).
Exchange databases NEVER get smaller, if you delete information out of them, it simply creates white space, that Exchange will reuse, (so they will steadily grow in size). Before you carry out this procedure, get your users to clear down their mailbox’s. Also delete/purge any unused mailboxes, this will make your defrag more efficient.
Solution
In my case the server the database was on was short on drive space. Remember you need 110% of the size of the database free space to carry out this procedure (so a 50GB database needs 110GB of free space to defragment). I did this with an external USB Drive.
Note: Moving large databases to USB media can take a while, at USB 2 Speed (48MBps (480Mbps)) took about 45 minutes to copy the database files to it.
1. You don’t need to to do this but, locate where the log files for this database are being stored, because in a minute we are going to take a copy (just in case). Right click the storage group the database is in > Properties > General > Transaction log location.
2. Now for the database itself, right click the Mailbox Store (or public folder database if that’s the one you are going to defrag) > Properties > Database > Exchange databases.
3. On my external drive I’ve created two folders, one holds the original untouched database files and the logs, the other (EDB_Files) holds a copy of the priv1.edb and priv1.stm files for the mailbox database that I’m going to defragment.
4. Eseutil.exe lives in the Exchange program folder in the bin directory, change to that directory;
[box]
cd “c:Program FilesExchsrvrbin”
[/box]
Now if we simply run eseutil on the database, it will create a temporary database on the C: drive, which I don’t want (remember we are tight for drive space). So I will specify where the temp database will be, and start the defragmentation.
[box]
eseutil /d {Path to the Database} /t {Path to the temp Database}
e.g.
eseutil /d H:EDB_Filespriv1.edb /t H:EDB_FilesTempDB.edb
[/box]
How long will eseutil take? That’s a horrible question to answer, it depends on the CPU/memory of the server, and the size of the database itself. in this case it was a 70GB Database, on an HP G4 Series server, it took 11 hours and 6 minutes (approx).
5. When done it should say it has completed successfully.
6. You can now delete the original EDB and STM files from the Exchange Server.
7. Then copy and paste your defragmented versions back into the original folder.
8. You can now mount the mail store(s).
9. Finally make sure you get a full backup of the Exchange database, (with some Exchange aware backup software).
Related Articles, References, Credits, or External Links