Este conteúdo não está disponível no idioma selecionado.

13.3. Creating New Indexes to Existing Databases


Learn how to initiate indexing operations on Directory Server. You must create indexes manually because Directory Server does not automatically index databases.

Important

Before you regenerate the index, searches proceed but can return incorrect or inconsistent results.

13.3.1. Creating an Index While the Instance is Running

13.3.1.1. Creating an Index Using the dsconf backend index reindex Command

To recreate the index of a database while the instance is running:
# dsconf -D "cn=Directory Manager" ldap://server.example.com backend index reindex database_name
Copy to Clipboard Toggle word wrap

13.3.1.2. Creating an Index Using a cn=tasks Entry

The cn=tasks,cn=config entry in the Directory Server configuration is a container entry for temporary entries the server uses to manage tasks. To initiate an index operation, create a task in the cn=index,cn=tasks,cn=config entry.
Use the ldapadd utility to add a new index task. For example, to add a task that creates the presence index for the cn attribute in the userRoot database:
# ldapadd -D "cn=Directory Manager" -W -p 389 -h server.example.com -x

dn: cn=example_presence_index,cn=index,cn=tasks,cn=config
objectclass: top
objectclass: extensibleObject
cn: example presence index
nsInstance: userRoot
nsIndexAttribute: "cn:pres"
Copy to Clipboard Toggle word wrap
When the task is completed, the entry is removed from the directory configuration.
For further details, about the cn=index,cn=tasks,cn=config entry, see the cn=index section in the Red Hat Directory Server Configuration, Command, and File Reference.

13.3.2. Creating an Index While the Instance Offline

After creating an indexing entry or adding additional index types to an existing indexing entry, use the dsconf db2index command:
  1. Shut down the instance:
    # dsctl instance_name stop
    Copy to Clipboard Toggle word wrap
  2. Recreate the index:
    1. For all indexes in the database, run:
      # dsctl instance_name db2index userRoot
      [13/Aug/2019:15:25:37.277426483 +0200] - INFO - ldbm_instance_config_cachememsize_set - force a minimal value 512000
      [13/Aug/2019:15:25:37.289257996 +0200] - INFO - check_and_set_import_cache - pagesize: 4096, available bytes 1704378368, process usage 22212608 
      [13/Aug/2019:15:25:37.291738104 +0200] - INFO - check_and_set_import_cache - Import allocates 665772KB import cache.
      ...
      db2index successful
      Copy to Clipboard Toggle word wrap
    2. For specific attribute indexes, run:
      # dsctl instance_name db2index userRoot --attr aci cn givenname
      Copy to Clipboard Toggle word wrap
      The following command recreates indexes for aci, cn, and givenname attributes. Note that if no database is specified, the command recreates indexes for all attributes.
  3. Start the instance:
    # dsctl instance_name start
    Copy to Clipboard Toggle word wrap
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat