DB2 Application Command Line Backups

You can specify the media parameters in a file. For information about 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

Windows

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

UNIX

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> online 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 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

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.

  • 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

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.

Multi-Stream

Windows

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.

The following is the example command for multi-stream backup on a Windows computer:

db2 backup db pmidb online load 'C:\Program Files\Commvault\ContentStore\Base\Db2Sbt.dll' open 4 sessions with 8 BUFFERS BUFFER 16384 PARALLELISM 8 include logs without prompting

UNIX

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

The following is the example command for multi-stream backup on a Unix computer:

db2 backup db pmidb online load '/opt/commvault/Base/libDb2Sbt.so' open 4 sessions with 8 BUFFERS BUFFER 16384 PARALLELISM 8 include logs without prompting

Loading...