That normally happens when you are explicitly naming partitions. Here's an example
SQL> drop table t purge;
Table dropped.
SQL>
SQL> create table t ( x int, y int )
2 partition by range ( x )
3 interval (100)
4 (
5 partition p1 values less than ( 0 )
6 );
Table created.
SQL>
SQL> insert into t
2 select rownum, rownum
3 from dual
4 connect by level <= 1000;
1000 rows created.
SQL>
SQL> commit;
Commit complete.
SQL>
SQL> select partition_name from user_tab_partitions where table_name = 'T';
PARTITION_NAME
---------------------------------
SYS_P18344
SYS_P18343
SYS_P18342
SYS_P18341
SYS_P18340
SYS_P18339
SYS_P18338
SYS_P18337
SYS_P18336
SYS_P18335
SYS_P18334
P1
12 rows selected.
SQL>
SQL> create index IX on T ( y )
2 local
3 (
4 partition p1,
5 partition p2,
6 partition p3,
7 partition p4,
8 partition p5,
9 partition p6,
10 partition p7,
11 partition p8,
12 partition p9,
13 partition p10,
14 partition p11,
15 partition p12
16 )
17 ;
Index created.
So far so good... I created 12 partitions in my table, and I explicitly listed 12 partitions in my index. Now I'll drop the index, and add a new row to the table (which creates another partition )
SQL>
SQL>
SQL> drop index ix;
Index dropped.
SQL>
SQL> insert into t
2 values (2000,2000);
1 row created.
SQL>
SQL>
SQL> create index IX on T ( y )
2 local
3 (
4 partition p1,
5 partition p2,
6 partition p3,
7 partition p4,
8 partition p5,
9 partition p6,
10 partition p7,
11 partition p8,
12 partition p9,
13 partition p10,
14 partition p11,
15 partition p12
16 )
17 ;
create index IX on T ( y )
*
ERROR at line 1:
ORA-14024: number of partitions of LOCAL index must equal that of the underlying table
Now my same DDL does not work, because there are 13 table partitions and I only listed 12 index partitions. The easy workaround is not to list the partitions at all.
SQL>
SQL> create index IX on T ( y )
2 local ;
Index created.
SQL>
SQL>