Sun Java System Communications Services 2005Q4 版本說明

更新索引

執行 LDAP 搜尋時,大多數效能問題是因為索引不存在或未正確配置導致的。依預設,配置 Directory Server 以便為 Communications Express 或 Connector for Microsoft Outlook 發出的查詢建立索引並在合理時間內傳回。然而,國際搜尋未設置 Directory Server。因此,需要改變現有索引以便考量已選擇的比較規則。「Sun Java System Directory Server 5 2005Q1 Administration Guide」中的「Managing Indexes」小節說明了這一點。

例如,依預設 CN 屬性在 userRoot 字尾建立索引:

# ldapsearch -D "cn=Directory manager" -b 
"cn=cn,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config" 
"objectclass=*" 
cn=cn,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config 
objectClass=top objectClass=nsIndex 
cn=cn 
nsSystemIndex=false 
nsIndexType=pres 
nsIndexType=eq 
nsIndexType=sub

若要使用英文 (US) 比較規則的國際搜尋使用它,請增加一個具有英文 (US) OID 的 nsMatchingRule 屬性。由於是用戶端執行子字串搜尋,因此需要將子字串字尾 (「.6」) 增加至 OID:

#ldapmodify -D "cn=Directory manager"
dn: cn=cn,cn=index,cn=userRoot,cn=ldbm database, 
 cn=plugins,cn=config
changetype: modify
add: nsMatchingRule
nsMatchingRule: 1.3.6.1.4.1.42.2.27.9.4.34.1.6 

備註 –

請勿在值的開頭或結尾增加任何空格、標籤或其他非可視字元。



備註 –

nsMatchingRule 是多值屬性。可以為相同 OID 或不同 OID 增加不同類型的搜尋。


然後必須執行位於 serverroot/slapd-instance 之下的 db2index.pl 程序檔:

# perl db2index.pl -D "cn=Directory Manager" -w \ 
secret -n userRoot -t cn

此作業在線上執行,且需要花費一段時間才能完成。 也可選擇重新初始化字尾。請參閱「Sun Java System Directory Server 5 2005Q1 Administration Guide」中的「Reinitializing a Suffix」。

主控台還可用於增加 nsMatchingRule (請參閱「Sun Java System Directory Server 5 2005Q1 Administration Guide」中的「Managing Indexes」小節)。

在以下小節中,提供了需要修改的索引清單。請確保未執行任何非索引搜尋。這可以透過查看 Directory Server 存取記錄檔 (並在搜尋結果項目中查找 notes=U) 來完成。