10.3. Deleting Indexes
This section describes how to delete presence, equality, approximate, substring, international, and browsing indexes for specific attributes.
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.
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.
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.
You cannot delete system indexes.
To delete indexes using the Directory Server Console, do the following:
Select the Configuration tab.
Expand the Data node and expand the suffix associated with the database containing the index.
Select the database from which to delete the index.
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.
Click Save.
A Delete Index warning dialog box opens, requiring a confirmation to delete the index.
Click Yes to delete the index.
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.
Once the indexing is complete, click Close.
Creating browsing indexes, or virtual list view (VLV) indexes, using the ldapdelete
command-line utility has two steps:
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”).
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”).
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.
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.
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. |
After deleting the index entry, the presence, equality, and substring indexes for the sn
attribute are no longer maintained by the Example1
database.
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:
Open the Directory Server instance directory.[10]
cd /usr/lib/dirsrv/slapd-instance_name
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. |
To delete a browsing index through the Directory Server Console, do the following:
Select the Directory tab.
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.
A Delete Browsing Index dialog box appears asking you to confirm the deletion of the index. Click Yes.
The Delete Browsing Index dialog box appears displaying the status of the index deletion.
Deleting a browsing index or virtual list view (VLV) index from the command-line involves two steps:
Using the ldapdelete
to delete browsing index entries or edit existing browsing index entries (Section 10.3.4.1, “Deleting a Browsing Index Entry”).
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.
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
.
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.
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.
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.
Open the Directory Server instance directory.[10]
cd /usr/lib/dirsrv/slapd-instance_name
Stop the server.[11]
service dirsrv stop instance
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.
Restart the server.
service dirsrv start instance
Table 10.4, “vlvindex Options” describes the vlvindex
options.