10.3. Deleting Indexes

10.3. Deleting Indexes

This section describes how to delete presence, equality, approximate, substring, international, and browsing indexes for specific attributes.

NOTE

Because Directory Server 8.0 can operate in either a single or multi-database environment, you have to delete any unwanted indexes from every database instance. Any default indexes you delete will not be deleted from previous sets of indexes on existing database instances.

CAUTION

Do not delete system indexes because deleting them can significantly affect Directory Server performance. System indexes are located in the cn=index,cn=instance,cn=ldbm database,cn=plugins,cn=config entry and the cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config entry.

Also, be cautious when deleting default indexes since this can also affect how Directory Server works.

10.3.1. Deleting Indexes from the Server Console

The Directory Server Console allows you to delete any indexes you have created, indexes used by other server applications such as a messaging or web server, and default indexes.

NOTE

You cannot delete system indexes.

To delete indexes using the Directory Server Console, do the following:

  1. Select the Configuration tab.

  2. Expand the Data node and expand the suffix associated with the database containing the index.

  3. Select the database from which to delete the index.

  4. Locate the attribute containing the index to delete. Clear the checkbox under the index.

    To delete all indexes maintained for a particular attribute, select the attribute's cell under Attribute Name, and click Delete Attribute.

  5. Click Save.

    A Delete Index warning dialog box opens, requiring a confirmation to delete the index.

  6. Click Yes to delete the index.

  7. The Delete Browsing Index dialog box appears displaying the status of the index deletion. Click the Status Logs button to view the status of the indexes deleted.

  8. Once the indexing is complete, click Close.

10.3.2. Deleting Indexes from the Command-Line

Creating browsing indexes, or virtual list view (VLV) indexes, using the ldapdelete command-line utility has two steps:

  1. Delete an entire index entry or delete unwanted index types from an existing index entry using the ldapdelete command-line utility (Section 10.3.2.1, “Deleting an Index Entry”).

  2. Generate the new set of indexes to be maintained by the server using the db2index.pl Perl script (Section 10.3.2.2, “Running the db2index.pl Script”).

10.3.2.1. Deleting an Index Entry

Use the ldapdelete command-line utility to delete either the entire indexing entry or the unwanted index types from an existing entry.

  • To delete the indexes for a particular database, remove the index entry from the cn=index,cn=database_name,cn=ldbm database,cn=plugins,cn=config entry, where cn=database_name corresponds to the name of the database.

  • To delete a default index, remove it from the cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config entry.

  1. Run ldapdelete.[9]

    ldapdelete -D "cn=Directory Manager" -w password -h ExampleServer
         -p 389 "cn=sn,cn=index,cn=Example1,dn=ldbm database,cn=plugins,dn=config"
    

    For complete information on ldapdelete, see the Directory Server Configuration, Command, and File Reference.

  2. For example, delete the presence, equality, and substring indexes for the sn attribute on the database named Example1:

    dn: cn=sn,cn=index,cn=Example1,cn=ldbm database,cn=plugins,cn=config 
    objectClass:top 
    objectClass:nsIndex 
    cn:sn 
    nsSystemIndex:false 
    nsIndexType:pres 
    nsIndexType:eq 
    nsIndexType:sub 
    nsMatchingRule:2.16.840.1.113730.3.3.2.3.1
    

Table 10.5, “ldapdelete Options” describes the ldapdelete options.

Option Description
-D Specifies the distinguished name with which to authenticate to the server. The value must be a DN recognized by the Directory Server, and it must also have the authority to modify the entries.
-w Specifies the password associated with the distinguished name specified in the -D option.
-h Specifies the name of the host on which the server is running.
-p Specifies the port number that the server uses.
Table 10.5. ldapdelete Options

After deleting the index entry, the presence, equality, and substring indexes for the sn attribute are no longer maintained by the Example1 database.

10.3.2.2. Running the db2index.pl Script

After deleting an indexing entry or some of the index types from an indexing entry, run the db2index.pl script to generate the new set of indexes to be maintained by the Directory Server. Once you run the script, the new set of indexes is active for any new data you add to your directory and any existing data in your directory.

To run the db2index.pl Perl script, do the following:

  1. Open the Directory Server instance directory.[10]

    cd /usr/lib/dirsrv/slapd-instance_name
    
  2. Run the db2index.pl Perl script. For example:

    db2index.pl-D "cn=Directory Manager" -w password -n Example1
    

For more information about using the db2index.pl Perl script, refer to Directory Server Configuration, Command, and File Reference. Table 10.6, “db2index Options” describes the db2index.pl options used in the examples:

Option Description
-D Specifies the DN of the administrative user.
-w Specifies the password of the administrative user.
-n Specifies the name of the database into which you are importing the data.
Table 10.6. db2index Options

10.3.3. Deleting Browsing Indexes from the Server Console

To delete a browsing index through the Directory Server Console, do the following:

  1. Select the Directory tab.

  2. Select the entry from which to delete the index in the navigation tree, and select Delete Browsing Index from the Object menu.

    Alternatively, select and right-click the entry of the index to delete in the navigation tree, and then choose Delete Browsing Index from the pop-up menu.

  3. A Delete Browsing Index dialog box appears asking you to confirm the deletion of the index. Click Yes.

  4. The Delete Browsing Index dialog box appears displaying the status of the index deletion.

10.3.4. Deleting Browsing Indexes from the Command-Line

Deleting a browsing index or virtual list view (VLV) index from the command-line involves two steps:

  1. Using the ldapdelete to delete browsing index entries or edit existing browsing index entries (Section 10.3.4.1, “Deleting a Browsing Index Entry”).

  2. Running the vlvindex script to generate the new set of browsing indexes to be maintained by the server (Section 10.3.4.2, “Running the vlvindex Script”).

The actual entries for an alphabetical browsing index and virtual list view are the same. The following sections describe the steps involved in deleting browsing indexes.

10.3.4.1. Deleting a Browsing Index Entry

Use the ldapdelete command-line utility to either delete browsing indexing entries or edit existing browsing index entries. To delete browsing indexes for a particular database, remove the browsing index entries from the cn=index,cn=database_name,cn=ldbm database,cn=plugins,cn=config entry, where cn=database_name corresponds to the name of the database.

For example, there is a browsing index for accelerating ldapsearch operations on the entry ou=People,dc=example,dc=com. It held in the Example1 database where the search base is ou=People,dc=example,dc=com, the search filter is (|(objectclass=*)(objectclass=ldapsubentry)), the scope is 1, and the sorting order for the returned attributes is cn, givenName, o, ou, and sn.

  1. Run ldapdelete.[9]

    ldapdelete-D "cn=Directory Manager" -w password -h ExampleServer
    -p 389 "cn=MCC ou=People dc=example dc=com, cn=userRoot, cn=ldbm database, cn=plugins, cn=config"
    
    "cn=by MCC ou=People dc=example dc=com,cn=MCC ou=People
    dc=example dc=com, cn=userRoot, cn=ldbm database, cn=plugins, cn=config"
    

    For full information on ldapdelete options, see the Directory Server Configuration, Command, and File Reference.

  2. To delete this browsing index, delete the two corresponding browsing index entries:

    dn: cn=MCC ou=People dc=example dc=com, cn=userRoot, cn=ldbm database, cn=plugins, cn=config 
    objectClass: top 
    objectClass: vlvSearch 
    cn: MCC ou=People dc=example dc=com 
    vlvBase: ou=People, dc=example,dc=com 
    vlvScope: 1 vlvFilter: (|(objectclass=*)(objectclass=ldapsubentry))
    
    dn: cn=by MCC ou=People dc=example dc=com,cn=MCC ou=People
    dc=example dc=com, cn=userRoot, cn=ldbm database, cn=plugins,cn=config
    objectClass: top
    objectClass: vlvIndex
    cn: by MCC ou=People dc=example dc=com
    vlvSort: cn givenName o ou sn
    

The following table describes the ldapdelete options used in the example:

Option Description
-D Specifies the distinguished name with which to authenticate to the server. The value must be a DN recognized by the Directory Server, and it must also have the authority to modify the entries.
-w Specifies the password associated with the distinguished name specified in the -D option.
-h Specifies the name of the host on which the server is running.
-p Specifies the port number that the server uses.

After deleting the two browsing index entries, the browsing index will no longer be maintained by the Example1 database.

10.3.4.2. Running the vlvindex Script

After deleting browsing indexing entries or unwanted attribute types from existing browsing indexing entries, run the vlvindex script to generate the new set of browsing indexes to be maintained by the Directory Server. After the script is run, the new set of browsing indexes is active for any new data added to the directory and any existing data in the directory.

  1. Open the Directory Server instance directory.[10]

    cd /usr/lib/dirsrv/slapd-instance_name
    
  2. Stop the server.[11]

    service dirsrv stop instance
    
  3. Run the vlvindex script.

    vlvindex -n Example1 -T "by MCC ou=people dc=example dc=com"
    

    For more information about using the vlvindex script, see the Directory Server Configuration, Command, and File Reference.

  4. Restart the server.

    service dirsrv start instance
    

Table 10.4, “vlvindex Options” describes the vlvindex options.


Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-5 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.