Rename an Index Partition example
In oracle database to rename an index partition you must use the command alter index with RENAME PARTITION keyword.
-- create Range-Partitioned Global Index
CREATE INDEX amount_idx ON orders (amount)
GLOBAL PARTITION BY RANGE (amount)
(PARTITION part_1 VALUES LESS THAN (1000),
PARTITION part_2 VALUES LESS THAN (2000),
PARTITION part_3 VALUES LESS THAN (MAXVALUE));
-- rename Index Partition
ALTER INDEX amount_idx
RENAME PARTITION part_1
TO p1;
Output:
index AMOUNT_IDX created.
index AMOUNT_IDX altered.
Check partitions
select INDEX_NAME, PARTITION_NAME, PARTITION_POSITION from USER_IND_PARTITIONS WHERE INDEX_NAME='AMOUNT_IDX';
Output:
| INDEX_NAME | PARTITION_NAME | PARTITION_POSITION |
|---|---|---|
| AMOUNT_IDX | P1 | 1 |
| AMOUNT_IDX | PART_2 | 2 |
| AMOUNT_IDX | PART_3 | 3 |