Parameters

Specifies the partition instances being merged. You must specify at least two partitions, and you can specify a maximum of three partitions.

If you specify two partitions, the first partition is the "start" partition, and the second is the "end" and implicit the "target" partition. All adjacent partitions between the start and end are merged into the end partition.

If you specify three partitions, the first partition is the "start" partition, and the second is the "end", and the third partition is the "target" partition. All adjacent partitions between the start and end are merged into the target partition.

useindex index-name

Specifies the name of the index to use when scanning the table during the merge. The index must be an active local index, specifying a global index is not supported. If not specified, PARTITIONMANAGE MERGE attempts to locate a unique, partition-aligned index.

recs numrecs

The number of records to merge in one transaction, and the number of records to delete in one transaction for the second phase of the merge operation. If not specified, numrecs defaults to 100.

PARTITIONMANAGE MERGE is used to combine the records from one or more adjacent partitions into one table partition. Use PARTITIONMANAGE MERGE when you need to combine partitions for simplification or storing historical data in one larger partition. For example, if data was partitioned by month, you could merge all the months from a prior year into one partition.

When the merge operation begins, the source partition is inaccessible to the language clients. When a table partition is merged, the records, LOB fields, and local index partitions of the table partition instance are moved to the appropriate target partition, and global indexes are updated.

During the second phase of PARTITIONMANAGE MERGE, the source table partition storage object and partition policy detail record are deleted.

PARTITIONMANAGE MERGE expects the merge source partitions to be adjacent; non-adjacent partitions cannot be merged. After a merge, the target partitions maintains the upper bound of the merged partitions. The target partition spans the range of the merged partitions.

Partitions that are in any rebuilding state (from another utility) cannot be merged.

During the execution of PARTITIONMANAGE MERGE, if the target partition has an active index that is inactive in a source partition, the merge creates index entries for the records in the merged target partition. If a source partition index is active, but inactive in the target partition, no index entries are created in the merged target partition.

If PARTITIONMANAGE MERGE does not successfully complete, re-executing the command completes the merge, from the last committed transaction.

If db-name is a UTF-8 database, you must specify -cpinternal UTF-8 on the command line. If not specified, an error message is generated and PARTITIONMANAGE MERGE exits.