Log in as the user and group under which Calendar Server is running, such as icsuser and icsgroup, or as superuser (root).
Stop Calendar Server, if necessary.
Backup your corrupted database using a utility such as csbackup, the Sun StorEdge Enterprise BackupTM software, or Legato Networker®.
For more information refer to Chapter 17, Backing Up and Restoring Calendar Server Data.
Dump each corrupted database file using the db_dump utility.
The database files are ics50calprops.db, ics50journals.db, ics50alarms.db, ics50events.db, ics50todos.db, and ics50gse.db.
Run db_dump using the following options, in order, until your database is recovered (or until you determine that the database can’t be recovered):
No options for minor database corruption.
-R option for moderate database corruption.
-R option for severe database corruption. The -R option dumps more data than the -r option, including partial and deleted records, from the corrupted database.
For example, to run db_dump with the -r option:
db_dump -r ics50events.db \> ics50events.db.txt
Load the output file into a new database file using the db_load utility.
db_load new.ics50events.db < ics50events.db.txt
If db_load reports an odd number of keys or data entries, edit the db_dump output file, and remove the odd key or data entries. Then run db_load again.
Repeat the previous two steps for the other corrupted database files.
That is, run db_dump for the other corrupted database files.
Rebuild the recovered database files using the csdb rebuild command, as described in 22.5.6 Rebuilding a Corrupted Calendar Database.
When rebuild has finished, review the output in the output file. If the rebuild was successful, the last line in the rebuild.out file should be:
Calendar database has been rebuilt
If the csdb rebuild command was not successful, dump your database using the next db_dump option (-r or -R).
If the db_dump -R option does not recover your corrupted database, contact your Sun Microsystems technical support or sales account representative for assistance. In the meantime, you might need to revert to the last good backup of your database.