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 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 command line interface,
set each of the following database configuration parameters to ON:
- AUTO_MAINT
- AUTO_DB_BACKUP
- 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.