OpenDS Tips: Troubleshooting OpenDS database

Opends Logo TagIn a previous tip, I’ve talked about troubleshooting index problems with OpenDS. Sometimes, one might need to get a better understanding of the OpenDS databases to troubleshoot some data or performance issue.

Here comes the little known OpenDS feature : dbtest.

dbtest is a command line utility that can be used to inspect the content of an OpenDS JE backend (which relies on the Oracle Berkeley Database Java Edition).

The command can be used to list the root container, the entry container, the database containers, get statistics on their content, see the status of index files and possibly dump the content of the database. While dumping the database is hardly useful for most people the tool still has a couple of features of general interest.

It can be used to list all database containers for the userRoot backend, including the index containers, their names and their current entry count.

$ bin/dbtest list-database-containers -b “dc=example,dc=com” -n “userRoot”

Database Name Database Type JE Database Name Entry Count

————————————————————————————————–

dn2id DN2ID dc_example_dc_com_dn2id 102

id2entry ID2Entry dc_example_dc_com_id2entry 102

referral DN2URI dc_example_dc_com_referral 0

id2children Index dc_example_dc_com_id2children 2

id2subtree Index dc_example_dc_com_id2subtree 2

state State dc_example_dc_com_state 19

uniqueMember.equality Index dc_example_dc_com_uniqueMember.equality 0

sn.equality Index dc_example_dc_com_sn.equality 100

sn.substring Index dc_example_dc_com_sn.substring 541

objectClass.equality Index dc_example_dc_com_objectClass.equality 6

entryUUID.equality Index dc_example_dc_com_entryUUID.equality 102

ds-sync-hist.ordering Index dc_example_dc_com_ds-sync-hist.ordering 0

aci.presence Index dc_example_dc_com_aci.presence 0

cn.equality Index dc_example_dc_com_cn.equality 100

cn.substring Index dc_example_dc_com_cn.substring 1137

telephoneNumber.equality Index dc_example_dc_com_telephoneNumber.equality 100

telephoneNumber.substring Index dc_example_dc_com_telephoneNumber.substring 956

givenName.equality Index dc_example_dc_com_givenName.equality 100

givenName.substring Index dc_example_dc_com_givenName.substring 396

uid.equality Index dc_example_dc_com_uid.equality 100

mail.equality Index dc_example_dc_com_mail.equality 100

mail.substring Index dc_example_dc_com_mail.substring 525

member.equality Index dc_example_dc_com_member.equality 0

Total: 23

Or dbtest can be used to retrieve the system and user indexes and their status.

$ bin/dbtest list-index-status -b “dc=example,dc=com” -n “userRoot”

Index Name Index Type JE Database Name Index Status

————————————————————————————————

id2children Index dc_example_dc_com_id2children true

id2subtree Index dc_example_dc_com_id2subtree true

uniqueMember.equality Index dc_example_dc_com_uniqueMember.equality true

sn.equality Index dc_example_dc_com_sn.equality true

sn.substring Index dc_example_dc_com_sn.substring true

objectClass.equality Index dc_example_dc_com_objectClass.equality true

entryUUID.equality Index dc_example_dc_com_entryUUID.equality true

ds-sync-hist.ordering Index dc_example_dc_com_ds-sync-hist.ordering true

aci.presence Index dc_example_dc_com_aci.presence true

cn.equality Index dc_example_dc_com_cn.equality true

cn.substring Index dc_example_dc_com_cn.substring true

telephoneNumber.equality Index dc_example_dc_com_telephoneNumber.equality true

telephoneNumber.substring Index dc_example_dc_com_telephoneNumber.substring true

givenName.equality Index dc_example_dc_com_givenName.equality true

givenName.substring Index dc_example_dc_com_givenName.substring true

uid.equality Index dc_example_dc_com_uid.equality true

mail.equality Index dc_example_dc_com_mail.equality true

mail.substring Index dc_example_dc_com_mail.substring true

member.equality Index dc_example_dc_com_member.equality true

Total: 19

An index status of true means it’s a trusted index, a status of false means the index is no longer trusted and needs

rebuilding.

You can find more details on the dbtest tool on the OpenDS documentation wiki.

Technorati Tags: , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s