When you store important information in a Freeze database environment, you should consider regularly backing up the database environment.
There are two forms of backups: cold backups, where you just copy your database environment directory while no application is using these files (very straightforward), and hot backups, where you backup a database environment while an application is actively reading and writing data.
In order to perform a hot backup on a Freeze environment, you need to configure this Freeze environment with two non-default settings:
Freeze.DbEnv.envName.OldLogsAutoDelete=0
Freeze.DbEnv.envName.DbPrivate=0
DbPrivate
set to 1, which means only one process at a time can safely access the database environment. When performing hot backups, you need to access this database environment concurrently from various Berkeley DB utilities (such as db_archive
or db_hotbackup
), so you need to set this property to 0.The Freeze/backup
C++ demo in your Ice distribution shows one way to perform such backups and recovery. Please consult the Berkeley DB documentation for further details.