Home > Windows Server Tips > Active Directory Administration > Defragmenting the Active Directory object database
Windows Server Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ACTIVE DIRECTORY ADMINISTRATION

Defragmenting the Active Directory object database


Kevin R. Sharp
08.21.2001
Rating: -4.20- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


When you defrag, you can save disk space and improve performance. This tip suggests two ways to defrag the Active Directory object database.

All objects in an Active Directory hosted on a Win 2000 Server are stored in a database named NTDIS.DIT and managed by an underlying Extensible Storage Engine (ESE). When filling pages, the ESE sacrifices memory efficiency for speed. Two defragmentation techniques recover the sacrificed memory.

Online Defragmentation:

The ESE performs online defragmentation periodically as part of the garbage-collection process. The process rearranges database pages and makes space available for new Active Directory objects. To change the online defragmentation period you need to change the garbage-collection period by modifying the garbageCollPeriod attribute in the enterprise-wide DS configuration object. Do this using any Active Directory editing tool, including Adsiedit.msc, Ldp.exe, or ADSI scripts. The path for the garbageCollPeriod of Server1 in the Company.com domain would be:

CN=Directory Service,CN=Windows 
NT,CN=Services,CN=Configuration,DC=SERVER1,DC=COMPANY,DC=COM

For details on other activities involved in the garbage collection process, check out http://support.microsoft.com/support/kb/articles/Q198/7/93.ASP

Online defragmentation frees up space within the Active Directory object database (NTDS.DIT) to make room for new objects. However, it does not reduce the size of NTDS.DIT, and therefore cannot return unused memory to the file system. To do that you need to take the database offline.

Offline Defragmentation:

  1. Begin by backing up Active Directory, which can be done before taking the controller offline. (Use the backup wizard and either select the option to back up everything on the computer or select the option to back up the System State.)
  2. Reboot the domain controller and press F8 to display advanced options. Choose Directory Services Restore Mode and press Enter twice.
  3. Log on using the Administrator account. You'll need administrator permission to perform the defragmentation, and the security context and protection is quite different offline. If you have trouble, check out the note on the offline Security Accounts Manager (SAM) http://support.microsoft.com/support/kb/articles/Q223/3/01.ASP
  4. Click Start, select Programs, then Accessories, click Command Prompt, then type ntdsutil and press Enter.
  5. Type files, press Enter, type info, press Enter.
  6. You will now see the path and size of the Active Directory database and log files. Write down the path and note the size.
  7. Type compact to drive:directory where drive:directory is where you want to compacted file and has enough space to accept it.
  8. Type quit then Enter, then quit again to return to the command prompt.
  9. Copy the NTDS.DIT file from drive:directory to the path you wrote down in step 6.
  10. Reboot normally

For more background on defragmentation, check out these two articles:
http://support.microsoft.com/support/kb/articles/Q232/1/22.ASP
http://support.microsoft.com/support/kb/articles/Q229/6/02.ASP


Kevin Sharp is a registered professional engineer, writer, and yoga teacher living in Tucson, Arizona, and gains his expertise from a variety of professional activities. His engineering outlets include Web consulting for Supply Chain Systems Magazine, focusing on the fulfillment side of electronic commerce.

Did you like this tip? Let us know. You can drop a line to sound off.

Related Book

Windows 2000 Active Directory
Author : Joe Casad
Publisher : Osborne
Published : May 2000
Summary :
Explores what you can do in the new world of Active Directory, rather than just showing how to make a Windows 2000 network look and act like an NT 4.0 network. The Windows 2000 general reference books will not be able to approach this topic with this depth. Tech reviewed by the pros--Systems administrators, analysts, and MCSEs who are on the beta program testing Windows 2000 and Active Directory for their companies in the Microsoft Partnership Program have checked the book for accuracy and excellence. Expert author--Joe Casad is the best-selling author of SAMS Teach Yourself TCP/IP in 24 Hours, and two MCSE study guides from New Riders. In the industry, he is considered a networking expert and engineer. Full section on Total Cost of Ownership--Provides specific tips and examples that administrators can immediately use to reduce their networking costs. Topics include service publication, group policy integration, and Directory Object Extension. 16 pages of network blueprints--Illustrate the Active Directory Object naming system.


Rate this Tip
To rate tips, you must be a member of SearchWindowsServer.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Microsoft Active Directory Tools and Troubleshooting
How to find and remove lingering objects in Active Directory
DNS troubleshooting best practices
Generating a DNS health check in Windows
Debugging Windows client logon delays: Narrowing the scope
Troubleshooting poor Windows logon performance in Active Directory environments
New Operations Manager 2007 feature allows for automated agent deployments
Taming the LSASS.exe process for Active Directory performance and security
Active Directory FAQs
Troubleshooting Active Directory database errors
Troubleshooting a cross-forest trust in Active Directory

Microsoft Windows 2000 Server Administration
Microsoft to cut back support for Windows 200 Server, 2003
Best tools for probing LSA Secrets area of Windows Registry
Unable to view webpage inside LAN
Update the entire user property sheet in Active Directory
Optimize Windows virtual memory in Windows 2000 Server
Active Directory for Windows 2000 and 2003: What's the difference?
DNS on workgroup servers vs DNS on domain servers
Mocbot update targets MS06-040 flaw
Utility helps you view ActiveX component information
Unregistered Microsoft Search .DLLs can cause problems
Microsoft Windows 2000 Server Administration Research

Active Directory Administration
How to find and remove lingering objects in Active Directory
Utilizing Active Directory snapshots in Windows Server 2008
Creating Windows taskpad views for Active Directory management
When to add new domains to your Windows environment
Debugging Windows client logon delays: Narrowing the scope
Using Active Directory to manage Macs in a Windows environment
Troubleshooting poor Windows logon performance in Active Directory environments
Common Active Directory security oversights
Scripting domain controller installations: A must for Server Core
Taming the LSASS.exe process for Active Directory performance and security

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Server Room Design - Planning, Cooling, Maintenance
HomeTopicsBlogsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2004 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts