4 4 3:DB2 Backup

Any form of reproduction of the contents or parts of this manual is allowed only with the express written permission from SEP AG. When compiling and designing user documentation SEP AG uses great diligence and attempts to deliver accurate and correct information. However, SEP AG cannot issue a guarantee for the contents of this manual.

The procedures and features explained herein provide only information about the SEP sesam-specific parts of DB2 backup. For detailed information on DB2-specific backup and recovery, refer to DB2 administration guide.

SEP sesam online backup for IBM DB2 Universal Database (UDB) integrates with the XBSA interface of DB2 and
backs up data of DB2 databases to SEP sesam Server. The XBSA API manages the access from DB2 backup utility to SEP sesam to coordinate a backup of the database. SEP sesam provides a shared library db2xbsa, which is loaded by DB2 to access SEP sesam backup and restore APIs.

The backup and restore processes, including managing storage media, are managed by SEP sesam, while DB2 API decides which data have to be backed up or recovered.

Before proceeding, you should validate that you can backup to SEP sesam. Run a test Path backup manually to ensure that the backups work. For details on typical backup configuration, see Standard Backup Procedure.

Installing SEP sesam DB2 module on IBM AIX

Before downloading the DB2 module for IBM AIX, verify that SEP sesam Client is installed and added to SEP sesam environment, and make sure that the Path backup is successful, as described in previous section.

Deploying shared library db2xbsa

The SEP sesam DB2 package includes a shared library which DB2 server loads dynamically during backup or restore.

There are two ways in which you can use the db2xbsa.so/db2xbsa.dll library. You can either use the file located in <SESAM_ROOT>/bin/sesam directory or copy it to DB2 default library directory on the DB2 server. Note that the db2 backup command will be different depending on which method you use for shared library deployment.

Copying shared library db2xbsa into DB2 default library directory

Instead of using the shared library from the <SESAM_ROOT>/bin/sesam directory and specifying the path by the LOAD command, you can put it into the DB2 library directory on the DB2 server.

The used db2 backup command will be slightly different; instead of LOAD the USE XBSA command will be used. For details, see section Starting DB2 database backup.

Configuring DB2 backup

For DB2 backups, SEP sesam Server acts as a media manager. It handles media and provides scheduling, media management and monitoring for DB2 backups and restores. DB2 is responsible for the source – what is going to be backed up.

Creating a backup task with task type DB2 UDB on SEP sesam Server

Use the SEP sesam GUI to configure the DB2 backup tasks. You have to create a separate backup task for each DB2 database you want to back up.

From Main Selection -> Tasks -> By clients, select DB2 client and click New backup task. The New backup task window opens.

Specify the Source; since you have to create a separate backup task for each DB2 database you want to back up, the source must be specified accordingly, e.g., specify a database SAMPLE for the backup task DB2_SAMPLE, and database PROD for a task DB2_PROD, etc.

Click OK to create the task.

Create a new command event for scheduling the DB2 backup (and, if necessary, set permission to execute commands). You can insert the backup start command into a script on the DB2 server and then trigger the script by SEP sesam command event. For details, see Creating a Command Event.

Configuration on DB2 server

DB2 provides the ability to perform online backups, allowing applications to use the database while backups are being taken. To enable this, you need to provide SEP sesam information to DB2 and configure specific DB2 database configuration parameters.

SEP sesam parameters for DB2

First, you have to provide DB2 the following relevant parameters to connect to SEP sesam Server. Edit the db2.conf file to provide information about the database, the policy and schedule which will be used.

Some of the parameters are optional, but even though the XBSA_TRACE and XBSA_LOGFILE are not mandatory, they should be set to provide information in case of problems during backup or restore.

DB2 configuration parameters

Before you modify the DB2 database configuration parameters, make sure that no applications are currently using the DB2 database.

In order to enable online backups, you have to enable archive logging for DB2. By default, circular logging is enabled after creating a database; it only allows to take offline backups. To enable archive logging, you need to modify the LOGARCHMETH1 database configuration parameter. Archive logging also allows to restore a database from a backup image and roll forward to a particular point using logs thus getting it to a consistent state.

LOGARCHMETH1 parameter is used to archive and handle the DB2 database log files. Values are OFF, RETAIN, USEREXIT, DISK, TSM, and VENDOR. The latter must be set to specify that a vendor library – in case of SEP sesam db2xbsa.so or db2xbsa.dll – is used to archive the log files. The value must be followed by a colon(:) and the shared library name db2xbsa.so/db2xbsa.dll.

The update to set parameters takes effect during the next log file archive.

Once you set the above parameters, you have to perform one offline backup before any connections can be made to the DB2 database (DB2 goes into a backup pending state when this parameter is enabled); therefore no users can be connected. After that you can run scheduled online backups.

TRACKMOD – incremental backup

Additionally, you can set the TRACKMOD to enable incremental backups. When set to ON, the DB2 database manager will track database modifications and enable SEP sesam to detect which subsets of the database pages must be examined by an incremental backup. For more information on TRACKMOD parameter, see IBM trackmod documentation.

To enable incremental backups, enter the following from the DB2 console:

db2 update db cfg for <database name> using TRACKMOD on

For example:

db2 update db cfg for <database name> using TRACKMOD on

After you set the TRACKMOD, you must run a full offline database backup to update the parameter and enable incremental backups. Without a full offline backup the TRACKMOD parameter will not take effect.

Starting database backup

You can use a command event for scheduling the DB2 backup. Create a script with the backup start command on the DB2 server and then trigger the script by SEP sesam command event. For details, see Creating a Command Event.

If the db2xbsa library is located in the <SESAM_ROOT>/bin/sesam directory, use the LOAD command together with specified library path: