My Oracle Support Banner

How to Configure VLV Indexes on Oracle Directory Server Enterprise Edition (ODSEE) (Doc ID 1396420.1)

Last updated on MAY 03, 2023

Applies to:

Oracle Directory Server Enterprise Edition - Version 6.0 and later
Information in this document applies to any platform.

Goal

This document covers the following topics:

When an LDAP client issues a search, it may require that the server return data in segments rather than as one long stream of data. In order for the server to successfully search and return the requested data back to client "block by block" within the acceptable time limit, a VLV index (also known as browsing index) needs to be created on the server otherwise the search will be unindexed (notes=U).

This VLV index has to match the search exactly in the following four fields:
- search base
- search scope
- search filter
- sort index

If any of the four elements above do not match the configured VLV index then the index will not be used.

NOTE - Oracle Directory Server Enterprise Edition does not support Simple Paged Results

Below is an example of a search performed against ODSEE where no VLV Index is configured.

# ldapsearch -D "cn=<DS_ADMIN>" -w <PASSWORD> -p LDAP_PORT -b ou=people,<SUFFIX_DN> -s one -G 1:2:<UID8> -S "uid givenname" -x objectclass=person
version: 1
dn: uid=<UID7>, ou=people, <SUFFIX_DN>
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
userPassword: <HASHED_PASSWORD>
givenName: U7
cn: U7 L7
uid: <UID7>
sn: L7

dn: <UID7>, ou=people, <SUFFIX_DN>
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
userPassword: <HASHED_PASSWORD>
givenName: U8
cn: U8 L8
uid: <UID8>
sn: L8

dn: uid=<UID9>, ou=people, <SUFFIX_DN>
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
userPassword: <HASHED_PASSWORD>
givenName: U9
cn: U9 L9
uid: <UID9>
sn: L9
index 9 content count 10

 

The above ldapsearch shows that

  1. The base is "ou=people,<SUFFIX_DN>"
  2. The scope is "one level" below "ou=people,<SUFFIX_DN>"
  3. The filter is any entry with objectclass=person in it.
  4. The sort order is "uid" and "givenname"

The corresponding access log reports

[19/Jan/2012:01:54:05 -0500] conn=5 op=-1 msgId=-1 - fd=35 slot=35 LDAP connection from 127.0.0.1:<PORT> to 127.0.0.1
[19/Jan/2012:01:54:05 -0500] conn=5 op=0 msgId=1 - BIND dn="cn=<DS_ADMIN>" method=128 version=3
[19/Jan/2012:01:54:05 -0500] conn=5 op=0 msgId=1 - RESULT err=0 tag=97 nentries=0 etime=0.000130 dn="cn=<DS_ADMIN>"
[19/Jan/2012:01:54:05 -0500] conn=5 op=1 msgId=2 - SRCH base="ou=people,<SUFFIX_DN>" scope=1 filter="(objectClass=person)" attrs=ALL
[19/Jan/2012:01:54:05 -0500] conn=5 op=1 msgId=2 - SORT uid givenname
[19/Jan/2012:01:54:05 -0500] conn=5 op=1 msgId=2 - VLV 1:2:<UID8> 9:10 (0)
[19/Jan/2012:01:54:05 -0500] conn=5 op=1 msgId=2 - RESULT err=0 tag=101 nentries=3 etime=0.000380 notes=U
[19/Jan/2012:01:54:05 -0500] conn=5 op=2 msgId=3 - UNBIND
[19/Jan/2012:01:54:05 -0500] conn=5 op=2 msgId=-1 - closing from 127.0.0.1:62732 - U1 - Connection closed by unbind client -
[19/Jan/2012:01:54:06 -0500] conn=5 op=-1 msgId=-1 - closed.

From the above access log

  1. The base dn of the search is "ou=people,<SUFFIX_DN>"
  2. The scope is one level (scope=1) below the base dn.
  3. The filter is "objectclass=person"
  4. the sort order is "uid" & "givenname"

Line 6 from the above access log snippet, VLV 1:2:<UID8> 9:10 (0), describes the sort order requested in the ldapsearch.

-G before:after:index:count | before:after:value where 'before' and
'after' are the number of entries surrounding 'index.'
'count' is the content count, 'value' is the search value.

This example requested -

Line 7 shows that three entries matched the search criteria. The etime was sub second and the search was unindexed (notes=U).

 

-G is optional, for reference -

ldapsearch man page


-G pattern

   Retrieve a virtual list view displaying a portion of the total search results. Use this option with the -S and -x options to sort entries returned.

   The specified pattern may take one of two forms to specify the size of the virtual list view around a target entry:

   entriesbefore:entriesafter:value

       Return the target entry, which is the first entry in the sorted results whose sort attribute is greater than or equal to the specified value, as well as the specified number of entries before the target entry and the specified number of entries after the target entry.

       For example, -S sn -x -G 5:10:<UID13> returns 14 entries in alphabetical order of the surname attribute: 5 less than <UID13>, the entry equal to or following <UID13>, and the 10 subsequent entries.
   entriesbefore:entriesafter:index:count

       Return the target entry, as well as the specified number of entries before the target entry and the specified number of entries after the target entry. The target entry depends on the index and estimated count arguments.

       The count argument may take the following values, with the following results:

       count == 0

           The target is the entry at the specified index position, starting from 1, and relative to the entire list of sorted results.
       count == 1

           The target is the first entry in the list of sorted results.
       count > 1

           The target is the first entry in the slice of the list represented by the fraction index/count.

           Use an index argument greater than the count argument to target the last result in the list.

       For example, -G 5:10:2:4 specifies the index closest to the beginning of the second quarter of the entire list. If the search yielded 100 entries, the target index would be 26, and this pattern would return entries 21 through 36.

       The number of entries displayed before and after the target entry may be limited by the beginning and end of the virtual list. The ldapsearch command displays the control response, giving the count of entries in the virtual list and the index of the target entry. Use these values to refine index and count arguments.

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution
 Creation of a VLV index
 Troubleshooting - SRCH operation results in err=50


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.