In an article titled Active Directory Database Maintenance I wrote on how you could use Ntdsutil to defrag your AD database. Well Ntdsutil doesn’t always do the trick.
You may receive one of a number of errors including
Operation failed because the database was inconsistent,
Initialize jet database failed; cannot access file, or
Error while performing soft recovery.
In situations like this we can use another utility, Esentutl, to repair the database. Esentutl is an Exchange tool but is also installed with the support tools. You must be in Directory Services Restore mode to perform any of these operations. From a command prompt run:
esentutl /g “C:WindowsNTDSntds.dit”
After pressing enter, Esentutl will run an integrity check on the database. Once complete run this command to repair the database:
esentutl /p “C:WindowsNTDSntds.dit”
After you have repaired the database delete all the database log files (*.log) and restart the DC.
For more information see:
Article ID: 816120