IBM Support

SQL1024N SQL1013N running Select in DB2



Error received when running a select statement for a Tivoli Storage Manager table through the DB2 CLI - Command Line Interface.


Errors are reported when running a select statement in the DB2 command window similar to the following:
SQL1024N A database connection does not exist. SQLSTATE=08003
SQL1013N The database alias name or database name "TSMDB1" could not be found. SQLSTATE=42705

Resolving The Problem

To correctly run a select statement in the DB2 command window for a Tivoli Storage Manager server table, be sure to perform the following steps.

The following example is based on the default "Server1" instance name and default database name of "TSMDB1". Replace the Instance name or the database name if yours are different than the defaults:

Open a DB2 Command Window. This should automatically resolve to the following path:

<installed path>\Tivoli\TSM\db2\BIN\

Run the following commands:

>set db2instance=server1

>db2 connect to tsmdb1

>db2 set schema tsmdb1 (this sets the schema to tsmdb1 so that the table names do not need to be prefixed with the schema name. NOTE: This step can be skipped if the schema name is prefixed to the table name as shown in example #2 below)


>db2 select * from activity_log (when the schema has been set)

>db2 select * from tsmdb1.activity_log (when the schema has not been set)

[{"Product":{"code":"SSGSG7","label":"Tivoli Storage Manager"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"Server","Platform":[{"code":"PF033","label":"Windows"},{"code":"PF025","label":"Platform Independent"}],"Version":"All Supported Versions","Edition":"","Line of Business":{"code":"LOB26","label":"Storage"}}]

Product Synonym

TSM ADSM ITSM IBM Spectrum Protect

Document Information

Modified date:
17 June 2018