Backing Up and Restoring the DHCP Database


DHCP servers store DHCP lease and reservation information in database files. By default, these files are stored in the %SystemRoot%\System32\dhcp directory. The key files in this directory are used as follows :

  • Dhcp.mdb

    The primary database file for the DHCP server

  • J50.log

    A transaction log file used to recover incomplete transactions in case of a server malfunction

  • J50.chk

    A checkpoint file used in truncating the transaction log for the DHCP server

  • Res1.log

    A reserved log file for the DHCP server

  • Res2.log

    A reserved log file for the DHCP server

  • Tmp.edb

    A temporary working file for the DHCP server

Backing Up the DHCP Database

The backup directory in the %SystemRoot%\System32\dhcp folder contains back up information for the DHCP configuration and the DHCP database. By default, the DHCP database is backed up every 60 minutes automatically. To manually back up the DHCP database at any time, follow these steps:

  1. In the DHCP console, right-click the server you want to back up and then choose Backup.

  2. In the Browse For Folder dialog box, select the folder that will contain the backup DHCP database and then click OK.

Registry keys that control the location and timing of DHCP back ups, as well as other DHCP settings, are located in the folder

 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCPServer\Parameters 

The following keys control the DHCP database and backup configuration:

  • BackupDatabasePath

    Sets the location of the DHCP database. You should set this option through the DHCP Properties dialog box. Select the Advanced tab and then set the Database Path field as appropriate.

  • DatabaseName

    Sets the name of the primary DHCP database file. The default value is DHCP.mdb.

  • BackupInterval

    Sets the backup interval in minutes. The default value is 60 minutes.

  • DatabaseCleanupInterval

    Sets the interval for cleaning entries in the database. The default value is 60 minutes.

Restoring the DHCP Database from Backup

In the case of a server crash and recovery, you might need to restore and then reconcile the DHCP database. To force DHCP to restore the database from backup, follow these steps:

  1. If necessary, restore a good copy of the %SystemRoot%\System32\ dhcp\backup directory from a tape or other archive source. Afterward, start the DHCP console, right-click the server you want to restore, and then choose Restore.

  2. In the Browse For Folder dialog box, select the folder that contains the backup you want to restore and then click OK.

  3. During restoration of the database, the DHCP Server service is stopped . As a result, DHCP clients will temporarily be unable to contact the DHCP server to obtain IP addresses.

Using Backup and Restore to Move the DHCP Database to a New Server

If you need to rebuild a server providing DHCP services, you might want to move the DHCP services to another server prior to rebuilding the server. To do this, you need to perform several tasks on the source and destination servers. On the destination server do the following:

  1. Install the DHCP Server service on the destination server and then restart the server.

  2. Stop the DHCP service in the Services utility.

  3. Delete the contents of the %SystemRoot%\System32\dhcp folder.

On the source server do the following:

  1. Stop the DHCP service in the Services utility.

  2. Once the DHCP service is stopped, disable the service so that it can no longer be started.

  3. Copy the entire contents of the %SystemRoot%\System32\dhcp folder to the %SystemRoot%\System32\dhcp folder on the destination server.

Now all the necessary files are on the destination server. Start the DHCP Server service on the destination server to complete the migration.

Repairing the DHCP Database

Sometimes DHCP databases can become corrupt. When this happens, you'll see error messages in the System event log. These error messages have DHCPServer as the source and reference JET database errors, such as:

 The JET database returned the following Error: -510. 

To use the Jetpack.exe utility to detect and repair the database consistency problems, complete the following steps:

  1. Stop the DHCP service in the Services utility.

  2. Start a command prompt by clicking Start, choosing Programs or All Programs as appropriate, choosing Accessories, and then selecting Command Prompt.

  3. Afterward, change to the DHCP database directory. By default this is %SystemRoot%\System32\dhcp.

  4. Type the following command:

     jetpack dhcp.mdb dhcptemp.mdb 

    where dhcp.mdb is the name of the DHCP database and dhcptemp.mdb is the name of a temporary file that can be used by the Jetpack utility.

  5. The Jetpack utility will do the following:

    • Examine the database for inconsistencies and other problems

    • Fix any consistency errors, writing all changes to the temporary database file

    • Compact the database, writing all changes to the temporary database file

    • Overwrite the original database file with the temporary file, completing the operation

  6. If the Jetpack utility fails to repair the database, you'll need to restore the database from backup or force the DHCP Server service to recreate the database.

Forcing the DHCP Server Service to Regenerate the DHCP Database

Sometimes DHCP databases can become corrupt. In rare cases you might be unable to repair the database using the Jetpack.exe program. If this happens, you should attempt to restore the database as described in the section of this chapter entitled "Restoring the DHCP Database from Backup." If this fails or you'd rather start with a fresh copy of the DHCP database, complete these steps:

  1. Stop the DHCP service in the Services utility.

  2. Delete the contents of the %SystemRoot%\System32\dhcp folder. If you want to force a complete regeneration of the database and not allow the server to restore from a previous backup, you should also delete the contents of the backup folder.

    Caution

    Don't delete DHCP files if the DHCPServer registry keys aren't intact. These keys must be available to restore the DHCP database.


  3. Restart the DHCP Server service.

  4. No active leases or other information for scopes are displayed in the DHCP console. To regain the active leases for each scope, you must reconcile the server scopes as discussed in the following section of this chapter, "Reconciling Leases and Reservations ."

  5. To prevent conflicts with previously assigned leases, you should enable address conflict detection for the next few days as discussed in the section of this chapter entitled "Avoiding IP Address Conflicts."

Reconciling Leases and Reservations

Reconciling checks the client leases and reservations against the DHCP database on the server. If inconsistencies are found between what is registered in the Windows registry and what is recorded in the DHCP server database, you can select and reconcile any inconsistent entries. Once reconciled, DHCP either restores the IP address to the original owner or creates a temporary reservation for the IP address. When the lease time expires , the address is recovered for future use.

You can reconcile scopes individually or you can reconcile all scopes on a server. To reconcile a scope individually, follow these steps:

  1. In the DHCP console, right-click the scope you want to work with and then choose Reconcile All Scopes.

  2. In the Reconcile All Scopes dialog box, click Verify.

  3. Inconsistencies found are reported in the status window. Select the displayed addresses and then click Reconcile to repair inconsistencies.

  4. If no inconsistencies are found, click OK.

To reconcile all scopes on a server, follow these steps:

  1. In the DHCP console, right-click the server entry and then choose Reconcile All Scopes.

  2. In the Reconcile All Scopes dialog box, click Verify.

  3. Inconsistencies found are reported in the status window. Select the displayed addresses and then click Reconcile to repair inconsistencies.

  4. If no inconsistencies are found, click OK.



Microsoft Windows Server 2003 Administrator[ap]s Pocket Consultant
Microsoft Windows Server 2003 Administrator[ap]s Pocket Consultant
ISBN: 735622450
EAN: N/A
Year: 2003
Pages: 141

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net