IBM Support

db2 Backup database fails with SQL1655C

Troubleshooting


Problem

db2 backup online or offline of a database fails with SQL1655C.

Symptom

db2 backup online or offline of a database fails with SQL1655C.

Example of backup commands:

db2 "backup db sample to /db2backup/sample"
or
db2 "backup db sample online to /db2backup/sample"

fails with:

SQL1655C The operation could not be completed due to an error accessing data
on disk. SQLSTATE=58030

Cause

This can be caused by corruption within the database on data pages.

Diagnosing The Problem

Checking the db2diag.log you can see the following:



2016-11-16-14.06.36.679367-360 E1860777A448 LEVEL: Info
PID : 17367238 TID : 2829 PROC : db2sysc
INSTANCE: db2inst1 NODE : 000 DB : SAMPLE
APPHDL : 0-7 APPID: *LOCAL.db2inst1.161116200635
AUTHID : DB2INST1
EDUID : 2829 EDUNAME: db2agent (SAMPLE)
FUNCTION: DB2 UDB, database utilities, sqlubSetupJobControl, probe:1619
MESSAGE : Starting an offline db backup.

2016-11-16-14.36.59.936818-360 I1861226A3856 LEVEL: Severe
PID : 17367238 TID : 7198 PROC : db2sysc
INSTANCE: db2inst1 NODE : 000 DB : SAMPLE
APPHDL : 0-7 APPID: *LOCAL.db2inst1.161116200635
AUTHID : DB2INST1
EDUID : 7198 EDUNAME: db2bm.2829.0 (SAMPLE)
FUNCTION: DB2 UDB, buffer pool services, sqlb_verify_page, probe:2
MESSAGE : ZRC=0x86020001=-2046689279=SQLB_BADP "page is bad"
DIA8400C A bad page was encountered.
DATA #1 : String, 64 bytes
Error encountered trying to read a page - information follows :
DATA #2 : String, 23 bytes
Page verification error
DATA #3 : Page ID, PD_TYPE_SQLB_PAGE_ID, 4 bytes
60500
DATA #4 : Object descriptor, PD_TYPE_SQLB_OBJECT_DESC, 88 bytes
Obj: {pool:1;obj:131;type:0} Parent={1;131}

...
2016-11-16-14.37.08.021590-360 I1878513A578 LEVEL: Severe
PID : 17367238 TID : 7198 PROC : db2sysc
INSTANCE: db2inst1 NODE : 000 DB : SAMPLE
APPHDL : 0-7 APPID: *LOCAL.db2inst1.161116200635
AUTHID : DB2INST1
EDUID : 7198 EDUNAME: db2bm.2829.0 (SAMPLE)
FUNCTION: DB2 UDB, buffer pool services, sqlbReadPage, probe:1199
MESSAGE : ZRC=0x86020001=-2046689279=SQLB_BADP "page is bad"
DIA8400C A bad page was encountered.
DATA #1 : <preformatted>
Converting to non-critical read error

This shows we have Data corruption(type = 0) on page 60500 in the object ID 131 in pool/tablespace ID 1. Notice that the EDUNAME is db2bm, which is an EDU used by the backup command.

Resolving The Problem


Find out the schema/table name for this object:
db2 connect to SAMPLE
db2 "SELECT TBSPACEID TablespaceID, TABLEID ObjectID, SUBSTR(TABSCHEMA,1,30) TABSCHEMA, SUBSTR(TABNAME,1,30) TABNAME FROM SYSCAT.TABLES WHERE TABLEID = 131 AND TBSPACEID = 1"
db2 "SELECT SUBSTR(TABSCHEMA,1,30) TABSCHEMA, SUBSTR(TABNAME,1,30) TABNAME, TBSPACEID TablespaceID, TABLEID ObjectID FROM SYSCAT.TABLES WHERE TABLEID = 131 AND TBSPACEID = 1"
db2 "SELECT SUBSTR(TABSCHEMA,1,30) TABSCHEMA, SUBSTR(TABNAME,1,30) TABNAME, TBSPACEID TablespaceID, TABLEID PARTITIONOBJECTID FROM SYSCAT.DATAPARTITIONS WHERE TBSPACEID = 131 AND PARTITIONOBJECTID = 1"
db2 connect reset
db2 terminate

Check Whole Database:
db2dart SAMPLE /DB /RPT . /RPTN SAMPLE.rpt
or
db2 connect to SAMPLE
db2 INSPECT CHECK DATABASE INDEXDATA RESULTS KEEPSAMPLE.IPT
db2 connect reset
db2 terminate
cd /home/db2inst1/sqllib/db2dump
db2inspf SAMPLE.IPT SAMPLE.fmt

Check Single Table:
db2dart SAMPLE /T /TSI 1 /OI 131 /RPT . /RPTN SAMPLE_p1_o131.rpt
or
db2 connect to SAMPLE
db2 INSPECT CHECK TABLE TBSPACEID 1 OBJECTID 131 FOR ERROR STATE ALL INDEXDATA RESULTS KEEP SAMPLE_p1_o131.IPT
db2 connect reset
db2 terminate
cd <db2dump location>
db2inspf SAMPLE_p1_o131.IPT SAMPLE_p1_o131.fmt

NOTE: db2dart requires the database to be offline. INSPECT can be run with the database online and users connected.

You can look to use the following to extract/rebuild this table:

How to extract data from a corrupted table using db2dart
http://www-01.ibm.com/support/docview.wss?uid=swg21509964

How to extract data if your DB2 LUW database becomes corrupted
http://www-01.ibm.com/support/docview.wss?uid=swg21290737

If the page is an Index page you could look to mark the Index as BAD, Drop/Create the Indexes or run REORG on the table:

Mark Table BAD:
db2dart <DATABASE> /MT /TSI <tablespace id> /OI <object id>

Perform Index REORG:
db2 connect to SAMPLE
db2 REORG INDEXES ALL FOR TABLE <schema>.<name> ALLOW NO ACCESS
db2 connect reset
db2 terminate

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

Document Information

Modified date:
16 June 2018

UID

swg21994711