Backup - DB2

Topics | How To | Related Topics


Overview

Supported Backup Types

DB2 Backup Jobs

Backup Considerations

Command Line Backups

Third Party Command Line Backups

Advanced Backup Options


Overview

Plan your backup jobs for this agent by reviewing the following information:


Supported Backup Types

This agent supports the following backup types:


DB2 Backup Jobs

This agent has the following unique functionality.

Delta Backups

For the DB2 iDataAgent, Delta backup works as described in Incremental Backups. See Incremental Backups for information on DB2 Delta backups.

Backup Arguments

Some database iDataAgents run backups using a system-generated script that is run behind the scenes from a command line. The CommCell Console serves as a front-end user interface for specifying various backup arguments and parameters that are passed to the backup script that is run. Depending on your agent, you can specify, for example, the application-specific Backup Level, whether the backups will be online or offline, as well as buffer and bundle sizes, among other settings. Although the backup arguments/parameters vary among iDataAgents, they all function in a similar manner. These arguments are set at the subclient level from the respective iDataAgent's Subclient Properties dialog box tab.

For step-by-step instructions, see Configure Backup Arguments.

Enable Database Configuration Parameters for DB2 Backups

Each DB2 database has its own configuration. To back up DB2 data successfully, you must enable the appropriate database configuration parameter(s). You must set these parameters based on the state of the database, backup type, and/or data type as follows:

Before you change any configuration parameter, ensure that no applications are currently using the affected database. Also, be sure to consult your database administrator regarding business requirements for the database.

 


Backup Considerations

Before performing any backup procedures for this agent, review the following information:


Command Line Backups

You can perform backups of one or more DB2 databases from the command line interface.

Command line backups enable you to perform backup operation on multiple clients simultaneously. In order to run the backups from command line, you need an input xml file which contains the parameters for configuring the backup options. This input xml file can be obtained from one of the following ways:

Log on to the Commserve

To run command line operations you must first login to the CommServe as follows:

Perform the Backup

Execute the saved .xml script using the following qoperation execute command:

qoperation execute -af qoperation_db2_backup.xml -backupLevel <FULL| INCREMENTAL| DIFFERENTIAL> -subclientName <SubclientName> -clientName <DB2CleintName> -instanceName <DB2InstanceName> -backupsetName <DB2BackupSetName>

Example Using XML File:

qoperation execute -af qoperation_db2_backup.xml -backupLevel FULL -subclientName default -clientName dbserveaix2 -instanceName db2inst5 -backupsetName TESTDB

Example without using XML File:

qoperation backup -c client -a < iDataAgentType> -i <DB2InstanceName> -b <DB2BackupSetName> -s <SubclientName> -t <Q_FULL|Q_INC|Q_DIFF>

./qoperation backup -c dbserveaix2 -a Q_UNIX_DB2 -i db2inst5 -b TESTDB -s default -t Q_FULL

Verify the status of the job using the following command:

qlist job –j JOBID

Once the job completes, logout from the CommServe using the qlogout command.

qlogout [-cs commserver] [-all] [-tf tokenfile] [-tk token] [-h]

Third Party Command Line Backups

Use the following steps to backup the DB2 database:

At the Command Prompt, type the appropriate online/offline backup command for the specific platform.

Examples:

 

Multi Stream Backups

DB2 third party command line backups running on multiple streams will generate separate job ids for each stream.

From the DB2 command prompt, type the following backup command.

Example:

db2 backup database <database_name> online load '<software_install_path>/Base/libDb2Sbt.so' open 3 sessions
db2 backup database <database_name> online load '<software_install_path>\Base\Db2Sbt.dll' open 10 sessions

where <database_name> is the name of the DB2 database and <software_install_path> is the install path for the agent software (e.g., level1/install).