Restoring the OKS database

If your system crashes or if the OKS database server hasn't been properly shutted down, the OKS database can be corrupted. In such situations you will need to restore your database from you backup.

To restore your database files, first extract them from your backup archive. You can do this via the following commands:

# cd /usr/local/oks/var/db
# gunzip /mnt/backup/oksdb.tar.gz
# tar xf /mnt/backup/oksdb.tar

Then, use the database recovery tool to restore the database to its state before the crash with the aid of your database recovery files:

# cd /usr/local/oks/bin
# ./oksdb_recover sample /usr/local/oks/var/db /mnt/backup

The oksdb_recover tool  searches for recovery files of a database sample in the /mnt/backup directory and apply them to the database sample located in the /usr/local/oks/var/db directory.

It is necessary to shutdown the OKS database server before recovering its database.