Oracle® Internet Directory Administrator's Guide 10g (9.0.4) Part Number B12118-01 |
|
Directory Schema Administration, 3 of 7
This section contains these topics:
This section explains how to add and modify an object class. Oracle Corporation recommends that you understand the basic concepts of directory components before attempting to add to or modify the base schema in the directory.
See Also:
|
When you add a directory entry, you associate it with one or more object classes. Each object class contains attributes that you want to associate with the new entry. For example, if you are creating an entry for an employee, you can associate the entry with the person
object class. This object class contains many of the attributes that you want to associate with that employee entry--including, for example, name, address, and telephone number.
Each object class derives from a hierarchy of superclasses, and it inherits attributes from these superclasses. By default, all object classes inherit from the top
object class. When you assign an object class to an entry, the entry inherits all of the attributes of both that object class as well as its superclasses.
The attributes that entries inherit from an super class may be either mandatory or optional. Values for optional attributes need not be present in the directory entry.
You can specify for any object class whether an attribute is mandatory or optional; however, the characteristic you specify is binding only for that object class. If you place the attribute in another object class, you can again specify whether the attribute is mandatory or optional for that object class. You can:
Entries must be added in a top-down sequence--that is, when you add an entry, all of its parent entries must already exist in the directory. Similarly, when you add entries that reference object classes and attributes, those referenced object classes and attributes must already exist in the directory schema. In most cases this will not be a problem because the directory server is delivered with a full set of standard directory objects.
When you add or perform an operation on an entry, you do not need to specify the entire hierarchy of superclasses associated with that entry. This feature, called object class explosion, enables you to specify only the leaf object classes. Oracle Internet Directory resolves the hierarchy for the leaf object classes and enforces the information model constraints. For example, the inetOrgPerson
object class has top
, person
and organizationalPerson
as its superclasses. When you create an entry for a person, you need to specify only inetOrgPerson
as the object class. Oracle Internet Directory then enforces the schema constraints defined by the respective superclasses, namely, top
, person
, and organizationalPerson
.
When you add object classes, keep the following guidelines in mind:
top
as a superclass.
"Subclasses, Superclasses, and Inheritance" for a conceptual discussion of these terms
See Also:
This section discusses the types of modifications you can make to an existing object class. You can perform modifications through Oracle Directory Manager and through the command-line tools.
You can make these changes to an object class:
When you modify object classes, keep these guidelines in mind:
There are also some limitations on deleting object classes:
This section tells you how to use Oracle Directory Manager to search for object classes, view their properties, add, modify, and delete them.
You can specify your search for an object class by:
This section provides more details on how to enter an object class search.
To search for an object class:
orcl
, type those letters in the text box at the right end of the search criteria bar.
To view all object classes in the schema:
To examine an individual object class and its attributes, in the Object Classes tab page, choose the object class. The properties of the selected object class appear in the Object Class dialog box.
To add object classes by using Oracle Directory Manager:
Alternatively, in the Object Classes tab page, select an object class that is similar to one you would like to create, and then choose Create Like. The New Object Class dialog box displays the attributes of the selected object class. You can create the new object class by using the selected one as a template.
See Also:
To modify an object class:
You can add attributes to an auxiliary object class or a user-defined structural object class.
See Also: Example: Adding a New Attribute to an Auxiliary or User-Defined Object Class for an example of adding attributes to an auxiliary object class
Note:
To delete an object class by using Oracle Directory Manager:
You can use command-line tools to add or modify existing object classes in the directory schema. The command-line tools enable you to use input files. Furthermore, the commands can be batched together in scripts.
To add or modify schema components, use ldapmodify.
In this example, an LDIF input file, new_object_class.ldi
, contains data similar to this:
dn: cn=subschemasubentry changetype: modify add: objectclasses objectclasses: ( 1.2.3.4.5 NAME 'myobjclass' SUP top STRUCTURAL MUST ( cn $ sn ) MAY ( telephonenumber $ givenname $ myattr ) )
Be sure to leave the mandatory space between the opening and closing parentheses and the object identifier.
To load the file, enter this command:
ldapmodify -h myhost -p 389 -f new_object_class.ldi
This example adds the structural object class named myobjclass
, giving it an object identifier of 1.2.3.4.5
, specifying top as its superclass, requiring cn
and sn
as mandatory attributes, and allowing telephonenumber
, givenname
, and myattr
as optional attributes. Note that all the attributes mentioned must exist prior to the execution of the command.
To create an abstract object class, follow the previous example, replacing the word STRUCTURAL
with the word ABSTRACT
.
To add a new attribute to either an auxiliary object class or a user-defined structural object class, use ldapmodify. This example deletes the old object class definition and adds the new definition in a compound modify operation. The change is committed by the directory server in one transaction. Existing data is not affected. The input file should be as follows:
dn: cn=subschemasubentry changetype: modify delete: objectclasses objectclasses: old value - add: objectclasses objectclasses: new value
For example, to add the attribute changes
to the existing object class country
, the input file would be:
dn: cn=subschemasubentry changetype: modify delete: objectclasses objectclasses: ( 2.5.6.2 NAME 'country' SUP top STRUCTURAL MUST c MAY
( searchGuide $ description ) ) - add: objectclasses objectclasses: ( 2.5.6.2 NAME 'country' SUP top STRUCTURAL MUST c MAY
( searchGuide $ description $ changes ) )
|
![]() Copyright © 1999, 2003 Oracle Corporation. All Rights Reserved. |
|