Microsoft KB Archive/173396

= How to Restore a Corrupted DHCP Database File =

Article ID: 173396

Article Last Modified on 2/27/2007

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows NT Server 3.51
 * Microsoft Windows NT Server 4.0 Standard Edition

-



This article was previously published under Q173396



IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry



SUMMARY
This article discusses methods that may be used to recover a corrupted Dynamic Host Configuration Protocol (DHCP) database.



MORE INFORMATION
WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

The following event log messages appear on a computer running Windows NT Server versions 3.51 and 4.0 when the DHCP database has been corrupted:

Event ID: 1014

Source: DhcpServer

Description: The Jet database returned the following Error: -510.

-or-

Event ID: 1014

Source: DhcpServer

Description: The Jet database returned the following Error: -1022.

-or-

Event ID: 1014

Source: DhcpServer

Description: The Jet database returned the following Error: -1850.

If you use Jet.exe to compact the DHCP database, you will not resolve the issue.

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

153476 Windows NT 3.51 DHCP Server Stops Assigning IP Addresses to Clients

The DHCP database is contained in the Dhcp.mdb file located in the %SystemRoot%\System32\Dhcp folder. The DHCP server uses this file to record and store information concerning active leases and reservations. Most of this information is also contained in the following registry key:

Windows NT 4.0:

Windows 2000:

Whenever the DHCP service shuts down correctly, it makes a backup copy of both the database file (Dhcp.mdb) and the registry key. The backup information from the registry is contained in the file Dhcpcfg. For Windows NT 3.51, the file Dhcp.mdb is located in the %SystemRoot%\System32\Dhcp\Backup\Jet folder. In Windows NT 4.0, the file Dhcp.mdb is located in the %SystemRoot%\System32\Dhcp\Backup\Jet\New folder. Both versions of Windows NT store the Dhcpcfg file in the %SystemRoot%\System32\Dhcp\Backup folder.

To recover a corrupted DHCP database, use one of the following methods:
 * Restore a backup copy of the database file, Dhcp.mdb

- or-
 * Generate a new database file using the DHCP Configuration registry key.

Restoring a backup copy of the database file is the recommended method because you will not lose information when you use it.

After you recover your database file using one of the methods mentioned earlier, you must reconcile the information between the database file and the registry information.

NOTE: The following steps assume that your DHCP server will not start because of a corrupted DHCP database. If your DHCP server starts, but the database is corrupted, you have to start by stopping the service.

To stop the DHCP server service, type the following at a command prompt:

net stop dhcpserver

Restoring a Backup Copy of the Database
Warning If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.
 * 1) Move the files from your existing DHCP folder to a different location, being careful to keep the DHCP folder structure intact. For example, type the following at a command prompt and press ENTER after each line:

md c:\Olddhcp move %SystemRoot%\system32\DHCP\*.* C:\Olddhcp
 * 1) Remove the corrupted database file.
 * 2) Copy the backup database file into the DHCP folder by typing the following at a command prompt, and then pressing ENTER:
 * 3) * Windows NT 3.51

copy %SystemRoot%\system32\dhcp\backup\jet\dhcp.mdb %SystemRoot%\system32\dhcp\dhcp.mdb
 * 1) * Windows NT 4.0

copy %SystemRoot%\system32\dhcp\backup\jet\new\dhcp.mdb %SystemRoot%\system32\dhcp\dhcp.mdb

If your computer is running Microsoft Windows 2000, modify the following registry key to restore the DHCP server:

Change the RestoreFlag REG_DWORD value in this registry key to 1.

You may also choose to restore the Dhcp.mdb file to the %SystemRoot%\System32\Dhcp folder from a tape backup or other backup media.

Because you are using an existing database file, whether you restore it from backup media or the backup folder, you must use the Jetpack utility to compress it.

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

145881 How to Use Jetpack.exe to Compact a WINS or DHCP Database

The above procedure should allow the service to start, but if your scope information is missing, you must use a backup copy of the Dhcpcfg registry file to restore your scope and reservation information. See steps 5 through 11 in the "From the New DHCP Server" section of the following article:

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

130642 How to Move a DHCP Database to Another Windows Server

Generating a New Database File

 * 1) Move the files in your existing DHCP folder to a different location, being careful to keep the DHCP folder structure intact. For example, type the following at a command prompt, pressing ENTER after each line:

md c:\olddhcp move %SystemRoot%\system32\dhcp\*.* c:\olddhcp
 * 1) Select the next step from the following list, depending on which version of Windows NT Server you are using:

Windows NT Server 3.51:

Expand a new copy of System.mdb from the original Windows NT Server source media by inserting your original Windows NT Server 3.51 CD into your CD-ROM drive. To do so, type the following at a command prompt, and then press ENTER:

expand D:\I386\System.md_ %SystemRoot%\System32\Dhcp\System.mdb

where D: is your CD-ROM drive and i386 is your platform.

Windows NT Server 4.0:

Restart the DHCP server with an empty DHCP folder. Windows NT 4.0 and Windows 2000 do not use a System.mdb file.

The above procedure should allow the service to start, but if your scope information is missing, you must use a backup copy of the Dhcpcfg registry file to restore your scope and reservation information. See steps 5 through 11 in the "From the New DHCP Server" section of the following article:

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

130642 How to Move a DHCP Database to Another Windows Server

Reconciling DHCP Information
After you generate a new database file, you may notice that the scope information is present, but no active leases are displayed. To regain the active leases, you must reconcile the database with the information in the registry using the following steps:
 * 1) From DHCP Manager, click your scope, and then click Active Leases on the Scope menu.
 * 2) In the Active Leases dialog box, click Reconcile.
 * 3) Click OK. Your active leases will appear in the Active Leases dialog box.

NOTE: When you view the properties for a client lease, the computer name will be listed as the IP address of the lease and an arbitrary hexadecimal value will be listed as the client identifier. These will be replaced with the appropriate information as the clients renew their leases.

Repeat the above procedure for each scope for which you must reconcile leases.

If your DHCP server is Windows NT Server 4.0 SP2 or later, you must turn on IP Conflict Detection as described in the following article:

161430 Detecting and Flagging Duplicate IP Addresses

Keywords: kbhowto kbnetwork KB173396

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.