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.
To perform a partial backup of your JE databases, simply copy all log files (*.jdb files) from your environment directory to your archival location or backup media. You do not have to stop any database operations in order to do this.
Note that if your application is not using transactions, then any modifications made to the database since the time of the last environment sync are not guaranteed to be contained in these log files. In this case, you may want to consider running a complete backup in order to guarantee the availability of all modifications made to your database.
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:
Stop writing your databases. If you are using transactions, commit or abort all on-going transactions.
If you are not using transactions, run Environment.sync() so as to ensure that all database modifications are written to disk.
If you are using transactions, then optionally run a checkpoint. Doing this can shorten the time required to restore your database from this back up.
Copy all log files (*.jdb) from your environment directory to your archival location or backup media.
You can now resume normal database operations.