Oracle Partition Existing Table: ALTER TABLE Guide

To create partitions on an existing table, you need to use the ALTER TABLE statement and specify the partition key. Here is an example:

ALTER TABLE table_name
MODIFY
   PARTITION BY RANGE (column_name)
   (
      PARTITION partition_name_1 VALUES LESS THAN (value_1),
      PARTITION partition_name_2 VALUES LESS THAN (value_2),
      ...
   );

In this example, table_name represents the name of the table to be partitioned, column_name is the column used for partitioning, value_1, value_2, and so on define the partition ranges, and partition_name_1, partition_name_2, and so on represent the names of the partitions to be created.

After executing the above command, existing tables will be repartitioned based on the specified partition range values and partition names.

bannerAds