Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?

Index Corruption HADR environment

Posted on 2017-04-30
0
Medium Priority
?
30 Views
Last Modified: 2017-07-31
Hello,

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
Thanks
0
Comment
Question by:Tarek Zidane
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
0 Comments

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Join & Write a Comment

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

719 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