[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: BDB Database problem



On Friday 09 December 2005 15:38, sandeep wrote:
> Hi
>
> My  BDB database have problem  and slapd is not running .
> I had  a power failure before the last reboot.
> is there any way to repair it ?
>
> Your reply is very much important.
>
> see the output:
>
> [root@ncins1 ~]# /usr/sbin/slapd -u ldap -h "ldap:///"; -d 128
> @(#) $OpenLDAP: slapd 2.2.13 (Aug 19 2004 21:22:15) $
>
> root@porky.build.redhat.com:/usr/src/build/440386-i386/BUILD/openldap-2.2.1
>3/openldap-2.2.13/build-servers/servers/slapd bdb_initialize: Sleepycat
> Software: Berkeley DB 4.2.52: (December  3, 2003) bdb_initialize: Sleepycat
> Software: Berkeley DB 4.2.52: (December  3, 2003) bdb_db_init: Initializing
> BDB database


1)For now, recover your database, for example:

db_recover -h /var/lib/ldap

(may be slapd_db_recover in some cases)

Check the permissions on all the files in the directory (chown -R 
ldap:ldap  /var/lib/ldap)

Start the ldap service

2)For the future, either:
a)Upgrade to 2.3 which doesn't/shouldn't need the operations listed below 
(hint: http://anorien.csc.warwick.ac.uk/mirrors/buchan/openldap/ has packages 
which are parallel installable with the original RH packages and affect no 
other aspects of the OS or any packages provided by it)
b)Do some things RH missed out which are necessary on 2.2:
-ensure database recover is run any time that it is likely that slapd has been 
shut down uncleanly. The strategy I prefer is doing database recovery in the 
start() function of the initscript (not restart though).
-ensure the database is checkpointed (run db_checkpoint with appropriate 
options from and as the appropriate user from cron)

Regards,
Buchan

-- 
Buchan Milne
ISP Systems Specialist
B.Eng,RHCE(803004789010797),LPIC-2(LPI000074592)

Attachment: pgpWEvHN8ntRU.pgp
Description: PGP signature