I recently said the following to someone in an IMversation:
ldapsearch and ldapmodify are about 10 times better than a stupid GUI because you can script everything.
it's like the difference between knowing SQL and having to use TOAD or Access (*shudder*) to add rows to a db table
I think if I had a personal motto it would be something like "if I can't script it then I'm not interested." (well that or "oh look, shiny!")
I recently had to extend my LDAP schema of an OID 11g directory and I didn't have access to the ODSM GUI (for reasons that aren't important). So I had to extend the schema via ldapsearch/ldapmodify (i.e. the hard way) and thought I'd write down my steps to save you the trouble of figuring it out for yourself.
Hat tip to OnlineAppsDBA for his work. I stood on his shoulders for this post.
First things first you need to figure out names for your attributes and objectclass. In my case I wanted the name customAttr1 and customAttr2 for the attributes and customClass1 for the objectclass.
To modify the schema you use ldapmodify and update the cn=schemasubentry object at the root of the directory and add the relevant attributes. Here's me adding the two attributes and the objectclass as three separate transactions.
$ ldapmodify -p $DIRLISTENPORT -D $DIRADMINDN -w $DIRADMINPASSWORD -a -c dn: cn=subschemasubentry changetype: modify add: attributetypes attributetypes: ( 184.108.40.206.01 NAME 'customAttr1' DESC 'Custom Attribute 1' EQUALITY caseIgnoreMatch SYNTAX '220.127.116.11.4.1.1418.104.22.168.15' ) modifying entry cn=subschemasubentry dn: cn=subschemasubentry changetype: modify add: attributetypes attributetypes: ( 22.214.171.124.02 NAME 'customAttr2' DESC 'Custom Attribute 2' EQUALITY caseIgnoreMatch SYNTAX '126.96.36.199.4.1.14188.8.131.52.15' ) modifying entry cn=subschemasubentry dn: cn=subschemasubentry changetype: modify add: objectClasses objectClasses: ( 184.108.40.206.03 NAME 'customClass1' DESC 'custom objectclass 1' SUP top STRUCTURAL MUST cn MAY ( customAttr1 $ customAttr2 ) ) modifying entry cn=subschemasubentry
The important things to note are that each attribute and objectclass has a unique Object IDentifier (OID) (that's the 220.127.116.11.__ number) and that I used "18.104.22.168.4.1.1422.214.171.124.15" which tells OID that the attribute is a directory string. In Atul's post he had a different number there because OID 10g used a different number. The other possible data types are available in the "ldapsyntaxes" attribute of "cn=schemasubentry".