Friday, July 8, 2011

LDAP DataBase Recovery Method

IF the LDAP database got corrupted or showing unclear shutdown, they you can recover it manually using the below method



Stop Ldpa service


#service ldap stop 
or
#service slapd stop


Take the database backup
#tar -cvzf ldap.tar.gz /var/lib/ldap/*


Method 1
Recovery
#/usr/sbin/slapd_db_recover -v -h /var/lib/ldap

Start ldap service
 #service ldap start
or
#service slapd start

Method 2  


If the above method is not recovering the ldap db, then try to re index the database.

#service ldap stop
or
#service slapd stop
#slapindex
#cd /var/lib/ldap
#chown -R ldap.ldap *
#service ldap start
or
#service slapd start