Loading...

Advanced Backup - DB2 iDataAgent

Table of Contents

Full Backups

You can use this procedure to back up the entire database and the control file. Backups of online databases also include the log file.

Tip: After you install the DB2 Agent, perform a full back to verify the configuration.

A full backup is the most comprehensive backup and is the baseline for incremental backups.

Procedure

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance > backup_set.
  2. Right-click the subclient and click Backup.
  3. On the Backup Options for Subclient dialog box, select the backup type and job initiation:
    1. In the Backup Type section, select Full.
    2. In the Job Initiation section, specify whether to run the backup now or if it will be scheduled.

      Note: If you selected Schedule, set up the schedule.

      For information on configuring a backup schedule, see Schedule Backups.

  4. Click OK to close the Backup Options dialog box.

Incremental Backups

A DB2 incremental backup contains only the data that is new or has changed since the last full backup. On average, incremental backups consume less media and use less resources than full backups.

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance > backup_set.
  2. Right-click the subclient and click Backup.
  3. On the Backup Options for Subclient dialog box, select the backup type and job initiation:
    1. In the Backup Type section, select Incremental.
    2. In the Job Initiation section, specify whether to run the backup now or if it will be scheduled.

      Note: If you selected Schedule, set up the schedule.

      For information on configuring a backup schedule, see Schedule Backups.

  4. Click OK to close the Backup Options dialog box.

Differential or Delta Backups

A DB2 differential/delta backup contains only data that is new or has changed since the last backup (full, incremental, or delta), regardless of the type. On average, DB2 differential/delta backups consume less media and use less resources than full backups.

If you want to have a differential backup that only contains the data, create a subclient for data only backups.

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance > backup_set.
  2. Right-click the subclient and click Backup.
  3. On the Backup Options for Subclient dialog box, select the backup type and job initiation:
    1. In the Backup Type section, select Differential/Delta/Data Only.
    2. In the Job Initiation section, specify whether to run the backup now or if it will be scheduled.

      Note: If you selected Schedule, set up the schedule.

      For information on configuring a backup schedule, see Schedule Backups.

  4. Click OK to close the Backup Options dialog box.

Log Backups

Use log backups in the following scenarios.

  • To restore the database to the most recent state after a database failure.
  • To restore specific logs, which are identified using a serial number or identification tag that are missing in the database.
  • To restore logs from a specific time range that were lost due to a hard disk corruption. Use a point-in-time archive log restore.

You can also configure an archive log subclient, or include the archive logs as part of an offline subclient.

Before You Begin

Create a log subclient

Procedure

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance > backup_set.
  2. Right-click the subclient and click Backup.
  3. On the Backup Options for Subclient dialog box, select the backup type and job initiation:
    1. In the Backup Type section, select the Full option.
    2. In the Job Initiation section, choose to run the backup now or schedule it.

      Note: If you selected Schedule, set up the schedule.

      For information on configuring a backup schedule, see Schedule Backups.

  4. Click OK to close the Backup Options dialog box.

Table Level Backups

Use the following to back up DB2 tables.

  1. Configure DB2 Subclients for Table Level Restores.
  2. Perform a full backup of the subclient.

Offline Backup for Restoring a Non-Recoverable Database

DB2 supports backup and restore of an non-recoverable database.

Follow these steps.

  1. Disable the DB2 archive logs by setting the LOGREATAIN and LOGARCHMETH1 parameters to off.  See Configuring DB2 Database parameters ( Db2_config.sh/Db2_config.ps1 are not applicable for configuring non-recoverable databases.
  2. Configure this database on the CommCell.  Use either the default subclient or create a new subclient.  The subclient must be offline and data only subclient.
  3. Run a full backup.

Performing an Offline Backup of a Standby Database

If you created a standby database by using the DB2 db2inidb command and the database is in a rollforward pending state and you have not applied logs, you must set the sSTANDBYBKUP additional setting to Y so that you can take an offline backup of the standby database.

Note: You cannot perform an offline backup for a HADR standby database if you apply the archive logs and leave the database in rollforward pending stage.

Procedure

  1. Enable the offline backup of a standby database
  2. Configure this database on the CommCell Console.  The subclient must be offline subclient.
  3. Run a full backup.

Application Command Line Backups

You can specify the media parameters in a file. For information on specifying the media parameter file, see Specifying the Media Parameters for DB2 Command Line Operations.

Optional: To have the CommCell Console authenticate the job, configure the parameters for CommCell Console third-party job authentication.

Retention Rules for Command Line Full Backups

DB2 command line full backups are pruned based on the number of retention days.

Incremental backups performed through the CommCell Console after the command line full backup are kept, but will be orphaned when the command line full backup is aged. The DB2 history file has a record for the  incremental backups performed through the CommCell Console which depend on the command line full but the database is not recoverable from the incremental.

Command line jobs and  incremental backups performed through the CommCell Console must not be combined on the same database because they will not be recoverable.

Online Backups

Backup operations can also be performed from the application command line using the DB2 command prompt. In order to perform an application command line online backup, you must configure a backup set.

Use the following steps to perform online backups from the application command line:

On a 32-Bit or 64-Bit Windows Platform:

Run the online backup command from the DB2 command prompt:

db2 backup db <database_name> online load '<software_install_path>\Base\Db2Sbt.dll'

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).

On a 32-Bit or 64-Bit UNIX Platform:

Run the online backup command from the DB2 command prompt for a DB2 instance on a 32-bit AIX/Solaris or HP-UX or 32bit/64bit Linux or 31bit Linux on System Z:

db2 backup db <database name> load '<software install path>/Base/libDb2Sbt.so'

For a DB2 instance on 64-bit AIX/Solaris/HP PARISC or 64-bit Linux on System Z, replace Base with Base64.

Online Backups with Logs:

Run the following online backup command from the DB2 command prompt for online backups with logs:

db2 backup database <db_name> online load '<software install path>/Base/libDb2Sbt.so' include logs

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

Offline Backups

If a backup is run with the database offline, this job has an exclusive connection to the database; therefore, any other access to the database is not allowed while the backup is in progress. An offline backup cannot run if any other applications are already running on the database.

In order to perform a third-party command line offline backup, the backup set must be configured.

Use the following steps to run offline backups from the third-party command line:

From the DB2 command prompt, type the appropriate offline backup command for the specific platform.

Example:

  • For a DB2 instance on a 32-bit AIX/Solaris or HP-UX or 32-bit/64-bit Linux or 31-bit Linux on System Z:

    db2 backup db <database_name> load '<software_install_path>/Base/libDb2Sbt.so'

  • For a DB2 instance on 64-bit AIX/Solaris/HP PARISC or 64-bit Linux on System Z:

    db2 backup db <database_name> load '<software_install_path>/Base64/libDb2Sbt.so'

  • For a DB2 instance on a 32-bit/64-bit Windows platform:

    db2 backup db <database_name> load '<software_install_path>\Base\Db2Sbt.dll'

    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).

Delta or Incremental Backups

Use the following steps to run delta/incremental backups from the third-party command line:

db2 backup db <database_name> incremental [delta] load '<software_install_path>\Base\Db2Sbt.dll'

The incremental is for incremental backup; the incremental delta is for delta backup.

Performing Multi-Stream Backups

DB2 third party command line backups running on multiple streams will share a single Job ID in the Job Manager.

Use the following steps to run multi stream backups from the third party command line:

From the DB2 command prompt, type the backup command.

Example:

On UNIX Client:

db2 backup database database_name online load 'software_install_path/Base/libDb2Sbt.so' open <num_backup_sessions> sessions

On Windows Client:

db2 backup database <database_name> online load 'software_install_path\Base\Db2Sbt.dll' open <num_backup_sessions> sessions

where:

<database_name> is the name of the DB2 database

<software_install_path> is the install path for the agent software (e.g., level1/install

<num_backup_sessions> is the number of open sessions to use for the backup

For a DB2 instance on 64-bit AIX/Solaris/HP PARISC or 64-bit Linux on System Z, replace Base with Base64.