Sun Java System Directory Server Enterprise Edition 6.0 管理指南

建立屬性類型

cn=schema 項目具有多值屬性 attributeTypes,此屬性含有目錄模式中各種屬性類型的定義。您可以使用 ldapmodify(1) 指令增加至這些定義。

新的屬性類型定義,以及您對使用者定義的屬性類型所做的變更,都會儲存在 99user.ldif 檔案中。

對於每個屬性類型定義,您必須至少提供一個 OID 以定義您新的屬性類型。請考慮對新的屬性類型至少使用下列元素:

Procedure建立屬性類型

您可以使用 DSCC 執行此作業。如需有關資訊,請參閱目錄服務控制中心介面與 DSCC 線上說明。

  1. 根據 RFC 4517 中所指定的語法,備妥您的屬性類型定義。

  2. 使用 ldapmodify(1) 指令,增加您的屬性類型定義。

    請注意,目錄伺服器會將 X-ORIGIN 'user defined' 增加到您所提供的定義中。


範例 11–1 建立屬性類型

下列範例使用 ldapmodify 指令,增加使用「目錄字串」語法的新屬性類型。


$ cat blogURL.ldif 
dn: cn=schema
changetype: modify
add: attributeTypes
attributeTypes: ( 1.2.3.4.5.6.7 
 NAME ( 'blog' 'blogURL' ) 
 DESC 'URL to a personal weblog' 
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 
 SINGLE-VALUE )

$ ldapmodify -D cn=admin,cn=Administrators,cn=config -w - -f blogURL.ldif
Enter bind password: 
modifying entry cn=schema

$

在生產環境中,您必須提供有效且唯一的 OID,而非 1.2.3.4.5.6.7