The rebuild-index command rebuilds a directory server index.
rebuild-index options
The rebuild-index utility is used to rebuild directory server indexes. Indexes are files that contain lists of values, where each value is associated with a list of entry identifiers to suffixes in the directory server database. When the directory server processes a search request, it searches the database using the list of entry identifiers in the indexes, thus speeding up the search. If indexes did not exist, the directory server would have to look up each entry in the database, which dramatically degrades performance.
The rebuild-index utility is useful in the following cases:
When the index-entry-limit property of an index changes
When a new index is created
The rebuild-index utility accepts an option in either its short form (for example, -b baseDN) or its long form equivalent (for example, --baseDN baseDN).
Specify the base DN of a back end that supports indexing. The rebuild operation is performed on indexes within the scope of the given base DN.
Specify the name of the indexes to rebuild. For an attribute index, this is simply an attribute name. At least one index must be specified for rebuild.
Display command-line usage information for the utility and exit without making any attempt to stop or restart the directory server.
Display the version information for the directory server and exit rather than attempting to run this command.
The following examples show how to use the directory server commands. You can use the commands on any UNIX, Linux, or Windows system that has at least the Java SE 5 (at least Sun version 1.5.0_08, preferably the latest version of Java SE 6) runtime environment installed on its target system. See Directory Server System Requirements in Sun OpenDS Standard Edition 2.0 Installation Guide for more information.
First, display a list of indexes by using the dsconfig utility. The command specifies the subcommand list-je-indexes, the port (-p), the back-end name userRoot (-n), the bind DN (-D), and the bind password (-w) and displays the indexes for the given back end:
$ dsconfig -h localhost -p 4444 -D "cn=Directory Manager" -w password -X -n \ list-local-db-indexes --backend-name userRoot Local DB Index : Type : index-type ----------------:---------:-------------------- aci : generic : presence cn : generic : equality, substring ds-sync-hist : generic : ordering entryUUID : generic : equality givenName : generic : equality, substring mail : generic : equality, substring member : generic : equality objectClass : generic : equality sn : generic : equality, substring telephoneNumber : generic : equality, substring uid : generic : equality uniqueMember : generic : equality
The following command rebuilds indexes (-i) with a base DN (-b).
The directory server must be stopped before you can run this command.
$ rebuild-index -b dc=example,dc=com -i uid -i mail [31/Jul/2007:01:51:59 -0500] category=BACKEND severity=NOTICE msgID=8388745 msg Rebuild of index(es) uid, mail started with 320 total records to process [31/Jul/2007:01:52:00 -0500] category=BACKEND severity=NOTICE msgID=8388741 msg Rebuild complete. Processed 320 records in 0 seconds (average rate 445.7/sec)
An exit code of 0 indicates that the operation completed successfully. An exit code of 1 indicates that an error occurred during processing.
The rebuild-index command is located at these paths:
UNIX and Linux: install-dir/bin/rebuild-index
Windows: install-dir\bat\rebuild-index.bat