I have Oracle 12c database and partitioned table. There is a old partition which has 68734MB which is 27% of total.
I need to drop this partition. This is a production database and I does not have a downtime window for this.
I want to know if I drop this partition, will the indexes of this table be unusable or rebuild ? What would be the best strategy to drop this partition with minimum impact on the live traffic?
Best Answer
When you drop one or more partitions, local indexes are also dropped. You need to rebuilt Global indexes unless the
UPDATE INDEXES
orUPDATE GLOBAL INDEXES
clause is specified in theALTER TABLE DROP PARTITION
statement.For example, I have a table called
TBL1
with range partition and global indexes.As you can see, if I specify
UPDATE GLOBAL INDEXES
clause, Global indexes don't become unusable.After dropping the partition, indexes entries belongs to those partitions remain. When a query uses these indexes, they simply ignore such entries(orphaned). You can clean up such orphaned entries in your regular maintenance window. Details are also given in the following documentations.
Documentation: