Sun Directory Services 3.1 Administration Guide

Directory Maintenance

This section describes the tasks that you can perform on a regular basis to save space and to maintain Sun Directory Services performance.

Regenerating Indexes

You can regenerate the index database for a specific data store or for all data stores on the server using the dsidxgen command. Although the index files are automatically updated, regenerating the index database is a useful operation because it frees up disk space. Regenerating indexes helps improve performance on search operations.

For details, see the dsidxgen(1m) man page.

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.

Checking Log Files

The log directory, by default /var/opt/SUNWconn/ldap/logcontains eight log files, dsserv.log, dsradius.log, dsweb.log, dsnmpserv.log, dsnmprad.log, dsserv_admin.log, dspush.log, dspull.log. When a log file reaches its maximum size, by default 500Kbytes, another one is created, with a .1 suffix. When this one in turn reaches the maximum size, another one is created with a .2 suffix, and so on up to .9. This means that you can have up to 40 log files of 500 Kbytes each.

Because the log file mechanism can use a lot of disk space, it is good practice to delete log files that are no longer of any use to you.

Using dejasync

Whenever you modify the configuration of the NIS service or of the RADIUS service, or the mapping files for these services, respectively nis.mapping and radius.mapping under /etc/opt/SUNWconn/ldap/current, you must run the dejasync command so that these modifications are taken into account by the Deja tool. The dejasync command modifies the Deja.properties file.

You must also run dejasync when you initialize the NIS service so that you can use Deja to manage NIS entries.