IBM Support

DB2 : Get SQL1036C and cannot connect to database

Question & Answer


Question

How can I fix SQL1036C and connect to the database ?

Cause

Cannot connect to database and get the following error :

SQL1036C An I/O error occurred while accessing
the database. SQLSTATE=58030

Answer

Almost always this error means that db2 is trying to access a log file to
start the database and it does not find it.

There will be a message similar to following in db2diag.log corressponding
to above error :

yyyy-mm-dd-hh.mm.ss.151475-300 I449084A320        LEVEL: Error
PID     : 12841                TID  : 1           PROC : db2loggr (db_name)
INSTANCE: inst_name             NODE : 000
FUNCTION: DB2 UDB, data protection services, sqlpgInitRecoverable, probe:1370
DATA #1 : <preformatted>
Log file S0XXXXXX.LOG not found

Try to get the log file - S0XXXXXX.LOG in primary/active log path and then
connect to the database again.

If you do not have the log files ("log files missing" situation) that are needed now but have a backup
then you have 2 options of recovery :
1> If you have a recent backup and some log files, then you can use it to restore and rollforward to the end of the last log file you have to be able to recover the database to the latest point.
2> If you have no log files, but have a full offline backup then you can restore the database with option of "WITHOUT ROLLING FORWARD".

In case, if you do not have a valid backup and log files to recover a database, please contact DB2 support.
We will patch the log control files - SQLOGCTL.LFH (SQLOGCTL.GLFH) for you which will allow you to connect to the database. By patching LFH file we essentially trick the database, i.e. we change the consistency status to YES so it does not look for any transaction logs to start (Normally during crash recovery all the transactions in active log files are read for replay purposes and they should be available). So in essence we bypass crash recovery and compromise with the database integrity. Hence we expect customers to export the data and REBUILD the database via data imports to maintain data integrity.

Related Information

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

Document Information

Modified date:
16 June 2018

UID

swg21985079