Friday, May 27, 2011

Adding dc=example,dc=com on Sun Directory Server 6 , 7

1) Create the suffix dc=example,dc=com

/opt/SUNWdsee/ds6/bin/dsconf create-suffix -h localhost -p 389 -D "cn=Directory Manager" dc=example,dc=com

2) Import the example data.

/opt/SUNWdsee/ds6/bin/dsconf import -h localhost -p 389 -D "cn=Directory Manager" /opt/SUNWdsee/ds6/ldif/Example.ldif dc=example,dc=com

New data will override existing data of the suffix "dc=example,dc=com".
Initialization will have to be performed on replicated suffixes.
Do you want to continue [y/n] ? y
## Index buffering enabled with bucket size 40
## Beginning import job...
## Processing file "/opt/SUNWdsee/ds6/ldif/Example.ldif"
## Finished scanning file "/opt/SUNWdsee/ds6/ldif/Example.ldif" (160 entries)
## Workers finished; cleaning up...
## Workers cleaned up.
## Cleaning up producer thread...
## Indexing complete.
## Starting numsubordinates attribute generation. This may take a while, please wait for further activity reports.
## Numsubordinates attribute generation complete. Flushing caches...
## Closing files...
## Import complete. Processed 160 entries in 4 seconds. (40.00 entries/sec)

Task completed (slapd exit code: 0).

3) Check that imported data is searchable in ldap

ldapsearch -x -LLL -D"cn=Directory Manager" -h localhost -bdc=example,dc=com ou=people


4) Delete one entry

Create one ldif file named "del.ldif" with following contents

uid=jvedder, ou=People, dc=example,dc=com

Delete the entry from ldap using following command

ldapdelete -D"cn=Directory Manager" -h localhost -w mypassword -f /del.ldif

5) Add back the same entry

Create one ldif file named "add.ldif" with following contents.

dn: uid=jvedder, ou=People, dc=example,dc=com
cn: Jeff Vedder
sn: Vedder
givenName: Jeff
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
ou: Product Development
ou: People
l: Santa Clara
uid: jvedder
mail: jvedder@example.com
telephoneNumber: +1 408 555 4668
facsimileTelephoneNumber: +1 408 555 0111
roomNumber: 3445
userPassword: {SSHA}Lmxn/WEuu7DcSl7SUEj+ZXQKFQD2H2BWTx+fDg==


Add the new ldap entry using following command.

ldapadd -D"cn=Directory Manager" -h localhost -w mypassword -f /add.ldif

adding new entry uid=jvedder, ou=People, dc=example,dc=com

Labels: ,