Previous Topic: Add a Series of PartitionsNext Topic: Add a Specific Partition


Set Up Rolling Partitions

In a typical partitioning scheme, you periodically run a purge operation to purge the oldest partition and add a new partition. The prototype is shown below:

wgn_partition_tables
  (new_partition_date_range IN VARCHAR2,
  date_range_to_purge IN VARCHAR2,
  perm_data_date_range IN VARCHAR2);

Where:

new_partition_date_range

Is the end date of the new partition.

By default, the date format must be dd-mmm-yyyy (for example, 08-mar-2011).

date_range_to_purge

Is the end date of the partition to purge. Date formats are as above.

perm_data_date_range

Is the end date of the partition to purge. Date formats are as above.

num_partitions

Specifies the number of partitions you want to create.

num_days_per_partition

Is the number of days in each partition.

Example

The following command creates a new partition starting 31 January 2011 and purges the partition 31 January 2010:

SQL> EXEC wgn_partition_util.wgn_roll_partitions 
  (new_partition_date_range =>'31-jan-2011',
  date_range_to_purge=>'31-jan-2010');