When the offline defragmentation does not finish the copy, the temporary database is not deleted. If the temporary database is the intact, successfully defragmented database, you can manually copy it back to the correct location.
If you only defragmented one database and already know which database is damaged, proceed to the "Copying the Temporary Database" section of this article. If you defragmented both the Priv.edb and Pub.edb databases and you are not sure which database has caused the problem, perform the following steps to determine which database is causing the problem:
- Check the integrity of both the Priv.edb and Pub.edb databases:
- To check the Priv.edb database, at a command prompt, run the following:
eseutil /g /ispriv
- To check the Pub.edb database, at a command prompt, run the following:
eseutil /g /ispub
- Note which database does not pass the integrity check and returns a -1019 error message.
- Note the size of the database file that did not pass the integrity check.
- Compare this size to the size of the temporary file.
By comparing the sizes of the two files, you can determine if the Tempdfrg.edb file is the defragmented version of the damaged database file. In most cases, the files are exactly the same size. The copy process sets aside the space at the beginning of the process, and although the process does not finish, the size of the database file still matches the source file.
Copying the Temporary Database
To ensure that the database defragmentation finished successfully and to copy the defragmented file back to the correct location:
- NOTE: These steps assume that the information store databases are located on the server in the D:\Exchsrvr\Mdbdata folder and the temporary defragmentation file is located on drive D (D:\Tempdfrg.edb).
- Perform an integrity check against the temporary file. At a command prompt, run the following:
eseutil /g d:\tempdfrg.edb
If the integrity check finishes successfully, proceed to the next step. If the integrity check does not finish successfully, both copies of the database are damaged and you must restore the database from a backup. - Rename the damaged database (either the Priv.edb or Pub.edb database).
- Copy the temporary defragmentation file from drive D (D:\Tempdfrg.edb) to the D:\Exchsrvr\Mdbdata folder.
- In the D:\Exchsrvr\Mdbdata folder, rename the Tempdfrg.edb file to the correct database file name (either Priv.edb or Pub.edb).
- Start the information store.
NOTE: If a -1011 error message is displayed when you start the information store, it does not indicate a problem. The information store and the directory need to be resynchronized. To synchronize the information store and the directory, at a command prompt, run the following:
\exchsrvr\bin\isinteg -patch