"Background clean-up skipped pages": NTDS ISAM event 602 in AD DS or LDS

Se aplica a: Windows Server 2012 DatacenterWindows Server 2012 DatacenterWindows Server 2012 Essentials


Consider the following scenario:
  • You are running Active Directory Domain Services (AD DS) or Lightweight Directory Service (LDS).
  • You have a sizable database on which there is significant query load.
  • You are seeing a large change rate against your database.

In this scenario, you receive warning events regularly that show that online defragmentation did not finish:

ID: 602
Level: Warning
Message: NTDS (<PID>) NTDSA: Database 'D:\windows\NTDS\ntds.dit': Background clean-up skipped pages. The database may benefit from widening the online maintenance window during off-peak hours. If this message persists, offline defragmentation may be run to remove all skipped pages from the database.


This event is logged when the version store database cleanup must skip some of its tasks in order to avoid running out of memory that is preassigned to the version store. The database pages can be recovered through either online or offline defragmentation runs. (Online runs are typical in default Active Directory configurations.) For online defragmentation, you should occasionally make sure that it is completing by searching for event ID 701 or 703. These events indicate that an online defragmentation pass is completed.

The event mentions that you can widen the window for the online defragmentation during off-peak hours. However, this is a generic event that is logged by the Active Directory Database Engine ESENT (Extensible Storage Engine). This engine is used by lots of Windows components and also server applications such as Microsoft Exchange Server. These applications may have different approaches to driving online defragmentation of the database.

For Active Directory, there are no settings to define the schedule to run online defragmentation.


Avoiding future events 602

You should increase the version store size to avoid shortages. The registry setting to do this is as follows: 
EDB max ver pages (increment over the minimum)

Note For more information, click the following article number to view the article in the Microsoft Knowledge Base:
232122 How to perform offline defragmentation of the Active Directory database 
To make sure of consistency in the environment, we recommended that you apply the same settings for EDB max ver pages on all domain controllers that are logging 602 errors. You may also want to consider rolling it out to all domain controllers in the environment, because load distribution could change in the environment, and this could cause domain controllers that were previously not logging the warning to start to log the warning.

Online defragmentation operational details

Online defragmentation runs as part of the garbage collection process. By default, it is triggered every twelve hours.

The job will run for one hour or half the garbage collection interval, whichever is the lower value. This means that you can shorten the online defragmentation interval only by using automated configuration.

However, Active Directory and LDS offer an operational attribute on the RootDSE object. You can use this attribute to start the online defragmentation. You can also specify a value in seconds of runtime. You set this value together with the command. You can use the repadmin tool to trigger the task. For example, you could run the following command: 
repadmin /setattr <servername> "" doOnlineDefrag add 1200
This example would run online defragmentation for two hours.

Cleaning up the database

Select this option if you want a clean database and if database downtime is not a big worry.

You can remove the database fragmentation completely by performing an offline defragmentation. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
232122 How to perform offline defragmentation of the Active Directory database

More Information

Calculating the version store size
974803 The domain controller runs slower or stops responding when the garbage collection process runs

Setting "doOnlineDefrag"
Directory Database File Management Tasks

Decoupling garbage collection and online defragmentation

871003 An online defragmentation is automatically run after you run the Active Directory garbage collection process in Windows 2000 Server

Managing garbage collection execution

Directory Service Configuration Management Tasks