The DB2 Express C datastore in Trove lacks backup and restore functionality at the moment. This blueprint aims at adding the feature of backup and restore to DB2 in Trove.
Launchpad Blueprint: https://blueprints.launchpad.net/trove/+spec/db2-backup-restore
Currently, there is no way to create backups of DB2 databases using Trove nor is it possible to perform a restore from a backup. Since this functionality is core to a data model and typical use case, it is imperative for Trove to add it.
The simplest form of database backup and restore will be implemented for DB2 creating a backup image in a default location. Since by default, DB2 databases are in a circular logging mode, it isn’t possible to take an online backup. Therefore a full offline backup functionality will be implemented by this feature  . At this time, incremental backups for db2 will not be supported. The LIST UTILITIES command will be used to monitor the process. 
The backup procedure for DB2 will follow a process as below. 
Since db2 only supports streaming to named pipes, the backup cannot be performed in a single step and will first need to store the backup file on the VM. 
In order to restore a DB2 database from backup, the following procedure will be followed. 
The default configuration values of the following will need to change to correspond to the respective DB2 locations.
The implmentation of the DB2 backup and restore functionality will allow users to use several CLI commands for the DB2 datastore.
The following commands will be functional for DB2
The DB2 guest agent will be modified to support backup and restore. In particular the following files will have added components-
The following existing files will be updated:
It will be backwards compatible with API and Task Manager.
The other type of backup that can be implmented is online backup so the database won’t need to shut down before taking backups. However, for online backups to be implemented, the database must have archive logging options. At this time it is not possible to specify logging options for DB2 databases in Trove. Once users can configure other logging options like archive logging, online backup can be implemented.
TBD (section added after approval)
Target Milestone for completion:
Unit tests will be added as necessary for the backup and restore functionality. Also, a db2 helper will be added to the existing int-test framework.
The DB2 Trove documentation should be updated to indicate that backup and restore is supported.
|||Offline Backup: http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.admin.ha.doc/doc/c0051343.html|
|||Monitoring Backup: http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.admin.ha.doc/doc/t0060260.html|
|||DB2 Backup procedure: http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.admin.ha.doc/doc/c0006150.html|
|||DB2 backing up to named pipe: https://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.5.0/com.ibm.db2.luw.admin.ha.doc/doc/t0006202.html|
|||DB2 Restore procedure: http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.admin.ha.doc/doc/c0006237.html|