How to modify schema through LDIF - LDAP

(Last modified: 05Nov2003)

This document (10084796) is provided subject to the disclaimer at the end of this document.

goal

How to modify schema through LDIF - LDAP

fact

Novell Directory Services 8

Novell eDirectory 8.5 for All Platforms

Novell eDirectory 8.6 for All Platforms

Novell eDirectory 8.7 for All Platforms

cause

A good way to modify schema is to use an LDIF file through LDAP.  The LDIF format is easy to understand. 

fix

Below are examples on how to modify a class, modify an attribute, delete a class and delete an attribute.

Modify a Class template ldif file:

dn: cn=schema
changetype: modify
delete: objectClasses
objectClasses: (OID)
-
add: objectClasses
objectClasses: (OID NAME DESC X-NDS flags)

For example: 

version: 1

dn: cn=schema
changetype: modify
delete: objectClasses
objectClasses: (2.5.6.6.6.1.200 NAME 'musician' SUP top MUST (nickname) MAY (recordings $ bands) X-NDS_NOT_CONTAINER '1')
-
add: objectClasses
objectClasses: (2.5.6.6.6.1.200 NAME 'musician' SUP top MUST (nickname) MAY (recordings $ bands) X-NDS_NOT_CONTAINER '0')

This example simply changed the X-NDS_NOT_CONTAINER flag.  In the delete section, the fourth line down could have read:
objectClasses: (2.5.6.6.6.1.200)

note

The OID can be used in the delete portion.  If the OID is not known, the entire definition must be listed in the delete portion.  Also note the "-" on a line by itself.  This is critical for the operation to work.

fix

Modify an Attribute template ldif file:

dn: cn=schema
changetype: modify
delete: attributeTypes
attributeTypes: (OID)
-
add: attributeTypes
attributeTypes: (OID NAME DESC SYNTAX, X-NDS FLAGS)

For example:

version: 1

dn: cn=schema
changetype: modify
delete: attributeTypes
attributeTypes: (2.5.6.6.6.1.1 NAME 'nickname' DESC 'Attribute' SYNTAX 2.16.840.1.113719.1.1.5.1.14 X-NDS_NAME 'nickname' X-NDS_PUBLIC_READ '1')
-
add: attributeTypes
attributeTypes: (2.5.6.6.6.1.1 NAME 'nickname' DESC 'Attribute' SYNTAX 2.16.840.1.113719.1.1.5.1.14 X-NDS_NAME 'nickname' X-NDS_PUBLIC_READ '0')

This example simply changed the X-NDS_PUBLIC_READ flag.  In the delete section, the fourth line down could have read:
attributeTypes: (2.5.6.6.6.1.1)

note

The OID can be used in the delete portion.  If the OID is not known, the entire definition must be listed in the delete portion.  Also note the "-" on a line by itself.  This is critical for the operation to work.

A good way of getting all of the information is to export the schema entry to an LDIF file and then modify what needs to be modified.

fix

Delete a Class:

version: 1

dn: cn=schema
changetype: modify
delete: objectClasses
objectClasses: (OID NAME 'name')

ie
version: 1

dn: cn=schema
changetype: modify
delete: objectClasses
objectClasses: (2.5.6.6.6.1.200 NAME 'musician')

note

If classes and attributes are removed, the class must be removed first because it uses the attributes.

If the OID is not defined for this class, the last line in the sample ldif would read:
objectClasses: (musician-oid NAME 'musician')

A good way of getting all of the information is to export the schema entry to an LDIF file and then modify what needs to be modified.

fix

Delete an Attribute:

version: 1

dn: cn=schema
changetype: modify
delete: attributetypes
attributeTypes: (OID NAME 'name')

ie
version: 1

dn: cn=schema
changetype: modify
delete: attributetypes
attributeTypes: (2.5.6.6.6.1.1 NAME 'nickname')

note

If the OID is not defined for this attribute, the last line in the sample ldif would read:
attributeTypes: (nickname-oid NAME 'nickname')

document

Document Title: How to modify schema through LDIF - LDAP
Document ID: 10084796
Solution ID: NOVL90813
Creation Date: 07Jul2003
Modified Date: 05Nov2003
Novell Product Class:NetWare
Novell eDirectory

disclaimer

The Origin of this information may be internal or external to Novell. Novell makes all reasonable efforts to verify this information. However, the information provided in this document is for your information only. Novell makes no explicit or implied claims to the validity of this information.
Any trademarks referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark information.