Add an attribute

Use either of the following methods to create a new attribute. The Web administration tool is the preferred method.

Web administration

If you have not done so already, expand Schema management in the navigation area, then click Manage attributes. To create a new attribute:

  1. Click Add.
    Note:
    You can also access this panel by expanding Schema management in the navigation area, then click Add an attribute.
  2. Enter the Attribute name, for example, tempId. This is a required field and must begin with an alphabetical character.
  3. Enter a Description of the attribute, for example, The ID number assigned to a temporary employee.
  4. Enter the OID for the attribute. This is a required field. See Object identifier (OID). If you do not have an OID, you can use the attribute name appended with -oid. For example, if the attribute name is tempID, then the default OID is tempID-oid. You can change the value of this field.
  5. Select a Superior attribute from the drop-down list. The superior attribute determines the attribute from which properties are inherited.
  6. Select a Syntax from the drop-down list. See Attribute syntax for additional information about syntax.
  7. Enter an Attribute length that specifies the maximum length of this attribute. The length is expressed as the number of bytes.
  8. Select the Allow multiple values checkbox to enable the attribute to have multiple values.
  9. Select a matching rule from the each of the drop-down menus for equality, ordering, and substring matching rules. See the Matching rules for a complete listing of matching rules.
  10. Click the IBM extensions tab to specify additional extensions for the attribute, or click OK to add the new attribute or click Cancel to return to Manage attributes without making any changes.
  11. At the IBM extensions tab:
  12. Click OK to add the new attribute or click Cancel to return to Manage attributes without making any changes.
Note:
If you clicked OK on the General tab without adding any extensions, you can add extensions by the editing the new attribute.

Command line

The following example adds an attribute type definition for an attribute called "myAttribute", with Directory String syntax (see Attribute syntax) and Case Ignore Equality matching (see Matching rules). The IBM-specific part of the definition says that the attribute data is stored in a column named "myAttrColumn" in a table called "myAttrTable". If these names were not specified, both the column and table name would have defaulted to "myAttribute". The attribute is assigned to the "normal" access class, and values have a maximum length of 200 bytes.

ldapmodify -D <admindn> -w <adminpw> -i myschema.ldif

where the myschema.ldif file contains:

dn: cn=schema
changetype: modify
add: attributetypes
attributetypes: ( myAttribute-oid NAME ( 'myAttribute' )
                 DESC 'An attribute I defined for my LDAP application'
                 EQUALITY 2.5.13.2 SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
                 USAGE userApplications )
-
add: ibmattributetypes
ibmattributetypes: ( myAttribute-oid  DBNAME ( 'myAttrTable' 'myAttrColumn' )
                    ACCESS-CLASS normal LENGTH 200 )

See ldapmodify and ldapadd for more information about this command.