Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Links Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS SQL
Oracle
DB2
MS Access
MySQL
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» Sitemap
Free Newsletters:
DatabaseDaily  
News Via RSS Feed


follow us on Twitter
Database Journal |DBA Support |SQLCourse |SQLCourse2
 

Featured Database Articles

DB2

Posted Feb 27, 2004

DB2 Database and Tivoli Storage Manager - Page 3

By Marin Komadina


UNIX Server Configuration


On the SUN Solaris machine that holds my test database ARTIST, the TSM API client, version 4.2.2.1 has been installed. The TSM API is used to demonstrate the TSM system usage.


# pkginfo -l TIVsmCapi
   PKGINST:  TIVsmCapi
      NAME:  Tivoli Storage Manager 
	     Solaris 2.6/7/8 API Client
  CATEGORY:  application
      ARCH:  sparc
   VERSION:  Version 4 Release 2 Level 2
   BASEDIR:  /opt/tivoli/tsm/client
    VENDOR:  Tivoli Systems Inc.
    PSTAMP:  2002.172.07:58:15
  INSTDATE:  Sep 06 2002 11:31
    STATUS:  completely installed
     FILES:      120 installed pathnames
                  11 directories
                   5 executables
                   2 setuid/setgid executables
               25570 blocks used (approx)
 
>> dsmc
Tivoli Storage Manager
Command Line Backup Client Interface - 
   Version 4, Release 2, Level 2.1 
(C) Copyright IBM Corporation, 1990, 2001, 
   All Rights Reserved.

The TSM client installation results in new entries in the DB2 instance owner profile. New in the profile defined environment variables and their corresponding contents:

Variable Name

Content

DSMI_DIR

path to TSM system options file ( dsm.sys )

DSMI_CONFIG

path to TSM client options file ( dsm.opt )

DSMI_LOG

Path to TSM API error log file ( dsierror.log )

# cat .profile | grep DSMI
 
export DSMI_CONFIG=$HOME/sqllib/tsm/dsm.opt
export DSMI_DIR=$HOME/adsm/api/bin
export DSMI_LOG=$HOME/sqllib/tsm

The unique, server specific TSM system options file dsm.sys has been updated with the following new entries:

# cat dsm.sys 
************************************************************
 SERVERNAME              TESTTSM001
 COMMMETHOD              tcpip
 TCPPORT                 1500
 TCPSERVERADDRESS        localhost
 NODENAME                ARTIST_DB2
 COMMRESTARTDURATION     10
 COMPRESSION             yes
 INCLEXCL                /opt/tivoli/tsm/client/ba/bin/inclexcl.def
 ERRORLOGNAME            /opt/tivoli/tsm/client/ba/bin/dsmerror.log
 PASSWORDACCESS          generate
 TCPBUFFSIZE             32
 TCPWINDOWSIZE           640
 TXNBYTELIMIT            25600                                                 
 CHANGINGRETRIES         4
 COMMRESTARTDURATION     10
 DIRMC                   DEFAULT

Additionally, the listed INCLEXCL parameter file explains the TSM API configuration:

# cat inclexcl.def 
include         /ARTIST/DB2_BACKUP*.*                          MGMT_BACKUP
include         /ARTIST/NODE0000/S*.LOG                        MGMT_LOGS

The TSM client option file, dsm.opt, one per client on the UNIX machine, has only one entry:

# cat dsm.opt
SERVERNAME              TESTTSM001

The parameter SERVERNAME, given in the client configuration file, is only an alias to the system options file dsm.sys. All necessary configuration entries have been done through the dsm.sys options file.

The final preparation step is the configuration of the database user exit program, db2uext2.cadsm, devoted to TSM usage. This add-on IBM program manages the database archived log files and externalizes them on the TSM server backup media. During a recovery operation, the user exit program retrieves the log files from the TSM server, putting them into the database log path directory.

Some peculiarities of the user exit program:

  • filed but still active database log file is opened in read only mode and archived by the user exit program, and remains in the log path directory until the transaction ends
  • archived log files are renamed and reused--the user exit program never deletes them
  • following database deactivation, the last active log file (full or partially filled) is closed and via the user exit program saved to the TSM
  • all log files are truncated before archiving, in free unused log space

IBM suggests using the user exit program that comes with database installations. Nevertheless, the customer has the choice to use his own exit program in the same manner. The provided user exit programs need to be compiled and adopted before actual usage.

The procedure for the user exit program arrangements:

artist$ su -
root# cd $HOME/sqlib/adm
root# cp $HOME/sqllib/samples/c/db2uext2.cadsm $HOME/sqllib/adm/db2uext2.c
root# vi db2uext2.c
 
#define ARCHIVE_PATH "/ARTIST/NODE0000"
#define RETRIEVE_PATH "/ARTIST/NODE0000"
#define AUDIT_ERROR_PATH "$HOME/sqllib/tsm"
 
root# exit
artist$ cc_r -o db2uext2 db2uext2.c libApiDs.a

A compiled user exit program is afterwards saved in the /sqllib/adm instance software directory.

Conclusion

It was important to present a real-world example of the TSM infrastructure, which can be used as template for other more complicated configurations. DB2 administrators need to be familiar with the infrastructure so that they can suggest backup improvements or in the case of errors, trace faulty backup execution. Part two of this article will examine DB2 database backup techniques and reveal some little known situations that arise only when using TSM server.

» See All Articles by Columnist Marin Komadina



DB2 Archives

Comment and Contribute

 


(Maximum characters: 1200). You have characters left.