IBM Support


How to trace the TSM API per DB2 database partition

Question & Answer


Question

What to do if you want to have separate TSM® traces being taken on each DB2® database partition for the complete duration of the database backup?

Cause

Having the described functionality allows to collect TSM® traces per DB2® database partition. This can be useful for troubleshooting.

Answer

To achieve this goal you need to use the "OPTIONS" token in the BACKUP command, specifying the appropriate trace file. Here is an example:

export DB2NODE=0
db2 "BACKUP DB dbname ON DBPARTITIONNUM ( $DB2NODE ) USE TSM OPTIONS '-TRACEFILE=/home/db2tsm/tsm_trace.$DB2NODE.out'"

After executing the command above, the TSM trace file will be created with the corresponding node number in the file name: /home/db2tsm/tsm_trace.0.out

You can use this method in various scenarios. Another simple example is following:

db2_all "<<-1<; echo DB2NODE=\$DB2NODE; db2 -v BACKUP DB dbname TABLESPACE\(tbspcname\) ONLINE  USE TSM OPTIONS \"-TRACEFILE=/home/db2tsm/tsm.trace.\$DB2NODE.out\""

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"DB2 Tools - db2trace","Platform":[{"code":"PF033","label":"Windows"},{"code":"PF002","label":"AIX"}],"Version":"9.8;9.7;9.5;10.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21614741