|
INFO: The Directory Service Garbage Collection Process |
|
|
The Directory Services garbage collection process is a house keeping process that runs at regular intervals locally on each domain controller. By default, the garbage collection process runs every twelve hours. As with most things Active Directory, and Windows, this default can be changed if you so wish. The frequency is an attribute of the following object:
CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=ForestRootDomain,DC=com
The Garbage Collection process performs the following tasks:
- Tombstone deletion
- Database defragmentation
Tombstones and tombstone deletion
When an object is deleted, it isn't actually deleted per-se. Active Directory strips the object of most of its attributes and flags it as tombstoned, or being in the tombstoned state.
This is basically a mechanism of alerting replication partners to the deletion. When an object is flagged as being in the tombstoned state, the object is moved to the (hidden) Deleted Objects container. Garbage collection, removes objects from the deleted objects container after their tombstone lifetime period expires.
Again, the tombstone lifetime can be configured. It is also an attribute of the aforementioned ForestRootDomain.com/ Configuration/ Services/ Windows NT/ Directory Service object.
Note. For information on modifying the values of these attributes, please refer to the following msresource.net knowledgebase articles:
Tombstone lifetime
It is very important that the tombstone lifetime period be longer than the expected replication latency. Microsoft recommends that the interval between cycles of deleting tombstones must be at least as long as the maximum replication propagation delay across the forest. This is because the expiration of a tombstone lifetime is based on the time the object was logically deleted not when that tombstone was replicated.
The tombstone must be replicated to all domain controllers before the tombstones are removed. Otherwise, domain controllers may not realise that this item has actually been deleted. Also, you should not restore objects from a backup that's tombstone period has expired; otherwise you might experience database inconsistencies.
Database defragmentation
The other task performed by the garbage collection process in on-line database defragmentation.
The Active Directory updates the database file in the quickest possible way. This is very efficient for database updates, but not very efficient at utilising database space. The database defragmentation process is the rearranging of data into a more compressed state. There are two types of defragmentation of the directory database: on-line and off-line. On-line defragmentation happens during every garbage collection interval - twelve hours by default. Offline-database requires the Active Directory be booted in an offline state; that is, the domain controller is booted into the Directory Services Restore Mode. For more information on off-line defragmentation and a step-by-step guide, please refer to the following article:
- HOW-TO: Perform an off-line defragmentation of the Active Directory database
On-line defragmentation
On-line defragmentation is the process of regularly moving data into a more logical order and making space available. However, on-line defragmentation doesn't actually reduce the size of the database file. Only off-line defragmentation frees up disk space.
Document information
Author: Paul Williams
Written: 14-10-2004
Version: 2.0
Last updated: 25-07-2007
Last updated by: Paul Williams |