create table ptest
(
ID VARCHAR2(50) not null,
TIME NUMBER(20)
)
partition by range (TIME)
(
partition P1 values less than (2),
partition P2 values less than (3),
partition P3 values less than (4),
partition P4 values less than (5),
partition Pmax values less than (MAXVALUE)
);
SQL> create unique index orders_global_1_idx
2 on ptest(id)
3 global partition by range (id)
4 (
5 partition P1 values less than (2),
6 partition P2 values less than (3),
7 partition P3 values less than (4),
8 partition P4 values less than (5),
9 partition Pmax values less than (MAXVALUE)
10 );
Index created.
SQL> select partition_name, status from user_ind_partitions where index_name = 'ORDERS_GLOBAL_1_IDX';
PARTITION_NAME STATUS
------------------------------ --------
P1 USABLE
P2 USABLE
P3 USABLE
P4 USABLE
PMAX USABLE
SQL> ALTER TABLE ptest TRUNCATE PARTITION P4;
Table truncated.
SQL> select partition_name, status from user_ind_partitions where index_name = 'ORDERS_GLOBAL_1_IDX';
PARTITION_NAME STATUS
------------------------------ --------
P1 UNUSABLE
P2 UNUSABLE
P3 UNUSABLE
P4 UNUSABLE
PMAX UNUSABLE
SQL>