IBM Support

db2start and db2stop fail with SQL1042C error

Troubleshooting


Problem

When running db2start and db2stop locally, DB2 fails with following error: $ db2start SQL1042C An unexpected system error occurred. SQLSTATE=58004 $ db2stop SQL1042C An unexpected system error occurred. SQLSTATE=58004

Symptom

When "SQL1042C" error is encountered on db2start and db2stop, subsequently all other db2 commands (except "db2level") fail with the following:

'SQL5005C' error if the db2systm file is missing or permission issue such as:


$ db2 list db directory
SQL5005C System Error.

$ db2 get dbm cfg
SQL5005C System Error.

$ db2 list applications
SQL5005C System Error.

'SQL5055C' error if the db2systm file is corrupted/invalid such as:


$ db2 list db directory
SQL5055C The content of the database configuration file is not valid.

$ db2 get dbm cfg
SQL5055C The content of the database configuration file is not valid.

$ db2 list applications
SQL5055C The content of the database configuration file is not valid.

Cause

The db2systm file is either missing, permission issue or corrupted/invalid. This file is require in order for db2start to function properly.

Environment

DB2 UDB on Windows and UNIX

Diagnosing The Problem

There is no '1042' error in the db2diag.log however You will see similar to the following error msg in the db2diag.log indicating that DB2 is unable to open the database manager configuration file:

xxxx-xx-xx-xx.xx.xx.xxxxxx-xxx xxxxxxxxxx LEVEL: Error
PID : xxx TID : xxx PROC : db2acd 0
INSTANCE: DB2 NODE : 000
EDUID : xxx EDUNAME: db2acd 0
FUNCTION: DB2 UDB, config/install, sqlfGetDbmCfg, probe:10
MESSAGE : SQL5005: sqlf_openfile rc =
DATA #1 : Hexdump, 4 bytes
0x0000000110505500 : 860F 000A ....

xxxx-xx-xx-xx.xx.xx.xxxxxx-xxx xxxxxxxxxx LEVEL: Error
PID : xxx TID : xxx PROC : db2acd 0
INSTANCE: DB2 NODE : 000
EDUID : xxx EDUNAME: db2acd 0
FUNCTION: DB2 UDB, config/install, sqlfGetDbmCfg, probe:10
RETCODE : ZRC=0xFFFFEC73=-5005

xxxx-xx-xx-xx.xx.xx.xxxxxx-xxx xxxxxxxxxx LEVEL: Severe
PID : xxx TID : xxx PROC : db2acd 0
INSTANCE: DB2 NODE : 000
EDUID : xxx EDUNAME: db2acd 0
FUNCTION: DB2 UDB, config/install, sqlf_alert, probe:8
DATA #1 : Hexdump, 4 bytes
0x0000000110505450 : FFFF EC73 ...s

xxxx-xx-xx-xx.xx.xx.xxxxxx-xxx xxxxxxxxxx LEVEL: Severe
PID : xxx TID : xxx PROC : db2acd 0
INSTANCE: DB2 NODE : 000
EDUID : xxx EDUNAME: db2acd 0
FUNCTION: DB2 UDB, config/install, sqlfGetDbmCfg, probe:8
RETCODE : ZRC=0xFFFFEC73=-5005


If db2systm file is corrupted/invalid, you will see similar to the following in the db2diag.log:

xxxx-xx-xx-xx.xx.xx.xxxxxx-xxx xxxxxxxxxx LEVEL: Error
PID : xxxx TID : xxx PROC : db2acd 0
INSTANCE: DB2 NODE : 000
EDUID : xxx EDUNAME: db2acd 0
FUNCTION: DB2 UDB, config/install, sqlfGetDbmCfg, probe:20
RETCODE : ZRC=0xFFFFEC41=-5055

xxxx-xx-xx-xx.xx.xx.xxxxxx-xxx xxxxxxxxxx LEVEL: Error
PID : xxxx TID : xxx PROC : db2acd 0
INSTANCE: DB2 NODE : 000
EDUID : xxx EDUNAME: db2acd 0
FUNCTION: DB2 UDB, trace services, sqlt_logerr_data (secondary logging func, probe:0
MESSAGE : bytesr
DATA #1 : Hexdump, 8 bytes
0x0000000110505508 : 0000 0000 0000 0082 ........

xxxx-xx-xx-xx.xx.xx.xxxxxx-xxx xxxxxxxxxx LEVEL: Error
PID : xxxx TID : xxx PROC : db2acd 0
INSTANCE: DB2 NODE : 000
EDUID : xxx EDUNAME: db2acd 0
FUNCTION: DB2 UDB, trace services, sqlt_logerr_data (secondary logging func, probe:0
MESSAGE : ptr->release
DATA #1 : Hexdump, 2 bytes
0x0000000110505718 : 02FF ..

xxxx-xx-xx-xx.xx.xx.xxxxxx-xxx xxxxxxxxxx LEVEL: Error
PID : xxxx TID : xxx PROC : db2acd 0
INSTANCE: DB2 NODE : 000
EDUID : xxx EDUNAME: db2acd 0
FUNCTION: DB2 UDB, trace services, sqlt_logerr_data (secondary logging func, probe:0
MESSAGE : ptr->chksum
DATA #1 : Hexdump, 4 bytes
0x0000000110505708 : 3FD5 5359 ?.SY

xxxx-xx-xx-xx.xx.xx.xxxxxx-xxx xxxxxxxxxx LEVEL: Error
PID : xxxx TID : xxx PROC : db2acd 0
INSTANCE: DB2 NODE : 000
EDUID : xxx EDUNAME: db2acd 0
FUNCTION: DB2 UDB, trace services, sqlt_logerr_data (secondary logging func, probe:0
MESSAGE : ptr->dbm_cfg_version
DATA #1 : Hexdump, 2 bytes
0x000000011050571C : FF7F ..

xxxx-xx-xx-xx.xx.xx.xxxxxx-xxx xxxxxxxxxx LEVEL: Error
PID : xxxx TID : xxx PROC : db2acd 0
INSTANCE: DB2 NODE : 000
EDUID : xxx EDUNAME: db2acd 0
FUNCTION: DB2 UDB, trace services, sqlt_logerr_data (secondary logging func, probe:0
MESSAGE : dbm config
DATA #1 : Hexdump, 130 bytes
0x0000000110505708 : 3FD5 5359 5320 5052 4F46 494C 450C 251C xxxxxxxxxxxxxxxxx
0x0000000110505718 : 02FF FFFF FF7F FF04 0801 0204 0403 0FFF xxxxxxxxxxxxxxxxxx
0x0000000110505728 : FFFF FF01 FFFF 5443 5049 5053 5441 4646 xxxxxxxxxxxxxxxxx
0x0000000110505738 : 2020 2001 8040 34BE 30E1 03E8 2F68 6F6D xxxxxxxxxxxxxxxxx
0x0000000110505748 : 6532 2F65 7665 6C69 6E2F 7371 6C6C 6962 xxxxxxxxxxxxxxxxx
0x0000000110505758 : 2F64 6232 6475 6D70 0303 045A 3153 545F xxxxxxxxxxxxxxxxx_
0x0000000110505768 : 434F 4E4E B438 3739 4501 1401 C864 1008 xxxx..
0x0000000110505778 : FFFF FFFF FFFF FFFF FFFF FFFF 0A05 3C0A ..............<.
0x0000000110505788 : 0A0A ..

xxxx-xx-xx-xx.xx.xx.xxxxxx-xxx xxxxxxxxxx LEVEL: Severe
PID : xxxx TID : xxx PROC : db2acd 0
INSTANCE: DB2 NODE : 000
EDUID : xxx EDUNAME: db2acd 0
FUNCTION: DB2 UDB, config/install, sqlf_alert, probe:8
DATA #1 : Hexdump, 4 bytes
0x0000000110505450 : FFFF EC41 ...A

xxxx-xx-xx-xx.xx.xx.xxxxxx-xxx xxxxxxxxxx LEVEL: Severe
PID : xxxx TID : xxx PROC : db2acd 0
INSTANCE: DB2 NODE : 000
EDUID : xxx EDUNAME: db2acd 0
FUNCTION: DB2 UDB, config/install, sqlfGetDbmCfg, probe:8
RETCODE : ZRC=0xFFFFEC41=-5055



In the db2 trace.flw, we can see the following:
xxxxx | | sqlf_read_dbm_and_verif data [probe 4]
xxxxx | | | sqloopenp entry


In the db2 trace.fmt, we can see the following file we are trying to open:
eg: /home/db2/sqllib/db2systm

xxxx data DB2 UDB config/install sqlf_read_dbm_and_verif cei
(xx.xx.xx.xx.xx.xx)
pid xxxx tid xxxx cpid -1 node -1 probe 4
bytes 45

Data1 (PD_TYPE_STRING,37) String:
/home/db2/sqllib/db2systm

xxxx entry DB2 UDB oper system services sqloopenp cei
(xx.xx.xx.xx.xx)
pid xxxx tid xxxx cpid -1 node -1

bytes 69

Data1 (PD_TYPE_FILE_NAME,37) File name:
/home/db2/sqllib/db2systm
Data2 (PD_TYPE_UINT,4) unsigned integer:
852
Data3 (PD_TYPE_SINT,4) signed integer:
1872

Resolving The Problem

To recover the above situation :


- Drop and recreate the instance as the db2systm file is created when the instance of the database manager is created.

Or

- Issue 'db2iupdt' against the instance if the db2systm is corrupted.

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Database Objects\/Config - Instance","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.7;9.5;9.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21502619