Windows

Take defragmentation of the Windows 2000 Server Active Directory database offline

Online defragmentation does a good job of defragmenting the object inside the Windows 2000 Server Active Directory database file (Ntds.dit). In most cases, you won't need anything else, but in certain scenarios you might want to do an offline defragmentation. Here's how to initiate offline defragmentation.

Online defragmentation does a good job of defragmenting the object inside the Windows 2000 Server Active Directory database file (Ntds.dit). In most cases, you won't need anything else, but in certain scenarios you might want to do an offline defragmentation.

There are two important differences between online and offline defragmentation: You have to stop the Active Directory to perform offline defragmentation, and offline defragmentation lets you reclaim free space, something online defragging won't do.

The work is done by the Ntdsutil.exe utility, located in the Support.cab file in the \support\tools folder on your Windows 2000 Server CD. To initiate offline defragmentation, follow these steps:

  1. Reboot the domain controller.
  2. On the Boot menu, press [F8] and select Directory Services Restore Mode.
  3. Run Ntdsutil.
  4. Type files.
  5. Type compact to directory (where directory is the directory where you want to place the defragmented database). Ntdsutil will then create the defragmented database in the directory you specified.
  6. Copy this defragmented database to the \WINNT\NTDS directory. This replaces the previous Ntds.dit file and deletes all log files.

The Ntdsutil utility doesn't just overwrite the old (fragmented) database file; rather, it creates a separate (defragmented) copy of the database. The idea behind this is that your original database stays intact in case something happens during the defragmentation process.

Miss a Windows 2000 Server tip?

Check out the Windows 2000 Server archive, and catch up on previous Windows 2000 Server columns.

Want more Windows 2000 Server tips and tricks? Automatically sign up for our free Windows 2000 Server newsletter, delivered each Tuesday!

1 comments
Nathan Wendell
Nathan Wendell

Thanks for the guide on the most effective approach to speed up active directory performance! This is very effective at least until we have Server 2008 which allows defragmenting online. I however would strongly advocate that you perform backup before doing that even if you think nothing will happen to your Active Directory after defragmentation. Ntdsutil is effective tool but it falls into that range of tools that require an exceptional degree of accuracy and attention. So if you ask me what I do when I perform compacting on my *.dits I first to a quick backup to be on the safe side. The most convenient method I've found is using Scriptlogic's Active Administrator http://www.scriptlogic.com/active-directory-backup-restore.asp . This tool allows me to do backups very rapidly and easily and what's more it can also do a good range of reporting . That's especially effective with auditing and allows us to reveal security breaches within active directory at a very early stage, before they become an issue.

Editor's Picks