Sun Directory Services 3.1 Administration Guide

Regenerating the Database

When changes have been made to the directory database, the use of disk space is not optimal. To improve the use of disk space, you can regenerate the database by performing a backup followed by a restore.

You can back up the directory database in text format using the ldbmcat command. This command converts an LDBM database to the LDIF described in the ldif(1m) man page. For details, see the ldbmcat(1m) man page.

You can restore the directory database from the LDIF file created during a previous backup using the ldif2ldbm command. For details, see the ldif2ldbm(1m) man page.

For example, stop the directory server, then use the following sequence of commands to regenerate the directory database:

# ldbmcat id2entry.dbb > /usr/tmp/filename
# rm /var/SUNWconn/ldap/dbm/*
# ldif2ldbm -j 10 -i /usr/tmp/filename

Note -

You must stop the directory server before you regenerate the directory database.


If your directory server is also an NIS server, you must rebuild the NIS maps using the dsypinstall(1m) script. You can then restart the directory server.