Table exists elsewhere in the database

If the table exists on the default segment or some other segment in the database, follow these steps to move the data to the partition and distribute it evenly:

  1. If the table is already partitioned, but has a different number of partitions than the number of devices on the target segment, unpartition the table.

    See “alter table...unpartition Syntax”.

  2. Partition the table, matching the number of devices on the target segment.

    See “alter table...partition syntax”.

  3. If a clustered index exists, drop the index. Depending on how your index was created, use either drop index or alter table...drop constraint.

    See “Using drop index and create clustered index” or alter table...drop constraint and “Using constraints and alter table”.

  4. Create or re-create the clustered index with the on segment_name clause. When the segment name is different from the current segment where the table is stored, creating the clustered index performs a parallel sort and distributes the data evenly on the partitions as it copies the rows to match the index order. This step re-creates the nonclustered indexes on the table.

    See “Distributing data evenly across partitions”.

  5. If you do not need the clustered index, you can drop it.

  6. Dump the database.