Index Corruption HADR environment

Posted on 2017-04-30
Medium Priority
Last Modified: 2017-07-31

We have an index corruption Issue at (HADR environment ) founded into db2diag of primary caused crash , this corruption occurred on primary. I've decided to

1-takeover on standby as no page corruption there and deactivated primary to avoid this corruption moved to standby
2-backup (new primary ) and drop db on old primary
3-restore on old primary (standby) , then working successfully

but doesn't know what the root cause of this page corruption I faced this issue twice during 40 days. My suspect is maybe index not building at true bases, even db2support hadn't got particularity more details they said maybe application code

Is there any way to ensure an index is working fine or not?
As my understanding, there are many flavors of index-related corruption problems, for instance:

Unique index contains duplicates with different RID(s) or same RID(s)
Multiple index entries pointing to the same RID
Index key is out of place (wrong index key order)
Row exists, but index keys do not exist in any or some of the indexes
Index entry pointing to an empty data slot or unused data slot or RID is invalid
Incorrect previous or next index page pointers, incorrect high key or other corruptions on index pages

And if this happens again, is there any different method unless backup and restore?

I found This maybe can be a solution could you  please give me your thoughts  can i do this as a solution ???

REORG the corrupted indexes or mark the index as bad by using the db2dart option /MI.  When completed, rebuild it by accessing
the table.

I found some solutions here also i can provide

Depending on when index corruption was detected, we had 2 ways to solve the problem

1. During crash recovery

1.1 db2stop force

1.2 db2dart <dbname> /MI /TSI 2 /OI 2

1.3 db2 update dbm cfg using indexrec access

1.3 db2start

1.4 db2 connect to <dbname>

1.5 db2 "select tabschema, tabname from syscat.tables where tbspaceid=2 and tableid=2"

1.6 db2 "select count(*) from <tabschema>.<tabname>" ---> this will trigger an index rebuilding

2. When database is accessable

2.1 get the tabschema and tabname from syscat.table

db2 "select tabschema, tabname from syscat.tables where tbspaceid=2 and tableid=2"

2.2 db2 reorg indexes all for table <tabschema>.<tabname>

Please give me your recommendations
Question by:Tarek Zidane

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Join & Write a Comment

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
When you have multiple client accounts to manage, it often feels like there aren’t enough hours in the day. With too many applications to juggle, you can’t focus on your clients, much less your growing to-do list. But that doesn’t have to be the cas…
Watch the video of Kernel Migrator for SharePoint, which demonstrate the process easily of migration from SharePoint to SharePoint, OneDrive for Business & Google Drive servers, Public Folder to SharePoint, File Server to SharePoint. The tool has va…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question