A. Windows 2000 servers running Directory Services (DSs) perform a directory online defragmentation every 12 hours by default as part of the garbage-collection process. This defragmentation only moves data around the database file (ntds.dit) and doesn’t reduce the file’s size.
To create a new, smaller ntds.dit file and to enable offline defragmentation, perform the following steps.
- Back up Active Directory (AD) (see the FAQ How do I back up Active Directory and the System State?).
- Reboot the server, select the OS option, and press F8 for advanced options.
- Select the Directory Services Restore Mode option, and press Enter. Press Enter again to start the OS.
- Win2K will start in safe mode, with no DS running.
- Use the local SAM’s administrator account and password to log on.
- You’ll see a dialog box that says you’re in safe mode. Click OK.
- From the Start menu, select Run and type
- In the command window, you’ll see the following text. (Enter the commands in bold.)
C:\> <b>ntdsutil</b><br> ntdsutil: <b>files</b><br> file maintenance:<b>info</b><br> ....<br> file maintenance:<b>compact to c:\temp</b>
- You’ll see the defragmentation process. If the process was successful, enter
- to return to the command prompt.
- Then, replace the old ntds.dit file with the new, compressed version. (Enter the commands in bold.)
C:\> <b>copy c:\temp\ntds.dit %systemroot%\ntds\ntds.dit</b>
- Restart the computer, and boot as normal.
cmd.exe
quit<br> quit
Below is an example of the entire procedure.
D:\> <b>ntdsutil</b><br> ntdsutil: <b>files</b><br> file maintenance: <b>info</b><br><br> Drive Information:<br><br> C:\ FAT (Fixed Drive) free(1.2 Gb) total(1.9 Gb)<br> D:\ NTFS (Fixed Drive) free(152.4 Mb) total(1.9 Gb)<br><br> DS Path Information:<br><br> Database : D:\WINNT\NTDS\ntds.dit - 8.1 Mb<br> Backup dir : D:\WINNT\NTDS\dsadata.bak<br> Working dir: D:\WINNT\NTDS<br> Log dir : D:\WINNT\NTDS - 30.0 Mb total<br> res2.log - 10.0 Mb<br> res1.log - 10.0 Mb<br> edb.log - 10.0 Mb<br> file maintenance: <b>compact to c:\temp</b><br> Opening database \[Current\].<br> Using Temporary Path: C:\<br> Executing Command: D:\WINNT\system32\esentutl.exe /d "D:\WINNT\NTDS\ntds.dit" /<br> /o /l"D:\WINNT\NTDS" /s"D:\WINNT\NTDS" /t"c:\temp\ntds.dit" /!10240 /p<br><br><br> Initiating DEFRAGMENTATION mode...<br> Database: D:\WINNT\NTDS\ntds.dit<br> Log files: D:\WINNT\NTDS<br> System files: D:\WINNT\NTDS<br> Temp. Database: c:\temp\ntds.dit<br><br> Defragmentation Status (% complete )<br><br> 0 10 20 30 40 50 60 70 80 90 100<br> |----|----|----|----|----|----|----|----|----|----|<br> ...................................................<br><br> Note:<br> It is recommended that you immediately perform a full backup<br> of this database. If you restore a backup made before the<br> defragmentation, the database will be rolled back to the state<br> it was in at the time of that backup.<br><br> Operation completed successfully in 17.896 seconds.<br><br><br> Spawned Process Exit code 0x0(0)<br><br> If compaction was successful you either need to<br> copy "c:\temp\ntds.dit" to "D:\WINNT\NTDS\ntds.dit"<br> or run:<br> D:\WINNT\system32\ntdsutil.exe files "set path DB \"c:\temp\"" quit quit<br> file maintenance: quit<br> ntdsutil: quit<br><br> D:\> <b>copy c:\temp\ntds.dit %systemroot%\ntds\ntds.dit</b><br> Overwrite D:\WINNT\ntds\ntds.dit? (Yes/No/All):<b> y</b><br> 1 file(s) copied.
0 comments
Hide comments