# Compare Schemas flags includes all indexes if PK missing

**URL:** <https://forums.toadworld.com/t/compare-schemas-flags-includes-all-indexes-if-pk-missing/39288>\
**Category:** Toad for Oracle - Beta\
**Created:** [April 4, 2017, 6:16am UTC](https://forums.toadworld.com/t/compare-schemas-flags-includes-all-indexes-if-pk-missing/39288 "2017-04-04T06:16:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjesse](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/rjesse/32/156_2.png) [@rjesse](https://forums.toadworld.com/u/rjesse)\
**Post date:** [April 4, 2017, 6:16am UTC](https://forums.toadworld.com/t/compare-schemas-flags-includes-all-indexes-if-pk-missing/39288/1 "2017-04-04T06:16:26Z")

</div>

Howdy,

In 12.11.0.62 Compare-\>Schemas, I have Constraints-\>PK, Indexes, and Grants checked with 30k+ differences (copying an ERP schema metadata). I noticed that even if a table has its indexes but the PK constraint is missing, all indexes are flagged to be created. On a 100K line script, that creates a LOT of ORA-955s. My script got blown away, but I also believe that it attempted to create all indexes twice – once for the indexes and another for the PK.

I think this is workaroundable by doing two compares. First, run with just the indexes, then run another with indexes and PKs, but deselecting the indexes on the script sync. If the PKs are selected without the indexes, the script has them incorrectly created, missing the “USING INDEX mytab.myindex” part.

Thanks!  
Rich

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [April 4, 2017, 8:47am UTC](https://forums.toadworld.com/t/compare-schemas-flags-includes-all-indexes-if-pk-missing/39288/2 "2017-04-04T08:47:46Z")

</div>

Hi Rich,

I can reproduce that and will look at it. Another workaround is to also compare tables. In that case, my sync script just adds the constraints and counts the indexes as a match.

-John

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [April 4, 2017, 9:48am UTC](https://forums.toadworld.com/t/compare-schemas-flags-includes-all-indexes-if-pk-missing/39288/3 "2017-04-04T09:48:05Z")

</div>

Should be fixed next beta.

---

<div class="post-metadata">

**Author:** ![rjesse](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/rjesse/32/156_2.png) [@rjesse](https://forums.toadworld.com/u/rjesse)\
**Post date:** [April 4, 2017, 11:28am UTC](https://forums.toadworld.com/t/compare-schemas-flags-includes-all-indexes-if-pk-missing/39288/4 "2017-04-04T11:28:24Z")

</div>

Awesome! Thanks, John!
