SQL> SQL> -- What happen to global, local indexes when a partition is truncated? SQL> SQL> drop table part_range_hash; drop table part_range_hash * ERROR at line 1: ORA-00942: table or view does not exist SQL> SQL> create table part_range_hash (c1 number(3), c2 varchar2(2), c3 char(1)) 2 partition by range (c1) 3 subpartition by hash (c3) 4 (partition p1 values less than (100) 5 (subpartition p1_d1, 6 subpartition p1_d2, 7 subpartition p1_d3), 8 partition p2 values less than (200) 9 (subpartition p2_d1, 10 subpartition p2_d2, 11 subpartition p2_d3), 12 partition p3 values less than (maxvalue) 13 (subpartition p3_d1, 14 subpartition p3_d2, 15 subpartition p3_d3) 16 ); Table created. SQL> SQL> create index part_range_hash_pk on part_range_hash(c1,c3) local; Index created. SQL> create index part_range_hash_global on part_range_hash(c2); Index created. SQL> SQL> alter table part_range_HASH add constraint part_range_HASH_pk primary key (c1, c3); Table altered. SQL> insert into part_range_HASH values(50, 'a', 'a'); 1 row created. SQL> insert into part_range_HASH values(150, 'b', 'b'); 1 row created. SQL> insert into part_range_HASH values(250, 'b', 'c'); 1 row created. SQL> commit; Commit complete. SQL> SQL> alter table part_range_HASH truncate partition p1; Table truncated. SQL> SQL> -- Global index becomes unusable SQL> select index_name, index_type, uniqueness, status, partitioned from user_indexes 2 where table_name='PART_RANGE_HASH'; INDEX_NAME INDEX_TYPE UNIQUENES STATUS ------------------------------ --------------------------- --------- -------- PAR --- PART_RANGE_HASH_GLOBAL NORMAL NONUNIQUE UNUSABLE NO PART_RANGE_HASH_PK NORMAL NONUNIQUE N/A YES SQL> -- Local index remain usable SQL> select partition_name, subpartition_name, status 2 from user_ind_subpartitions where index_name='PART_RANGE_HASH_PK'; PARTITION_NAME SUBPARTITION_NAME STATUS ------------------------------ ------------------------------ -------- P1 P1_D1 USABLE P1 P1_D2 USABLE P1 P1_D3 USABLE P2 P2_D1 USABLE P2 P2_D2 USABLE P2 P2_D3 USABLE P3 P3_D1 USABLE P3 P3_D2 USABLE P3 P3_D3 USABLE 9 rows selected. SQL> SQL> -- As long as the global index is unusable, no DML is possible. SQL> insert into part_range_HASH values(50, 'a', 'a'); insert into part_range_HASH values(50, 'a', 'a') * ERROR at line 1: ORA-01502: index 'SH.PART_RANGE_HASH_GLOBAL' or partition of such index is in unusable state SQL> insert into part_range_HASH values(350, 'b', 'c'); insert into part_range_HASH values(350, 'b', 'c') * ERROR at line 1: ORA-01502: index 'SH.PART_RANGE_HASH_GLOBAL' or partition of such index is in unusable state SQL> SQL> -- Unless you skip the unusable "non-unique" indexes SQL> alter session set skip_unusable_indexes=true; Session altered. SQL> insert into part_range_HASH values(50, 'a', 'a'); 1 row created. SQL> insert into part_range_HASH values(350, 'b', 'c'); 1 row created. SQL> commit; Commit complete. SQL> SQL> -- rebuild the global index SQL> alter index part_range_hash_global rebuild; Index altered. SQL> SQL> drop table part_range_hash; Table dropped. SQL> alter session set skip_unusable_indexes=false; Session altered. SQL> SQL> spool off