Detecting DHCP Jet Data Corruption

Table 4.14 lists the possible DHCP service messages that might appear in the System event log when the DHCP server database becomes corrupted:

Table 4.14 Corrupt Jet Database Messages

Event ID

Source

Description

1014

DhcpServer

The Jet database returned the following Error: –510.

1014

DhcpServer

The Jet database returned the following Error: –1022.

1014

DhcpServer

The Jet database returned the following Error: –1850.

Typically, Jet errors can be resolved by manual offline compaction of the database using the Jetpack utility. In cases where Jetpack.exe fails to repair the database, restoration of the DHCP server database as described in the following sections can be used to recover the server database and restore DHCP service at the server computer.

To recover a corrupted DHCP database, you can use the following options for restoring the database:

  • Simple recovery. Restore the database from a backup copy of the database file, Dhcp.mdb. This method is recommended as the preferred method of recovery because it involves less risk of losing information previously configured and stored by the DHCP server and is much simpler to perform.

  • Advanced recovery. The registry can be modified to force creation of a new database file. This method can be useful as an additional method for data recovery when simple restoration of the database is not possible. However, this should be done with extreme caution. For more information about restoring a corrupted DHCP database, see the Microsoft Knowledge Base link on the Web Resources page at https://windows.microsoft.com/windows2000/reskit/webresources . Search the Knowledge Base using the keywords DHCP , database, and recovery.

Simple Recovery: Restoring from Backup

If the DHCP server database becomes corrupted or is lost, simple recovery is possible by replacing the server database file (Dhcp.mdb), located in the % SystemRoot %\System32\Dhcp folder, with a backup copy of the same file. You can then perform a simple file copy to overwrite the current corrupted database with a backup copy of the same file.

If DHCP Manager has been used previously to enable backup, you can obtain the backup copy of the server database file located in the % SystemRoot %\System32\Dhcp\Backup folder. As an option, you can also choose to restore the Dhcp.mdb file from a tape backup or other backup media.

Before restoring the database file from backup, the DHCP service must first be stopped. Once you have copied the backup file to the % SystemRoot %\System32\Dhcp folder from your preferred backup source, you can restart the DHCP service.

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

net stop dhcpserver

Once the DHCP service has been stopped, the following procedure can be used to safely restore a backup copy of the database from either backup media or the DHCP service backup folder.

First, move the files from your existing DHCP folder to a different folder location, such as \Olddhcp. Be careful to keep the DHCP folder structure intact. For example, type the following set of commands at a command prompt to perform this step:

md c:\Olddhcp

move % SystemRoot % \system32\DHCP\*.* C:\Olddhcp

Next, remove the corrupted server database file. This can also be done at the command prompt:

del % SystemRoot % \system32\DHCP\Dhcp.mdb

You can then copy the backup database file into the DHCP service folder. The path to be used when performing the actual copy operation varies (as shown in Table 4.15), depending on the specific server version of Windows running on the computer where the DHCP database file is being restored.

Table 4.15 Location of DHCP Database Files

Server version

Copy command usage

Windows NT Server 3.51

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

Windows NT Server 4.0

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

Windows 2000 Server

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

Once the backup database file has been copied to the correct DHCP folder location for your server computer, you can restart the DHCP service.

To restart the service, type the following at the command prompt:

net start dhcpserver

The previous procedure should allow the DHCP service to start, but if scope information is missing, it might be necessary to use a backup copy of your registry to reconfigure the values necessary for restoring your scope and client reservation information.

Rebuilding a Stopped DHCP Server

If the hardware for the DHCP server is malfunctioning or other problems prevent you from running Windows 2000, you must rebuild the DHCP database on another computer.

To rebuild a DHCP server

  1. If you can start the original DHCP server by using the net start DHCP command, use the copy command to make backup copies of the files in the % SystemRoot %\System32\Dhcp directory. If you cannot start the computer at all, you must use the last backup version of the DHCP database files.

  2. Install Windows 2000 Server to create a new DHCP server using the same hard drive location and % SystemRoot % directory. That is, if the original server stored the DHCP files on % SystemRoot %\System32\Dhcp, then the new DHCP server must use this same path to the DHCP files.

  3. Make sure the Microsoft DHCP service on the new server is stopped, and then use a registry editor to restore the DHCP keys from backup files.

  4. Copy the DHCP backup files to the % SystemRoot %\System32\Dhcp directory.

  5. Restart the new, rebuilt DHCP server.