Database Archives and Restore from Archives

DataCaster provides tools for on-demand archive (dump) and restore. This can be used with any of WebAdmin, command-line console or command-line tool. Please check the documentation of each of these tools for more information.

DataCaster allows administrators to setup automatic periodic archives of individual databases, so that recent data can be recovered in case of disk and other major failures.

Such archives can also be generated at any time on-demand.

Automatic archives can be controlled using the following parameters

    < entry key="db.enable_archive" value="true" />
    < entry key="db.archive_start_time" value="23:00" />
    < entry key="db.archive_interval" value="24:00" />
    < entry key="db.archive_dir" value="" />

The first three are template parameters while the last one is a dbprefs parameter.

db.archive_start_time is the time of day when the dump is scheduled for. This should be in HH:mm format.

db.archive_interval is the interval between successive dumps. This is also specified in HH:mm format. You can even specify a large interval say 168:00 that dumps once every week.

db.archive_dir is the directory path where you want to store the archives. It is recommended that this be on a different drive from the one where data is stored so that there is lesser chance of archive getting corrupted along with data. If the value is left blank, then the default directory called 'archives' is created under the user's home directory.

db.enable_archive is used to start or stop the timer that does the periodic dump. If its value is set to true, then the timer is scheduled to do a dump periodically starting at the time specified in db.archive_start_time with an interval specified in db.archive_interval.

This timer is scheduled on database start up. When the database is running and these parameters need to be changed, then you can use the tools provided by WebAdmin for this purpose. You can start or stop the archive timer, or modify the start_time and interval for the timer.

WebAdmin provides tools for on-demand dump and restore too. On-demand dump can be generated at any time of day and does not interfere with the timer. The dump is stored as a zipped file in the archive dir(db.archive_dir)

It can be restored by the tool. Restoring from an archive deletes the current data and gets the data from the archive file. For this purpose, the day and time of every dump is noted so that the required copy of the database can be restored. Webadmin displays the available archives for a particular database. You can pick amongst them. Or alternatively you can give a date or month or year, and the latest archive for that particular time period is restored. When an exact time (ie date and time) is specified, it returns the exact match if found, else, it returns the archive taken earliest to that. This is so that we can restore that dump and apply the logs (from log archive) upto that specified time. (Log archive is yet to be done) The date and time to be specified should be in YY-MM-DD-HHmm format to the required degree.

Archive control for specific databases:

The db.archive_dir is set in dbprefs.xml and applies to all databases. The other parameters are database template properties set in conf/db/templates/database directory. If set in default.tpl they apply to all databases. If you want to set values for particular databases then you can do so by setting the values to the required parameters in the template file for that particular database(named as dbname.tpl). These values will override the ones in default.tpl