Corrupt index not detected by analyze table validate structure cascade

Pretty wild stuff. This was in 11.2.0.3.9, EE…

SQL> select * from dcspp_order_rel where order_id = 'EXP1439962334' and sequence_num = 5;

ORDER_ID                                 RELATIONSHIPS                            SEQUENCE_NUM
---------------------------------------- ---------------------------------------- ------------
EXP1439962334                            r406622317                                          5

SQL> select * from dcspp_order_rel where order_id = 'EXP1439962334' and sequence_num = 7;

ORDER_ID                                 RELATIONSHIPS                            SEQUENCE_NUM
---------------------------------------- ---------------------------------------- ------------
EXP1439962334                            r406622317                                          5

SQL> analyze table dcspp_order_rel validate structure online;

Table analyzed.

SQL> analyze table dcspp_order_rel validate structure cascade online;

Table analyzed.

SQL> select * from dcspp_order_rel where order_id = 'EXP1439962334' and sequence_num = 5;

ORDER_ID                                 RELATIONSHIPS                            SEQUENCE_NUM
---------------------------------------- ---------------------------------------- ------------
EXP1439962334                            r406622317                                          5

SQL> select * from dcspp_order_rel where order_id = 'EXP1439962334' and sequence_num = 7;

ORDER_ID                                 RELATIONSHIPS                            SEQUENCE_NUM
---------------------------------------- ---------------------------------------- ------------
EXP1439962334                            r406622317                                          5

SQL> alter table dcspp_order_rel drop constraint dcspp_order_rel_p;

Table altered.

SQL> drop index dcspp_order_rel_p;

Index dropped.

SQL> create unique index atg_core_prod.dcspp_order_rel_p on dcspp_order_rel (order_id, sequence_num)
  2    tablespace core_index_compressed parallel 16;

Index created.

SQL> alter table dcspp_order_rel add constraint dcspp_order_rel_p primary key(order_id, sequence_num) using index;

Table altered.

SQL> select * from dcspp_order_rel where order_id = 'EXP1439962334' and sequence_num = 7;

no rows selected

SQL> select * from dcspp_order_rel where order_id = 'EXP1439962334' and sequence_num = 5;
EXP1439962334                            r406622317                                          5

SQL>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.