IBM Support

DB2 HADR Standby database shuts down after encountering a bad log for reuse

Troubleshooting


Problem

When DB2 databases are set up for High Availabilty Disaster Recovery, db2 transactional log records are sent to Standby database from Primary database. These log records first are received on Standby memory buffer from where then they are written to disk into db2 transactional log files to be replayed on Standby database. Standby uses existing old db2 transactional log files on its active log path for reuse and rename. There is no archiving on Standby database. Hence for any reason, Standby encounters a bad log for reuse/rename, Standby db shuts down instead of ignoring it and moving to the next available old log file. This behaviour has been changed starting from DB2 v10.1 FP6 and up. Standby database will ignore the corrupted db2 transactional log file needed for reuse and will move to next available good log file and continue syncing with Primary instead of shutting down. These are the error messages seen in db2diag.log: 2016-09-26-00.00.54.974932-240 I23168030A475 LEVEL: Severe PID : 2032018 TID : 28529 PROC : db2sysc 0 INSTANCE: db2inst1 NODE : 000 DB : SAMPLE EDUID : 28529 EDUNAME: db2hadrs (SAMPLE) 0 FUNCTION: DB2 UDB, High Availability Disaster Recovery, hdrAddLogFiles, probe:10109 RETCODE : ZRC=0x8610000D=-2045771763=SQLP_BADLOG "Log File cannot be used" DIA8414C Logging can not continue due to an error. 2016-09-26-00.00.54.975442-240 I23168506A480 LEVEL: Severe PID : 2032018 TID : 28529 PROC : db2sysc 0 INSTANCE: db2inst1 NODE : 000 DB : SAMPLE EDUID : 28529 EDUNAME: db2hadrs (SAMPLE) 0 FUNCTION: DB2 UDB, High Availability Disaster Recovery, hdrSPrepareLogWrite, probe:10330 RETCODE : ZRC=0x8610000D=-2045771763=SQLP_BADLOG "Log File cannot be used" DIA8414C Logging can not continue due to an error. 2016-09-26-00.00.54.976206-240 I23168987A467 LEVEL: Error PID : 2032018 TID : 28529 PROC : db2sysc 0 INSTANCE: db2inst1 NODE : 000 DB : SAMPLE EDUID : 28529 EDUNAME: db2hadrs (SAMPLE) 0 FUNCTION: DB2 UDB, High Availability Disaster Recovery, hdrEduS, probe:20745 RETCODE : ZRC=0x8610000D=-2045771763=SQLP_BADLOG "Log File cannot be used" DIA8414C Logging can not continue due to an error. 2016-09-26-00.00.54.976718-240 I23169455A367 LEVEL: Warning PID : 2032018 TID : 28529 PROC : db2sysc 0 INSTANCE: db2inst1 NODE : 000 DB : SAMPLE EDUID : 28529 EDUNAME: db2hadrs (SAMPLE) 0 FUNCTION: DB2 UDB, High Availability Disaster Recovery, hdrEduS, probe:20342 MESSAGE : Info: Standby Finished.

Symptom

Standby database shuts down which causes HADR database pair disconnect and be out of synce and constant error messages in db2diag.log

Cause

The cause of this issue is corrupted log files which got bad for some reason.

Diagnosing The Problem

To diagnose this issue, user can check db2diag.log messages for the following:

2016-09-26-00.00.54.974932-240 I23168030A475 LEVEL: Severe
PID : 2032018 TID : 28529 PROC : db2sysc 0
INSTANCE: db2inst1 NODE : 000 DB : SAMPLE
EDUID : 28529 EDUNAME: db2hadrs (SAMPLE) 0
FUNCTION: DB2 UDB, High Availability Disaster Recovery, hdrAddLogFiles,
probe:10109
RETCODE : ZRC=0x8610000D=-2045771763=SQLP_BADLOG "Log File cannot be
used"
DIA8414C Logging can not continue due to an error.

Resolving The Problem

To resolve this issue:

1. Deactivate Standby database:

db2 deactivate database <dbname>

2. Remove the corrupted db2 transactional log file from Standby active log path

3. Copy good db2 transactional log files from Primary archive or active log path to Standby active log path

4. Re-active Standby database:

db2 active database <dbname>

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"High Availability - HADR","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;10.1","Edition":"Advanced Enterprise Server;Advanced Workgroup Server;Enterprise Server","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21992294