IBM Support

SQL2062N error (reason code 106) when performing a database backup, restore or log archive operation via TSM in a multi-partitioned database environment

Troubleshooting


Problem

This document provides troubleshooting information for the situation where your BACKUP DATABASE or RESTORE DATABASE commands or an attempt to perform a log archive fail with an SQL2062N error. In particular, this information pertains to when you are using Tivoli® Storage Manager (TSM) in a DB2® instance with multiple database partitions.

Symptom

An example of the error is as follows:

SQL2062N An error occurred while accessing media "/home/db2inst1/sqllib/adsm/libtsm.a".
Reason code: "106".

Cause

In order to work properly with the TSM server, the environment variables used by the TSM client API (for example, DSMI_CONFIG, DSMI_DIR and DSMI_LOG) have to be set up correctly.

In an instance with a single database partition, this can be done by simply setting these variables in the .profile file for the instance owner. That method will not work for a multi-partition environment, however.

In a multi-partitioned database environment, all of the environment variables used by the TSM client API have to be set in the <instance home>/sqllib/userprofile file, instead of the .profile of the instance owner. Otherwise, attempts to perform a backup, restore, or archive operation might fail with an error SQL2062N reason code 106.

Resolving The Problem

To solve the problem, set all of the DSM_* variables in the sqllib/userprofile file and then stop and start the instance.



For example the file could contain the following:
DSMI_CONFIG=/usr/tivoli/tsm/client/api/bin64/dsm.opt
DSMI_DIR=/usr/tivoli/tsm/client/api/bin64
DSMI_LOG=/home/db2inst1/sqllib/db2dump
export DSMI_CONFIG DSMI_DIR DSMI_LOG

For more information, please read the 'Configuring TSM Client' link in the Related URL section below.

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Recovery - Restore","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"}],"Version":"9.8;9.7;9.5;9.1;8.2","Edition":"Advanced Enterprise Server;Enterprise Server;Express;Workgroup Server","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21251983