I have two tables in Oracle 11.2. First is partitioned and has local index (non-prefixed):
CREATE TABLE table1 (col1 INT, col2 INT)
PARTITION BY LIST(col1)
(
PARTITION p1 VALUES(1),
PARTITION p2 VALUES(2)
);
CREATE INDEX table1_index on table1(col2) LOCAL;
INSERT INTO table1 VALUES(1, 1);
INSERT INTO table1 VALUES(2, 1);
Second table is similar but without partitions and index:
CREATE TABLE table2(col1 INT, col2 INT);
INSERT INTO table2 VALUES(1, 2);
When I exchange one of partition from table1
with table2
then index for this partition will be unusable. To avoid this I can use UPDATE INDEXES
, so I do:
ALTER TABLE table1 EXCHANGE PARTITION p1
WITH TABLE table2 WITH VALIDATION UPDATE INDEXES;
But UPDATE INDEXES
seem to doesn't work, because when I check status of index for this partition it's unusable.
SELECT partition_name, status FROM user_ind_partitions
WHERE index_name = 'TABLE1_INDEX';
PARTITION_NAME STATUS
------------------------------ --------
P1 UNUSABLE
P2 USABLE
For GLOBAL
index it works as expected.
The question is: does UPDATE INDEXES
work for LOCAL
indexes when using EXCHANGE PARTITION
?