Index Corruption HADR environment


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
Tarek ZidaneAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.