Performing Backups

This section describes how to backup your JE database(s) such that catastrophic recovery is possible.

To backup your database, you can either take a complete backup or a partial backup. A partial backup is performed while database write operations are in progress.

Do not confuse complete and partial backups with the concept of a full and incremental backup. Both a complete and a partial backup are full backups – you back up the entire database. The only difference between them is how much of the contents of the in-memory cache are contained in them. On the other hand, an incremental backup is a backup of just those log files modified or created since the time of the last backup. Most backup software is capable of performing both full and incremental backups for you.

Performing a Partial Backup

To perform a partial backup of your JE databases, copy all log files (*.jdb files) from your environment directory to your archival location or backup media. The files must be copied in alphabetical order (numerical in effect). You do not have to stop any database operations in order to do this.

Performing a Complete Backup

A complete backup guarantees that you have captured the database in its entirety, including all contents of your in-memory cache, at the moment that the backup was taken. To do this, you must make sure that no write operations are in progress and all database modifications have been written to your log files on disk. To obtain a complete backup:

  1. Stop writing your databases.

  2. Make sure all your in-memory changes have been flushed to disk. How you do this depends on the type of transactions that you are using:

    • If you are using transactions that writes all dirty data to disk on commit (this is the default behavior), you simply need to make sure all on-going transactions are committed or aborted.

    • If you are using transactions that do not synchronously write on commit, you must run a checkpoint. Remember that closing your environment causes a checkpoint to be run, so if your application is shutting down completely before taking the backup, you have met this requirement.

      For information on changing the transactional sync behavior, see Non-Durable Transactions. For information on running a checkpoint, see Checkpoints.

  3. If you are using durable transactions, then optionally run a checkpoint. Doing this can shorten the time required to restore your database from this back up.

  4. Copy all log files (*.jdb) from your environment directory to your archival location or backup media.

You can now resume normal database operations.