Below is a procedure for creating an IBM TSM server instance. This procedure is applicable to version 7 and later of IBM Spectrum Protect, including version 8. It can be used when setting up a new TSM server or during TSM server disaster recovery. In the event of DR, It is important to ensure that a TSM instance with the same name is prepared as an empty vessel before executing the TSM server database recovery process (dsmserv restore db). This procedure will guide you through the necessary steps for creating the TSM server instance.
Note the configuration variables that are used in the procedure below.
TSM Server Host: my_tsmsvr01 TSM Server Version: Version 8.1.11 IBM Spectrum Protect for Linux/x86_64 TSM BA Client Version: Version 8.1.11 TSM Instance User: tsmsvr01 TSM Instance Group: tsmsrvrs TSM Instance User Home Path: /opt/tivoli/tsmsvr01 TSM Database Path: /opt/tivoli/tsmsvr01/tsmdb/db01 /opt/tivoli/tsmsvr01/tsmdb/db02 /opt/tivoli/tsmsvr01/tsmdb/db03 /opt/tivoli/tsmsvr01/tsmdb/db04 TSM Log Path: /opt/tivoli/tsmsvr01/tsmlog/log01 /opt/tivoli/tsmsvr01/tsmlog/log02 /opt/tivoli/tsmsvr01/tsmlog/log03 /opt/tivoli/tsmsvr01/tsmlog/log04 TSM DevClass for TSM DB Backup: TSMDBBACKUP TSM DevClass TSMDBBACKUP Path: /tsmstg01/tsmdbbackup TSM DevClass TSMDBBACKUP Max File Size: 100GB
Step 1. Create TSM user/group on TSM server
groupadd tsmsrvrs useradd -g tsmsrvrs tsmsvr01 -d /opt/tivoli/tsmsvr01 -p tsmsvr01 mkdir -p /opt/tivoli/tsmsvr01 chown -R tsmsvr01:tsmsrvrs /opt/tivoli/tsmsvr01 su - tsmsvr01 vi .bash_profile ### Add below lines in blue to .bash_profileENV=$HOME/.kshrc #PS1=`hostname`:'$PWD>' PS1=`hostname`:[`whoami`]'$PWD>' export ENV PS1 EDITOR=/usr/sbin/vi set -o vi export PS1 EDITOR stty erase \^? if [ -f /opt/tivoli/tsmsvr01/sqllib/db2profile ]; then . /opt/tivoli/tsmsvr01/sqllib/db2profile fi
Step 2. Create DB2 Instance
Note! run below command as root. Syntax) /opt/tivoli/tsm/db2/instance/db2icrt -a SERVER -u tsmsvr01 tsmsvr01 -------- -------- ^ ^ | |____ TSM instance name that goes onto TSM DB. | TSM instance user name that just created at step1
Note the output below from running the command db2icrt.
my_tsmsvr01:[root]/root>/opt/tivoli/tsm/db2/instance/db2icrt -a SERVER -u tsmsvr01 tsmsvr01 DBI1446I The db2icrt command is running. DB2 installation is being initialized. Total number of tasks to be performed: 4 Total estimated time for all tasks to be performed: 309 second(s) Task #1 start Description: Setting default global profile registry variables Estimated time 1 second(s) Task #1 end Task #2 start Description: Initializing instance list Estimated time 5 second(s) Task #2 end Task #3 start Description: Configuring DB2 instances Estimated time 300 second(s) Task #3 end Task #4 start Description: Updating global profile registry Estimated time 3 second(s) Task #4 end The execution completed successfully. For more information see the DB2 installation log at "/tmp/db2icrt.log.1185147". DBI1070I Program db2icrt completed successfully. my_tsmsvr01:[root]/root>
Step 3. Set DB2 default path of TSM configuration files per TSM instance
su - tsmsvr01 db2 update dbm cfg using dftdbpath /opt/tivoli/tsmsvr01 exit; su - tsmsvr01 env | grep DB
my_tsmsvr01:[root]/root>su - tsmsvr01 my_tsmsvr01:[tsmsvr01]/opt/tivoli/tsmsvr01>db2 update dbm cfg using dftdbpath /opt/tivoli/tsmsvr01 DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed successfully. my_tsmsvr01:[tsmsvr01]/opt/tivoli/tsmsvr01>exit my_tsmsvr01:[root]/root>su - tsmsvr01 my_tsmsvr01:[tsmsvr01]/opt/tivoli/tsmsvr01>env | grep DB IBM_DB_LIB=/opt/tivoli/tsmsvr01/sqllib/lib IBM_DB_HOME=/opt/tivoli/tsmsvr01/sqllib IBM_DB_INCLUDE=/opt/tivoli/tsmsvr01/sqllib/include IBM_DB_DIR=/opt/tivoli/tsmsvr01/sqllib DB2INSTANCE=tsmsvr01 DB2_HOME=/opt/tivoli/tsmsvr01/sqllib DB2LIB=/opt/tivoli/tsmsvr01/sqllib/lib my_tsmsvr01:[tsmsvr01]/opt/tivoli/tsmsvr01>
Step 4. Modify the library path to use the version of the IBM Global Security Kit (GSKit)
su - tsmsvr01 vi /opt/tivoli/tsmsvr01/sqllib/userprofile ### Add below lines in blue to userprofileLD_LIBRARY_PATH=/opt/tivoli/tsm/server/bin/dbbkapi:/usr/local/ibm/gsk8_64/lib64:$LD_LIBRARY_PATH export LD_LIBRARY_PATHexit su - tsmsvr01 ### Verify $LD_LIBRARY_PATH echo $LD_LIBRARY_PATH gsk8capicmd_64 -version gsk8ver_64
After update of library path, verify as below.
my_tsmsvr01:[root]/root>su - tsmsvr01 my_tsmsvr01:[tsmsvr01]/opt/tivoli/tsmsvr01>gsk8capicmd_64 -version GSKCAPICMD ========== @(#)CompanyName: IBM Corporation @(#)LegalTrademarks: IBM @(#)FileDescription: IBM Global Security Toolkit @(#)FileVersion: 8.0.55.17 @(#)InternalName: gskcapicmd @(#)LegalCopyright: Licensed Materials - Property of IBM GSKit (C) Copyright IBM Corp.1995, 2020 All Rights Reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @(#)OriginalFilename: gsk8capicmd_64 @(#)ProductName: gsk8l (GoldCoast Build develop8) 200714 @(#)ProductVersion: 8.0.55.17 . . . libgsk8km2_64.so ============ @(#)CompanyName: IBM Corporation @(#)LegalTrademarks: IBM @(#)FileDescription: IBM Global Security Toolkit @(#)FileVersion: 8.0.55.17 @(#)InternalName: gskkm2 @(#)LegalCopyright: Licensed Materials - Property of IBM GSKit (C) Copyright IBM Corp.1995, 2020 All Rights Reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @(#)OriginalFilename: libgsk8km2_64.so @(#)ProductName: gsk8l (GoldCoast Build develop8) 200714 @(#)ProductVersion: 8.0.55.17
Step 5. Update TSM instance user’s dsmserv.opt
Make sure you entered in TSM instance user to update dsmserv.opt
su - tsmsvr01 vi dsmserv.opt ### Add below lines in blue to dsmserv.opt*** IBM TSM Server options file *** Refer to dsmserv.opt.smp for other options *DISABLESCHEDS YES **Disable Client/Addmin Schedule temporally during TSM server recovery time. COMMMETHOD TCPIP TCPPORT 1500 TXNGROUPMAX 256 MOVEBATCHSIZE 256 MOVESIZETHRESH 500 VOLUMEHISTORY /opt/tivoli/tsmsvr01/volhistory.out DEVCONFIG /opt/tivoli/tsmsvr01/devconfig.out ALLOWREORGTABLE YES ALLOWREORGINDEX YES REORGBEGINTIME 06:00 REORGDURATION 1 LANGuage AMENGexit
Step 6. Create TSM DB and Log folders and execute TSM server initialization
mkdir -p /opt/tivoli/tsmsvr01/tsmdb/db01 mkdir -p /opt/tivoli/tsmsvr01/tsmdb/db02 mkdir -p /opt/tivoli/tsmsvr01/tsmdb/db03 mkdir -p /opt/tivoli/tsmsvr01/tsmdb/db04 mkdir -p /opt/tivoli/tsmsvr01/tsmlog/log01 mkdir -p /opt/tivoli/tsmsvr01/tsmlog/log02 mkdir -p /opt/tivoli/tsmsvr01/tsmlog/log03 mkdir -p /opt/tivoli/tsmsvr01/tsmlog/log04 chown -R tsmsvr01:tsmsrvrs /opt/tivoli/tsmsvr01/tsmdb chown -R tsmsvr01:tsmsrvrs /opt/tivoli/tsmsvr01/tsmlog su - tsmsvr01 /opt/tivoli/tsm/server/bin/dsmserv format dbdir=/opt/tivoli/tsmsvr01/tsmdb/db01,/opt/tivoli/tsmsvr01/tsmdb/db02,/opt/tivoli/tsmsvr01/tsmdb/db03,/opt/tivoli/tsmsvr01/tsmdb/db04 activelogsize=2048 activelogdir=/opt/tivoli/tsmsvr01/tsmlog/log01 mirrorlogdir=/opt/tivoli/tsmsvr01/tsmlog/log02 archlogdir=/opt/tivoli/tsmsvr01/tsmlog/log03 archfailoverlogdir=/opt/tivoli/tsmsvr01/tsmlog/log04
See TSM server initialization output as below
my_tsmsvr01:[root]/root>su - tsmsvr01 my_tsmsvr01:[tsmsvr01]/opt/tivoli/tsmsvr01>/opt/tivoli/tsm/server/bin/dsmserv format dbdir=/opt/tivoli/tsmsvr01/tsmdb/db01,/opt/tivoli/tsmsvr01/tsmdb/db02,/opt/tivoli/tsmsvr01/tsmdb/db03,/opt/tivoli/tsmsvr01/tsmdb/db04 activelogsize=2048 activelogdir=/opt/tivoli/tsmsvr01/tsmlog/log01 mirrorlogdir=/opt/tivoli/tsmsvr01/tsmlog/log02 archlogdir=/opt/tivoli/tsmsvr01/tsmlog/log03 archfailoverlogdir=/opt/tivoli/tsmsvr01/tsmlog/log04 ANR7800I DSMSERV generated at 10:26:22 on Nov 3 2020. IBM Spectrum Protect for Linux/x86_64 Version 8, Release 1, Level 11.000 Licensed Materials - Property of IBM (C) Copyright IBM Corporation 1990, 2020. All rights reserved. U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corporation. ANR7801I Subsystem process ID is 1269336. ANR0900I Processing options file /opt/tivoli/tsmsvr01/dsmserv.opt. ANR0010W Unable to open message catalog for language en_US.UTF-8. The default language message catalog will be used. ANR7814I Using instance directory /opt/tivoli/tsmsvr01. ANR3339I Default Label in key data base is TSM Server SelfSigned SHA Key. ANR4726I The ICC support module has been loaded. ANR0152I Database manager successfully started. ANR2976I Offline DB backup for database TSMDB1 started. ANR2974I Offline DB backup for database TSMDB1 completed successfully. ANR0992I Server's database formatting complete. ANR0369I Stopping the database manager because of a server shutdown. my_tsmsvr01:[tsmsvr01]/opt/tivoli/tsmsvr01>
Step 7. Start TSM server and run minimal configuration
su - tsmsvr01 /opt/tivoli/tsm/server/bin/dsmserv ## Run below TSM commands at TSM server console prompt.register license file=*.lic register admin admin tsmadmin123! grant authority admin class=system set actlogretention 90 set queryschedperiod 1 set randomize 2 setopt maxsessions 1000 set servername tsmsvr01 set serverpassword tsmsvr01_pwd
my_tsmsvr01:[root]/root>su - tsmsvr01 my_tsmsvr01:[tsmsvr01]/opt/tivoli/tsmsvr01>/opt/tivoli/tsm/server/bin/dsmserv ANR7800I DSMSERV generated at 10:26:22 on Nov 3 2020. IBM Spectrum Protect for Linux/x86_64 Version 8, Release 1, Level 11.000 Licensed Materials - Property of IBM (C) Copyright IBM Corporation 1990, 2020. All rights reserved. U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corporation. ANR7801I Subsystem process ID is 1287590. ANR0900I Processing options file /opt/tivoli/tsmsvr01/dsmserv.opt. ANR0010W Unable to open message catalog for language en_US.UTF-8. The default language message catalog will be used. ANR7814I Using instance directory /opt/tivoli/tsmsvr01. ANR3339I Default Label in key data base is TSM Server SelfSigned SHA Key. ANR4726I The ICC support module has been loaded. ANR0990I Server restart-recovery in progress. ANR0152I Database manager successfully started. ANR1628I The database manager is using port 51500 for server connections. ANR2277W The server master encryption key was not found. A new master encryption key will be created. . . . ANR0281I Servermon successfully started during initialization, using process 1288092. ANR0993I Server initialization complete. ANR0916I IBM Spectrum Protect distributed by International Business Machines is now ready for use. IBM Spectrum Protect:SERVER1> IBM Spectrum Protect:SERVER1> register license file=*.lic ANR2017I Administrator SERVER_CONSOLE issued command: REGISTER LICENSE file=*.lic ANR2852I Current license information: ANR2853I New license information: ANR2828I Server is licensed to support IBM Spectrum Protect for Data Retention. ANR2828I Server is licensed to support IBM Spectrum Protect Basic Edition. ANR2828I Server is licensed to support IBM Spectrum Protect Extended Edition. IBM Spectrum Protect:SERVER1> register admin admin tsmpwd123! ANR2017I Administrator SERVER_CONSOLE issued command: REGISTER ADMIN admin ?***? ANR2068I Administrator ADMIN registered. IBM Spectrum Protect:SERVER1> grant authority admin class=system ANR2017I Administrator SERVER_CONSOLE issued command: GRANT AUTHORITY admin class=system ANR2076I System privilege granted to administrator ADMIN. IBM Spectrum Protect:SERVER1> set actlogretention 90 ANR2017I Administrator SERVER_CONSOLE issued command: SET ACTLOGRETENTION 90 ANR2090I Activity log retention set to 90 for management by DATE. IBM Spectrum Protect:SERVER1> set queryschedperiod 1 ANR2017I Administrator SERVER_CONSOLE issued command: SET QUERYSCHEDPERIOD 1 ANR2523I Schedule query period set to 1 hour(s). IBM Spectrum Protect:SERVER1> set randomize 2 ANR2017I Administrator SERVER_CONSOLE issued command: SET RANDOMIZE 2 ANR2522I Randomization set to 2 percent. IBM Spectrum Protect:SERVER1> setopt maxsessions 1000 ANR2017I Administrator SERVER_CONSOLE issued command: SETOPT maxsessions 1000 ANR2119I The MAXSESSIONS option has been changed in the options file. IBM Spectrum Protect:SERVER1> set servername tsmsvr01 ANR2017I Administrator SERVER_CONSOLE issued command: SET SERVERNAME tsmsvr01 ANR2094I Server name set to tsmsvr01. ANR4865W The server name has been changed. Windows clients that use "passwordaccess generate" may be unable to authenticate with the server. IBM Spectrum Protect:tsmsvr01> set serverpassword tsmsvr01_pwd ANR2017I Administrator SERVER_CONSOLE issued command: SET SERVERPASSWORD ?***? ANR2131I Server password set. IBM Spectrum Protect:tsmsvr01>
NOTE! Use the command line below for starting TSM server at background.
nohup /opt/tivoli/tsm/server/bin/rc.dsmserv -u tsmsvr01 -i /opt/tivoli/tsmsvr01 quiet &
Step 8. Set up TSM DB Backup API
It’s important to complete API configuration for TSM database backup. After TSM server instance creation, by default it can’t run TSM database backup nor recovery. It is the configuration for TSM server by itself to be able to run TSM database backup. TSM database is IBM DB2. TSM client node name running TSM database backup is $$_TSMDBMGR_$$
8.1. Define Devclass for TSM Database backup ## Run below from OS prompt as root mkdir -p /tsmstg01/tsmdbbackup chown -R tsmsvr01:tsmsrvrs /tsmstg01/tsmdbbackup ## Run below from TSM server console command prompt define devclass tsmdbbackup devtype=file directory=/tsmstg01/tsmdbbackup maxcapacity=100g 8.2 Update TSM instance user's profile and config file update su - tsmsvr01 vi /opt/tivoli/tsmsvr01/sqllib/userprofile ### Add below lines in blue to userprofileexport DSMI_CONFIG=/opt/tivoli/tsmsvr01/tsmdbmgr.opt export DSMI_DIR=/opt/tivoli/tsm/server/bin/dbbkapi export DSMI_LOG=/opt/tivoli/tsmsvr01vi /opt/tivoli/tsmsvr01/tsmdbmgr.opt ### Add below lines in blue to tsmdbmgr.optSERVERNAME TSMDBMGR_tsmsvr018.3 update dsm.sys under dbbkapi ### Note!! update this file as root! Not as TSM instance user vi /opt/tivoli/tsm/server/bin/dbbkapi/dsm.sysservername TSMDBMGR_tsmsvr01 commmethod tcpip tcpserveraddr localhost tcpport 1500 errorlogname /opt/tivoli/tsmsvr01/tsmdbmgr.log nodename $$_TSMDBMGR_$$8.4 Halt TSM Server, Exit/re-eneter in TSM instance user, then start TSM Server Be careful! After TSM instance halted, you must exit/re-entered in TSM instance user then start TSM Server so that the profiles that you updated at the step 8.2 should be read.IBM Spectrum Protect:tsmsvr01>halt my_tsmsvr01:[tsmsvr01]/opt/tivoli/tsmsvr01>exit logout my_tsmsvr01:[root]/root>su - tsmsvr01 my_tsmsvr01:[tsmsvr01]/opt/tivoli/tsmsvr01>/opt/tivoli/tsm/server/bin/dsmserv ANR7800I DSMSERV generated at 10:26:22 on Nov 3 2020. IBM Spectrum Protect for Linux/x86_64 Version 8, Release 1, Level 11.000 Licensed Materials - Property of IBM (C) Copyright IBM Corporation 1990, 2020. All rights reserved. U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corporation. ANR7801I Subsystem process ID is 1359256. ANR0900I Processing options file /opt/tivoli/tsmsvr01/dsmserv.opt. . . .8.5 Run SET DBRECOVERY It's important NOT to forget the password when running SET DBRECOVERY. You must provide the password when running TSM database recovery. If password forgotten, TSM Server database recovery (dsmserv restore db) will fail. See below output and note the commands in blue.IBM Spectrum Protect:tsmsvr01> set dbrecovery tsmdbbackup protectkeys=yes password=tsmpwd123! ANR2017I Administrator SERVER_CONSOLE issued command: SET DBRECOVERY tsmdbbackup protectkeys=yes password=?***? ANR2782I SET DBRECOVERY completed successfully and device class for automatic DB backup is set to TSMDBBACKUP.8.6 Try run TSM database backup See below output and note the line in blue for the command.IBM Spectrum Protect:tsmsvr01> backup db devclass=tsmdbbackup type=full ANR2017I Administrator SERVER_CONSOLE issued command: BACKUP DB devclass=tsmdbbackup type=full ANR0984I Process 4 for Database Backup started in the BACKGROUND at 11:36:10 PM. ANR4559I Backup DB is in progress. ANR2280I Full database backup started as process 4. IBM Spectrum Protect:tsmsvr01> ANR8340I FILE volume /tsmstg01/tsmdbbackup/79639772.DBV mounted. ANR0513I Process 4 opened output volume /tsmstg01/tsmdbbackup/79639772.DBV. ANR1360I Output volume /tsmstg01/tsmdbbackup/79639772.DBV opened (sequence number 1). ANR4626I Database backup will use 1 streams for processing with the number originally requested 1. ANR8592I Session 6 connection is using protocol TLSV12, cipher specification TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, certificate TSM Self-Signed Certificate. ANR0406I Session 6 started for node $$_TSMDBMGR_$$ (DB2/LINUXX8664) (SSL localhost[127.0.0.1]:45878). ANR0403I Session 6 ended for node $$_TSMDBMGR_$$ (DB2/LINUXX8664). ANR8592I Session 7 connection is using protocol TLSV12, cipher specification TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, certificate TSM Self-Signed Certificate. ANR0406I Session 7 started for node $$_TSMDBMGR_$$ (DB2/LINUXX8664) (SSL localhost[127.0.0.1]:41980). ANR1361I Output volume /tsmstg01/tsmdbbackup/79639772.DBV closed. ANR0514I Session 7 closed volume /tsmstg01/tsmdbbackup/79639772.DBV. ANR0403I Session 7 ended for node $$_TSMDBMGR_$$ (DB2/LINUXX8664). ANR4550I Full database backup (process 4) completed. Total bytes backed up: 755,499,008. IBM Spectrum Protect Server for Linux/x86_64 - Version 8, Release 1, Level 11.000 IBM Spectrum Protect:tsmsvr01> backup devconfig ANR2017I Administrator SERVER_CONSOLE issued command: BACKUP DEVCONFIG ANR2394I BACKUP DEVCONFIG: Server device configuration information was written to all device configuration files. IBM Spectrum Protect:tsmsvr01> backup volhistory ANR2017I Administrator SERVER_CONSOLE issued command: BACKUP VOLHISTORY ANR2463I BACKUP VOLHISTORY: Server sequential volume history information was written to all configured history files. IBM Spectrum Protect:tsmsvr01> query volhistory ANR2017I Administrator SERVER_CONSOLE issued command: QUERY VOLHISTORY Date/Time: 03/23/2023 11:36:12 PM Volume Type: BACKUPFULL Backup Series: 1 Backup Operation: 0 Volume Seq: 100,001 Device Class: TSMDBBACKUP Volume Name: /tsmstg01/tsmdbbackup/79639772.DBV Volume Location: Command: Database Backup ID High: 0 Database Backup ID LOW: 0 Database Backup Home Position: 0 Database Backup HLA: Database Backup LLA: Database Backup Total Data Bytes (MB) : 0 Database Backup total Log Bytes (MB) : 0 Database Backup Block Num High: 0 Database Backup Block Num Low: 0 Database Backup Stream Id: 1 Database Backup Volume Sequence for Stream: 100,001 IBM Spectrum Protect:tsmsvr01>
Pingback: How to recover TSM server database (IBM Spectrum Protect) - TechNote101