Tip 3. Discovering
the user exit error codes
The IBM DB2 documentation is missing
a link to the user exit program error code list. Suppose that there is a
problem during the archiving of the database log files, heaping the errors and
warning messages in the database error log db2dump.log as displayed below:
$tail -f db2diag.log
2004-01-11-14.17.07.452242 Instance:artist
Node:000
PID:13064(db2med.22804.0 3) Appid:none
database_utilities sqluMCWriteToDevice Probe:50
Media controller -- problem writing to vendor device.
rc = -2025
2004-01-11-14.17.07.502244 Instance:db2udb1
Node:000
PID:22804(db2agent (ARTIST) 0)
Appid:*N0.artist.030623121652
database_utilities sqlubMWResponse Probe:5
Database:ARTIST
DiagData
ffff f817 3431 ff54 534d 00
....41.TSM.
Listing 4: Errors related to the saving log files
on the TSM server
A DBA is required to interpret the
User Exit program return codes, in a manner that will obtain detailed
information about the error condition. The return codes from the Tivoli Storage
Manager APIs are located in the TSM API header file (dsmrc.h). A file is located in the TSM API
installation directory.
>> find / -name dsmrc.h -print
/opt/tivoli/tsm/client/api/bin/sample/dsmrc.h
Listing 5: User exit program error code list location
The error message -2025 indicates
the non-existence of the backup management class.
>> cat /opt/tivoli/tsm/client/api/bin/sample/dsmrc.h | grep 2025
#define DSM_RC_INVALID_MCNAME -2025 /* Mgmt class name not found */
Listing 6: User exit error code 2025
Tip 4. Tackling
with DB parameter TSM password
There are four database parameters
related to the TSM server configuration. After changing the database parameter,
TSM_PASSWORD, you might be surprised with the result.
$db2 get db cfg for artist | grep TSM
TSM management class (TSM_MGMTCLASS) =
TSM node name (TSM_NODENAME) =
TSM owner (TSM_OWNER) =
TSM password (TSM_PASSWORD) =*********
Listing 7: TSM related database parameters, with
enabled TSM_PASSWORD
As described in the IBM document "The
Backing up DB2 using Tivoli Storage Manager," setting the TSM password parameter
to some value would direct the DB2 system command db2adutl to read the newly defined
password before accessing the TSM server. Unexpectedly, after changing the default
null password to some value, a new database backup could not be made.
db2 =-> backup database artist online use TSM
Backup successful. The timestamp for this backup image is : 20040110150134
db2 =-> update db cfg for ARTIST using TSM_PASSWORD 'Artist'
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
DB21026I For most configuration parameters, all applications must disconnect from this
database before the changes become effective.
db2 =-> terminate
DB20000I The TERMINATE command completed successfully.
$ db2 connect to ARTIST
Database Connection Information
Database server = DB2/Sun 7.2.0
SQL authorization ID = artist...
Local database alias = ARTIST
$ db2 get db cfg for ARTIST | grep TSM
TSM management class (TSM_MGMTCLASS) =
TSM node name (TSM_NODENAME) =
TSM owner (TSM_OWNER) =
TSM password (TSM_PASSWORD) = *****
db2 =->backup database ARTIST online use TSM
SQL1015N The database must be restarted because the previous session did not conclude
normally. SQLSTATE=55025
....
db2 =-> backup database ARTIST online use TSM
SQL2062N An error occurred while accessing media.
Listing 8: Changing TSM_PASSWORD parameter
After some additional testing, the
TSM password database parameter was reset to null, after which the database backup
started working again.
db2 => update db cfg for ARTIST using TSM_PASSWORD ''
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
DB21026I For most configuration parameters, all applications must disconnect from this
database before the changes become effective.
Listing 9: Resetting TSM_PASSWORD to default value
In the previously mentioned
document, under Appendix A, "Quick start/checklist for configuration"
there exists additional information specific for Sun Solaris. It states, for
proper DB2 backup functionality, the DBA needs to update the database configuration
parameter TSM_PASSWORD using a NULL value. My conclusion is that there are some
incompatibility problems
with an existing TSM API client and the DB2 database version. Following this
experience, use the TSM_PASSWORD only for a redirected restore, on your Sun
Solaris installation.