The automatic list partitioning method enables list partition creation on demand.
An auto-list partitioned table is similar to a regular list partitioned table, except that this partitioned table is easier to manage. You can create an auto-list partitioned table using only the partitioning key values that are known. As data is loaded into the table, the database automatically creates a new partition if the loaded partitioning key value does not correspond to any of the existing partitions. Because partitions are automatically created on demand, the auto-list partitioning method is conceptually similar to the existing interval partitioning method, more info
Create a table
create table automatic_List_Partitioned (
id integer,
state varchar2(20)
)
partition by list (state) automatic
(
PARTITION p_tunis values ('TUNIS')
);
Note: First partition named “p_tunis” with the value of “TUNIS”
Insert rows
insert into automatic_List_Partitioned values (1,'Sidi Bouzid');
insert into automatic_List_Partitioned values (2,'Hania');
We have added to rows with different “state” values, and automatically Oracle server create a new two partitions:
Enjoy !