|Brien M. Posey|
Just like any other type of database, the Active Directory database tends to become fragmented through normal use. The process of adding and removing objects naturally creates fragmentation. Windows 2000 uses the Garbage Collection Process and Online Defragmentation to get rid of most of the fragmentation that occurs. However, there are limits. Neither of these processes can reclaim lost space within the database. Fortunately, there is a way to reclaim this lost space, while helping your Active Directory database to run more efficiently. The process is called Offline Defragmentation.
Offline Defragmentation can't run while a domain controller is running. Instead, you must take the domain controller offline and boot it into Directory Services Repair Mode. You can do this by pressing F8 and selecting the corresponding command from the boot menu. When the computer finally boots, make a backup copy of the NTDS.DIT file. This
The next step in the process is to open a Command Prompt window and issue a series of commands that will show you the location of the Active Directory database. The command sequence is:
NTDSUTIL FILES INFO
Once you know the location of the Active Directory database, make a backup of it. You may now begin the Defragmentation process. The process involves creating a brand new, compacted version of the database and then using this copy to replace your previous copy. The commands for doing this are (assuming that the last command you entered was INFO):
COMAPCT TO F: (where F: is the location where you want to temporarily store the new copy) QUIT QUIT ERASE C:WINNTNTDSNTDS.DIT (this command erases your original database and assumes that the original database was located in C:WINNTNTDS ERASE C:WINNTNTDS*.LOG COPY F:NTDS.DIT C:WINNTNTDS
About the author:
Brien Posey, CEO of Posey Enterprises, is a freelance technical writer who has been working with computers for about 15 years. Before going freelance, Brien served as director of information systems at a large, nationwide healthcare company. He has also served as a network engineer/security consultant for the Department of Defense. You can access Brien's Web site, which contains hundreds of his articles and white papers, at http://www.brienposey.com.
This was first published in August 2002