Question & Answer
Question
Configuration steps required for DB2 to work with Tivoli Storage Manager on Windows
Answer
Below are the steps required to configure DB2 Backups to be sent to the Tivoli Storage Manager Server.
1. Install Tivoli Storage Manager API software. This is included with the Tivoli Storage Manager Backup-Archive Client installation package.
2. Create a plain text file to be used as the options file for the DB2 node in c:\progra~1\common~1\Tivoli\TSM\api *for 32bit Windows
c:\progra~1\common~1\Tivoli\TSM\api64 *for 64bit Windows
Note that the default name is dsm.opt, but a different file name can be used. For example db2dsm.opt, nodename.opt, etc.. The options file must contain at least the following.
- TCPSERVERADDRESS xxx.xxx.xxx.xxx
NODENAME DB2TSM
PASSWORDACCESS GENERATE
Make note of the password, as you will need it to authenticate in step 7 below.
Be sure to give the node the authority to delete it's backups (BACKDEL=YES), as DB2 will be controlling how long to keep the backup data.
A DB2 restore can only access data that has an ACTIVE state, thus it is recommended to setup the management class with a backup copygroup that has the following retention settings:
- VEREXIST=1
VERDELETED=0
RETEXTRA=0
RETONLY=0
It is not recommended to set this management class as the default within the policy domain unless you are registering your DB2 nodes in their own policy domain. The above retentions will only keep 1 current/active copy of a backup, which is not normally the desired retentions for other filesystem data.
4. On the system where DB2 and the Tivoli Storage Manager client is installed, create an environment variable called DSMI_CONFIG (in upper-case) within the SYSTEM environment variable settings (Search Control Panel for 'Environment Variables') that contains the path and file name to the DB2 node's options file.
Example:
- c:\progra~1\common~1\Tivoli\TSM\api64\dsm.opt
Another way to set environment variables would be to use the DB2_VENDOR_INI variable. Create a file called tsm.env that contains the path and file name to the dsm.opt used by DB2.
Example:
- DSMI_CONFIG=c:\progra~1\common~1\Tivoli\TSM\api64\dsm.opt
- db2set -i <intancename> DB2_VENDOR_INI=d:\tsm.env
Note: The DB2_VENDOR_INI environment variable is deprecated in DB2 v9.5 and might be removed in a future release.
5. Reboot the system or restart the DB2 services, so that the DSMI_CONFIG variable will be loaded into the DB2 runtime engine.
If the specified dsm.opt file does not exist or if DB2 does not get restarted, a DB2 backup using the Tivoli Storage Manager API client may fail with Reason Code 406 (No default user configuration file )
Note: if you're binding the DB2 data to a non-default management class, update the DB cfg parameter TSM_MGMTCLASS prior to restarting DB2.
Example:
- db2 update db cfg for db_name using tsm_mgmtclass my_mgmtclass
6. Sign-on as the administrator, open a command window, and change to the ...\sqllib\adsm directory.
7. Run the executable 'dsmapipw' and follow the prompts. It will ask for the current password, then for a new password, and confirmation of the new password. It should report whether or not the command was successful. To keep the existing password, enter the same identical password at all 3 prompts.
8. It is possible to run the db2 command 'db2adutl query' to confirm that the password was set correctly. Db2adutl.exe is typically located in the c:\program files\sqllib\bin directory.
It is important to note that if no backups have been performed, this will witness an error for "Filespace name not found" or " No objects on server match query" (RC=2060 or RC=2 respectively). However, even if an error is seen, you should still be able to check the activity log on the Tivoli Storage Manager server to confirm that the node, DB2TSM, authenticated.
9. You can now perform a backup using the DB2 command line or the DB2 connect GUI.
(For example, db2 backup db DBNAME use tsm.)
The above instructions are for configuring the DB2 database backups to Tivoli Storage Manager. If you would like to configure the DB2 log archives to Tivoli Storage Manager, reference knowledgebase document 1670036 (Configuring DB2 log archives to Tivoli Storage Manager). See links below for this topic, as well as additional information on backing up DB2 to Tivoli Storage Manager.
Related Information
Product Synonym
TSM
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
swg21672745