Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to delete entries in LDAP

Status
Not open for further replies.

thendal

Programmer
Aug 23, 2000
284
Hi all, I have more than 10,000 entries under ou=people, i like to reload the data what is the best way to delete all the entries any advise will be appreciated.

Thank you.
 
You can use phpldapadmin - VERY GOOD TOOL FOR IT!!!

 
10,000 is quite a few to iterate through - remembering especially that this could lead to a prolonged performance degradation. Depending on what directory server you are using, it is sometimes more efficient to reimport the ldif without the 10,000 people.

-Chris Larivee
 
Chris, Used LDIF method

used the following command line to grep all the dn under ou=people

ldapsearch -b"ou=people,dc=site,dc=edu" "objectclass=*" dn > delete_dn.ldif

then using perl script added "changetype: delete" once modified delete_dn.ldif reimported into the directory. I am using sunone directory server.

Could you please give me more information on how this will lead to prolonged performace degradation. What can i do to avoid it.

Thank you very much.


 
Prolonged meaning that it probably took a bit of time to process all those deletes (not ongoing performance issues) - and that if the directory services a lot of requests it can slow overall performance for end users or applications.

Since it's done now you have NO worries

The alternative way that is used is to use the ldif2db import tool with an ldif that contains everything in your namespace minus the ou=people entry. This would have caused a long list of complaints on import about the parent of ou=people not being present for the 10,000 users under the ou, but might have been quicker overall (but it would require server downtime - which is sometimes equally unattractive).

Either method works - but the best method really depends on the total number of entries you have in your entire namespace, how many you want to delete, and whether you have tuned your configuration to process the imports.

-Chris Larivee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top