Backup IBM Connections with IBM TSM 7.1

Share

In this post i will describe the steps i follow to backup my IBM Connections 5.0.   The TSM Server and Connections Serve are using Linux.

 Install TSM Client on the IBM Connections Server.

Install gskcrypt and gskssl. Normally, these libraries can be found in an archive with the TSM Client.

#rpm -ivh gskcrypt64-8.0.x.x.linux.x86_64.rpm
#rpm -ivh gskssl64-8.0.x.x.linux.x86_64.rpm
# yum localinstall TIVsm-API64.x86_64.rpm
# yum localinstall TIVsm-BA.x86_64.rpm

TSM Client Configuration.

Add the TSM client service to autostart :

# chkconfig --add dsmcad
# chkconfig dsmcad on

Create the configuration files dsm.sys and dsm.opt.

Copy the files from samples /opt/tivoli/tsm/client/ba/bin/

# cp dsm.opt.smp dsm.opt
# cp dsm.sys.smp dsm.sys

I create some Exclude rules to not backup log files and temporary folders.
All other files of the Connections will be included on the baackup.

The content of my dsm.sys :

Obs: Server name and ip address must match your environment

SErvername  <your tsm server name>
   COMMMethod         TCPip
   TCPPort            1500
   Exclude /.../*.log
   Exclude /.../log/.../*
   Exclude /.../tmp/.../*
   Exclude /.../wstemp/.../*
   Exclude /.../javacore*
   Exclude /.../logs/.../*
   SCHEDLOGRETENTION 7 D
   MAXCMDRETRIES 4
   COMPRESSION YES
   MANAGEDSERVICES WEBCLIENT SCHEDULE
   QUERYSCHEDPERIOD 1
   COMMMethod         TCPip
   TCPPort            1500
   TCPServeraddress   <your tsm server ip address>
   PASSWORDACCESS GENERATE
   NODename Connections

Content of dsm.opt:

SErvername <your tsm server name>

TSM  Policy Domain

Tivoli Storage Manager Policy Management are the important set of rules or instructions to TSM server & database for managing client backups in the server storage. Policies are rules that you set at the IBM Tivoli Storage Manager server to help you manage client data. Policies control how and when client data is stored, how long to be stored and when to expire.
For example:

How and when files are backed up and archived to server storage
How space-managed files are migrated to server storage

The number of copies of a file and the length of time copies are kept in server storage

I created a FILEDOMAIN policy for filesystem backup on my TSM Server with the following commands on TSM console:

define domain FILESDOMAIN
       define policyset FILESDOMAIN FILESPOLICY
       define mgmtclass FILESDOMAIN FILESPOLICY FILESMGMTCLASS
       assign defmgmtclass FILESDOMAIN FILESPOLICY FILESMGMTCLASS
       define copygroup FILESDOMAIN FILESPOLICY FILESMGMTCLASS type=backup dest=backuppool VEREXISTS=5 VERDEL=1 RETEXTRA=3 RETONLY=5
       define copygroup FILESDOMAIN FILESPOLICY FILESMGMTCLASS type=archive dest=archivepool RETVER=8
       validate policyset FILESDOMAIN FILESPOLICY
       activate policyset FILESDOMAIN FILESPOLICY

File retention is key for this configuration.  See more information about this topic at: https://www-304.ibm.com/support/docview.wss?uid=swg21224145

Register the TSM Client

Perform the following steps in the TSM Server’s console, if you haven’t registered the new node yet.

register node CONNECTIONS <password> domain=FILESDOMAIN

Create a client schedule and associate the node

TSM Central scheduling helps automate backup, archive, automatic client updates, and other processes. You can schedule IBM Tivoli Storage Manager operations by using an external scheduler or the built-in Tivoli Storage Manager scheduler. You can configure scheduling through Administrative command line or through TSM Operations Center (GUI).

define schedule FILESDOMAIN WEEKDAY_INCREMENTAL action=Incremental options=-subdir=yes objects='"/opt/ibm/*" "/var/ibm/InstallationManager/*"' DAYofweek=WEEKDay startdate=today starttime=02:30 DURation=3 DURUnits=Minutes

Associate the client with the scheduler

define assoc FILESDOMAIN  WEEKDAY_INCREMENTAL CONNECTIONS

 

Verify the setup

Execute the commands bellow to finish the client configuration and verify the session with server and client schedule:

# dsmc query sessionThe output will be like this

IBM Tivoli Storage Manager
Command Line Backup-Archive Client Interface
  Client Version 7, Release 1, Level 2.0
  Client date/time: 01/11/2016 11:07:26
(c) Copyright by IBM Corporation and other(s) 1990, 2015. All Rights Reserved.Node Name: CONNECTIONS
Session established with server IMPLET: Linux/x86_64
  Server Version 7, Release 1, Level 1.100
  Server date/time: 01/11/2016 11:09:15  Last access: 01/11/2016 10:27:50TSM Server Connection InformationHome Server Name........: <tsm server name>
Server Type.............: Linux/x86_64
Archive Retain Protect..: "No"
Server Version..........: Ver. 7, Rel. 1, Lev. 1.100
Last Access Date........: 01/11/2016 10:27:50
Delete Backup Files.....: "Yes"
Delete Archive Files....: "Yes"
Deduplication...........: "Server Only"Node Name...............: CONNECTIONS
User Name...............: root# dsmc query schedIBM Tivoli Storage Manager
Command Line Backup-Archive Client Interface
  Client Version 7, Release 1, Level 2.0
  Client date/time: 01/11/2016 11:39:13
(c) Copyright by IBM Corporation and other(s) 1990, 2015. All Rights Reserved.Node Name: CONNECTIONS
Session established with server <tsm server name>: Linux/x86_64
  Server Version 7, Release 1, Level 1.100
  Server date/time: 01/11/2016 11:41:03  Last access: 01/11/2016 11:27:52    Schedule Name: WEEKDAY_INCREMENTAL
      Description:
   Schedule Style: Classic
           Action: Incremental
          Options: -subdir=yes
          Objects: "/opt/ibm/*" "/var/ibm/InstallationManager/*"
         Priority: 5
   Next Execution: 14 Hours and 49 Minutes
         Duration: 3 Minutes
           Period: 1 Day  
      Day of Week: Weekday
            Month:
     Day of Month:
    Week of Month:
           Expire: Never

Configure TSM to backup DB2

The Tivoli Storage Manager application programming interface (API) provides a library of functions that allow independent software applications and custom-built applications to back up and archive their data to a Tivoli Storage Manager server. The DB2 DBMS also uses the Tivoli Storage Manager API for backup and restore operations.DB2 provides its own backup utility that can be used to back up data at the table space level or the database level. If you set up this utility to use Tivoli Storage Manager as the backup media, DB2 communicates with the Tivoli Storage Manager API for backup and restore operations. Thus, both the Tivoli Storage Manager API client and backup-archive client work together to provide full data protection for your DB2 environment. The API client and the backup-archive client can run simultaneously on the same DB2 server. The Tivoli Storage Manager server considers them separate clients.

Setup TSM API on DB2 machine

Install gskcrypt and gskssland the TSM API

#rpm -ivh gskcrypt64-8.0.x.x.linux.x86_64.rpm
#rpm -ivh gskssl64-8.0.x.x.linux.x86_64.rpm
#yum localinstall TIVsm-API64.x86_64.rpm

Set the environment variablesSet the following DSMI environment variables in either the operating system shell or the
/home/instance_home_dir/sqllib/userprofile file.
DSMI_DIR
DSMI_CONFIG
DSMI_LOG

Important: The DB2 DBMS reads these environment variables during the DB2 instance startup. If you change the variables, you must restart the
DB2 instance for the changes to take effect.

DSMI_DIR
This variable points to the API installation directory. The dsmtca file, the dsm.sys file, and the language files must be in the directory pointed to by the DSMI_DIR environment variable. Setting the DSMI_DIR variable is optional. If it is not specified, the default directory is /usr/tivoli/tsm/client/api/bin64

DSMI_CONFIG
This variable points to the fully qualified path and file name of the Tivoli Storage Manager dsm.opt client options file. This file contains the name of the server to be used.

DSMI_LOG
This variable points to the directory path where the error log file, dsierror.log, is to be created.

export DSMI_CONFIG=/usr/tivoli/tsm/client/api/bin64/dsm.opt
export DSMI_LOG=/home/db2inst1
export DSMI_DIR=/usr/tivoli/tsm/client/api/bin64

Configure the dsm.sys and dsm.opt and put these files on /usr/tivoli/tsm/client/bin64 and change these files permissions to 775.

You can use the sample from step 3 just exclude the Exlude entries and change the node name.

Log off and log in again as an instance user and run the .profile file.

Restart  the db2 instance.

Register a new Policy Domain for DB2

define domain dbdomain
  define policyset dbdomain dbpolicy
define mgmtclass dbdomain dbpolicy dbmgmtclass
assign defmgmtclass dbdomain dbpolicy dbmgmtclass

define copygroup dbdomain dbpolicy dbmgmtclass type=backup dest=backuppool VEREXISTS=1 VERDEL=0 RETEXTRA=0 RETONLY=0
     validate policyset dbdomain dbpolicy
activate policyset dbdomain dbpolicy

Register the DB2 node

On the TSM Console register the new node:

register node ConnectionsDb2 <password> domain=DBDOMAIN

Set the API user

To access the Tivoli Storage Manager server, client users (called nodes) must have a password to access the server. The DB2 dsmapipw program uses the Tivoli Storage Manager API to create the encrypted password file. The DB2 application includes the dsmapipw utility, which is installed in the /home/instance_home_dir/sqllib/adsm directory.Log in as root user to run the dsmapipw utility. Before you run dsmapipw, you must set the DSMI environment variables similar to that on the DB2 instance.

     # ./dsmapipw

Db2 online backup

On the TSM Server set the following to avoid errors. For detais see this TN http://www-01.ibm.com/support/docview.wss?uid=swg21686874

setopt BackupInitiationRoot no

Update the dabases configuration:

db2 update db cfg using LOGARCHMETH1 TSM (for all IBM Connections databases)

Schedule DB2 backup

Schedule the backup for DB2 databases are different from the filesystem. There are some paths to do the same thing.
I choose a script with cron.Create a file named backup.ksh with the following linesdb2 backup db fnos online use TSM

db2 backup db opnact online use TSM
db2 backup db cognos online use TSM
db2 backup db projexec online use TSM
db2 backup db metrics online use TSM
db2 backup db sncomm online use TSM
db2 backup db wikis online use TSM
db2 backup db forum online use TSM
db2 backup db fngcd online use TSM
db2 backup db homepage online use TSM
db2 backup db dogear online use TSM
db2 backup db peopledb online use TSM
db2 backup db mobile online use TSM
db2 backup db files online use TSM
db2 backup db blogs online use TSM

Add the following entry on the crontab of the root user using crontab -e

00 3 * * 1-6 su - db2inst1 -c "/home/db2inst1/backup.ksh >> /home/db2inst1/fullbackup.log 2>&1"

Managing old DB2 backups

Purge old DB2 backups is not managed by the TSM server.
The backups ara managed by the DB2.  I use a new cron entry and a new scriptCreate a file called deldb2backup.ksh with the following lines:

db2adutl delete FULL older than 4 days  db FILES
db2adutl delete FULL older than 4 days  db OPNACT
db2adutl delete FULL older than 4 days  db COGNOS
db2adutl delete FULL older than 4 days  db PROJEXEC
db2adutl delete FULL older than 4 days  db METRICS
db2adutl delete FULL older than 4 days  db FNOS
db2adutl delete FULL older than 4 days  db SNCOMM
db2adutl delete FULL older than 4 days  db WIKIS
db2adutl delete FULL older than 4 days  db FORUM
db2adutl delete FULL older than 4 days  db FNGCD
db2adutl delete FULL older than 4 days  db HOMEPAGE
db2adutl delete FULL older than 4 days  db DOGEAR
db2adutl delete FULL older than 4 days  db PEOPLEDB
db2adutl delete FULL older than 4 days  db MOBILE
db2adutl delete FULL older than 4 days  db BLOG
Add the following line to root crontab

00 14 * * 6  su - db2inst1 -c "/home/db2inst1/delbackup.ksh >> /home/db2inst1/delbackup.log 2>&1"