Using ESEUTIL To Copy Large Files

Many Exchange admins are familiar with the venerable Exchange database utility ESEUTIL. I’ve used it many times when working with Exchange databases, and it still exists in Exchange 2010. Recently a DBA coworker and I had a scenario where log shipping for a customer’s site was taking way to long to complete due to a slow network. The DR site is in California on the other side of the country and this was affecting our ability to keep things updated.

We experimented with different file transfer tools like Robocopy, etc. and others with little success until we discovered you can use ESEUTIL to move large files with a respectable performance gain. This is because the utility is designed to move and work with large Exchange databases, and typically does not have a lot of I\O buffer during copy operations. This MSDN blog post outlines the details.

I whipped up a nifty Powershell script that actually gathers the SQL transaction logs (in our case generated by RedGate SQL Backup) that have the archive bit set, calls ESEUTIL to copy them to the DR site, then unsets the bit. All you need is eseutil.exe and ese.DLL from an Exchange server placed somewhere on the SQL server so the script can call it. We saw about a 20% increase in copy speeds when using this method.

# Get all the files in the directory.
$file = get-childitem "Y:\PS_FOLDER"

# For each SQB file in files..
foreach ($sqb in $file) {

# If the archive bit is set...
if ($sqb.attributes -eq "Archive") {

# Call ESEUTIL and copy to DR.
c:\eseutil\eseutil.exe /y "y:\PS_FOLDER\$sqb" /d "\\Destination\PS_TEST\$sqb"

# Set bit to normal.
$sqb.attributes = $sqb.attributes -bxor ([System.IO.FileAttributes]::Archive)
}
}

 

Leave a Reply

Leave a Reply

Your email address will not be published. Required fields are marked *