A database can become unusable due to a wide variety of
hardware or software failures. Ensuring that you have a recent, full
backup of your database is an integral part of planning and implementing
a disaster recovery strategy for your system. Use automatic database
backup as part of your disaster recovery strategy to enable DB2® to back up your database both
properly and regularly.
About this task
You can configure automatic backup using the graphical user
interface tools, the command line interface, or the AUTOMAINT_SET_POLICY
system stored procedure. You also need to enable the health indicator
db.db_backup_req, which by default is enabled. Note that only an active
database is considered for the evaluation.
Procedure
- To configure automatic backup using the graphical user
interface tools:
Open the Global Health Indicator Configuration window from
the Health Center by right-clicking on a database object and clicking Health
Indicator Configuration > Global/Object. In this window,
you can enable the health indicator db.db_backup_req.
Open the Configure Automatic Maintenance wizard from the Control
Center by right-clicking on a database object. Within this wizard,
you can configure the automatic backup policy and the maintenance
window policy settings.
- To configure automatic backup using the command line interface,
set each of the following configuration parameters to ON:
AUTO_MAINT
AUTO_DB_BACKUP
To enable the health indicator db.db_backup_req,
issue the following command:
db2 update alert configuration for database on database-alias
using db.db_backup_req set THRESHOLDSCHECKED YES
- To configure automatic backup usingIBM® Data Studio,
right-click the database and select the task assistant to configure
automatic backup.
- To configure automatic backup using the AUTOMAINT_SET_POLICY
system stored procedure:
-
Create configuration XML input specifying details like backup
media, whether the backup should be online or offline, and frequency
of the backup.
You can copy the contents of the sample file
called DB2DefaultAutoBackupPolicy.xml in the SQLLIB/samples/automaintcfg directory
and modify the XML to satisfy your configuration requirements.
Optional: create an XML input file containing your configuration
XML input.
Call AUTOMAINT_SET_POLICY with the following parameters:
- maintenance type: AutoBackup
- configuration XML input: either a BLOB containing your configuration
XML input text; or the name of the file containing your configuration
XML input.
See the topic Configuring an automated maintenance policy using SYSPROC.AUTOMAINT_SET_POLICY or SYSPROC.AUTOMAINT_SET_POLICYFILE for more
information about using the AUTOMAINT_SET_POLICY system stored procedure.