You are currently offline, waiting for your internet to reconnect

How to Restore a Corrupted DHCP Database File

This article was previously published under Q173396
Notice
This article applies to Windows 2000. Support for Windows 2000 ends on July 13, 2010. The Windows 2000 End-of-Support Solution Center is a starting point for planning your migration strategy from Windows 2000. For more information see the Microsoft Support Lifecycle Policy.
SUMMARY
This article discusses methods that may be used to recover a corruptedDynamic Host Configuration Protocol (DHCP) database.
MORE INFORMATION
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 How to back up and restore the registry in Windows

The following event log messages appear on a computer running Windows NTServer 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 torecord and store information concerning active leases and reservations.Most of this information is also contained in the following registry key:
Windows NT 4.0:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\DHCPServer\Configuration


Windows 2000:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DhcpServer\Configuration
Whenever the DHCP service shuts down correctly, it makes a backup copy ofboth the database file (Dhcp.mdb) and the registry key. The backupinformation from the registry is contained in the file Dhcpcfg. ForWindows NT 3.51, the file Dhcp.mdb is located in the%SystemRoot%\System32\Dhcp\Backup\Jet folder. In Windows NT 4.0, thefile Dhcp.mdb is located in the %SystemRoot%\System32\Dhcp\Backup\Jet\Newfolder. 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 registrykey.
Restoring a backup copy of the database file is the recommended methodbecause 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 theservice.

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

Restoring a Backup Copy of the Database

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 How to back up and restore the registry in Windows
  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
  2. Remove the corrupted database file.
  3. Copy the backup database file into the DHCP folder by typing the following at a command prompt, and then pressing ENTER:
    • Windows NT 3.51

      copy %SystemRoot%\system32\dhcp\backup\jet\dhcp.mdb %SystemRoot%\system32\dhcp\dhcp.mdb
    • 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:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCPServer\Parameters
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 backupmedia.

Because you are using an existing database file, whether you restore itfrom 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 scopeinformation is missing, you must use a backup copy ofthe Dhcpcfg registry file to restore your scope and reservationinformation. 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
  2. Select the next step from the following list, depending on whichversion 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 scopeinformation is missing, you must use a backup copy of theDhcpcfg registry file to restore your scope and reservation information.See steps 5 through 11 in the "From the New DHCP Server" section ofthe 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 scopeinformation is present, but no active leases are displayed. To regain theactive leases, you must reconcile the database with the information inthe 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 reconcileleases.

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

161430 Detecting and Flagging Duplicate IP Addresses
Properties

Article ID: 173396 - Last Review: 02/27/2007 22:55:40 - Revision: 3.5

  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows NT Server 3.51
  • Microsoft Windows NT Server 4.0 Standard Edition
  • kbhowto kbnetwork KB173396
Feedback