2.4. 使用命令行维护特定数据库的索引
您可以使用 dsconf 实用程序使用命令行维护索引设置。
流程
例如,要将
roomNumber属性添加到带有索引类型eq和sub的userRoot数据库的索引中,请输入:# dsconf -D "cn=Directory Manager" ldap://server.example.com backend index add --attr roomNumber --index-type eq --index-type sub --reindex userRoot--reindex选项会导致 Directory 服务器自动重新索引数据库。例如,要将
pres索引类型添加到userRoot数据库中roomNumber属性的索引设置中,请输入:# dsconf -D "cn=Directory Manager" ldap://server.example.com backend index set --attr roomNumber --add-type pres userRoot例如,要从
userRoot数据库中roomNumber属性的索引设置中删除pres索引类型,请输入:# dsconf -D "cn=Directory Manager" ldap://server.example.com backend index set --attr roomNumber --del-type pres userRoot例如,要从
userRoot数据库中的索引中删除roomNumber属性,请输入:# dsconf -D "cn=Directory Manager" ldap://server.example.com backend index delete --attr roomNumber userRoot
验证
列出
userRoot数据库的索引设置:# dsconf -D "cn=Directory Manager" ldap://server.example.com backend index list userRoot