SEP sesam Extension for DB2
From SEPsesam
SEP sesam Extension for IBM DB2
(C)SEP AG
Copyright 1999-2009 by SEP AG. All Rights reserved.
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.
Contents |
Introduction
SEP sesam online backup for IBM DB2 (sdb2) provides a XBSA interface between DB2 and SEP sesam for saving data of DB2 databases to sesam server. XBSA API specifies the access from DB2 db2 backup utility to a backup application. SEPsesam will manage the whole backup media handling like loading the correct tapes, whereas db2 backup decides which data has to be saved or recovered. This document provides information about the sesam specific parts of DB2 backups. It's not a DB2 backup adminstration guide. Please read DB2 administration documentation to get familiar with DB2's backup and recovery concepts and tools.
System requirements
- IBM DB2 7/8 on Linux
- SEP sesam v2.4
- the standard Sesam Backup Client is already installed
- working SEP sesam file system backups for this client
Installation
The SEPsesam DB2 packet includes only one shared library which DB2 server loads dynamically during backup or restore. Please adjust the pathes and variables according to your needs.
- <SESAM ROOT>/opt/sesam/bin/sesam (Sesam installation directory)
Installation on Linux or Unix
- First verify that the standard Sesam Backup Client is already installed
- File system backup should work with this sesam client
- Login as root user
- Unpack tar file to a temporary directory
- Copy db2xbsa.so to <SESAM ROOT>/bin/sesam directory
root@linux:~# cd /tmp root@linux:/tmp # tar xvzf sesam-db2-2.4.1-14_linux.i386.tgz sesam-db2-2.4.1-14/ sesam-db2-2.4.1-14/db2xbsa.so sesam-db2-2.4.1-14/sesam-db2.pdf root@linux:/tmp # cd sesam-db2-2.4.1-14/ root@linux:/tmp/sesam-db2-2.4.1-14 # cp db2xbsa.so /opt/sesam/bin/sesam
Configuration
Configuration on sesam server
Create a new backup task for the DB2 server with task type DB2 UDB. For backup source you can specify whatever you want, bcs. DB2 decides which data has to be saved.
Configuration on DB2 server
To give DB2 the necessary information to connect to SEPsesam, the following options can be set:
Mandatory parameters
- SESAM SERVER Name of SEPsesam server
- SESAM JOB Jobname of DB2 backup Name of an already configured task on sesam server with task type DB2 UDB
- SESAM POOL Media pool name Name of an already configured media pool on sesam server
Optional parameters
- SESAM TAPE SERVER Name of tapeserver to use
- SESAM DRIVE Drive number to use
- XBSA TRACE=<Trace level> ( 0|1|2 )
- XBSA LOGFILE=<Full pathname of trace file sdb2.log>
Although XBSA TRACE and XBSA LOGFILE are not mandantory, they should be set to get information in case of problems during backup or restore. For restore only SESAM SERVER and SESAM JOB are mandantory.
DB2 Backup and Restore Configuration
The following examples are showing, how backup or restores can be started on DB2 server. They do not cover all functions of DB2, but should give some hints for using DB2 backup and SEP sesam together.
Backup of complete database
db2inst@linux:~>db2 BACKUP DATABASE sample_db ONLINE \
LOAD /opt/sesam/bin/sesam/db2xbsa.so \
OPTIONS 'SESAM_SERVER=midrangix;SESAM_JOB=db2_sample_db; \
SESAM_POOL=DISK;XBSA_LOGFILE=/home/db2inst1/sdb2.log; \
XBSA_TRACE=1' INCLUDE LOGS WITHOUT PROMPTING;
Restore of complete database
db2inst@linux:~>db2 RESTORE DATABASE sample_db \
LOAD /opt/sesam/bin/sesam/db2xbsa.so \
OPTIONS 'SESAM_SERVER=midrangix;SESAM_JOB=abas_db2_2; \
XBSA_LOGFILE=/home/db2inst1/sdb2.log;XBSA_TRACE=1' \
TAKEN AT 20060113134350 TO "/tmp/db2restore" INTO sample_db2
Install into DB2 default library directory
Instead of copying shared library into 'SESAM ROOT/bin/sesam' directory and specifying the path by the 'LOAD' command, you can put it into DB2 library directory on the DB2 server too. Please adjust the pathes and variables according to your needs.
- DB2DIR=/opt/IBM/db2/V8.1 (the DB2 product directory)
root@linux:~# cd /tmp/sesam-db2-2.4.1-14 root@linux:/tmp/sesam-db2-2.4.1-14 # cp db2xbsa.so /opt/IBM/db2/V8.1/lib
Then the db2 backup command has to be changed slightly. The 'LOAD' parameter is replaced by 'USE XBSA'.
db2inst@linux:~>db2 BACKUP DATABASE sample_db ONLINE USE XBSA \
OPTIONS 'SESAM_SERVER=midrangix;SESAM_JOB=db2_sample_db; \
SESAM_POOL=DISK;XBSA_LOGFILE=/home/db2inst1/sdb2.log; \
XBSA_TRACE=1' INCLUDE LOGS WITHOUT PROMPTING;
Trouble shooting
- Check contents of db user's $HOME/sqllib/db2dump/db2diag.log file.
- Check the messages on SEPsesam server.
- More information can be found in the sdb2 logfile. Logfile name is set by XBSA LOGFILE=<Full pathname of sdb2.log> and loglevel by XBSA TRACE=1. All sesam XBSA messages have the prefix XBSA. For more information XBSA TRACE can be set to 2, but then the logfiles can become quite large.
Further Links/Literature
- SEP sesam Extension for DB2
- SEP sesam IBM DB2 Administration Guide
- Data Recovery and High Availability Guide Reference
- System Management: Backup Services API (XBSA)
- Backup Services Application Programmer's Interface
