Replicating data in partitioned tables
The CDC Replication Engine for Sybase databases supports partitioned tables. If you want to replicate a partitioned table, you can create a standard subscription and replicate the table by mapping sub-partitions of the base table on the source to a partitioned or non-partitioned table on the target.
The following combinations are supported for mapping partitioned tables:
- Replicating from a source partitioned table to a target partitioned table
- You map sub-partitions of the base partitioned table on the source to sub-partitions of the base partitioned table on the target. This method is like mapping normal tables on the source and target.
- Replicating from a source partitioned table to a target non-partitioned table
- You map sub-partitions of the base partitioned table on the source to a regular table on the target.
- During mapping, on the target side select a non-partitioned table for the source sub-partitions.
- Any DELETE or TRUNCATE operations on the target table should be done for only the first table mapping in the refresh order to avoid truncation on the target table and data loss.
- After mapping, select Do Not Delete for all other sub-partition table mappings except the first one in refresh order in the tab of Management Console.
- Replicating from a source non-partitioned table to a target partitioned table
- You map a regular table on the source to a base partitioned table on the target. This method is like mapping normal tables on the source and target. The target database takes care of routing the rows to appropriate sub-partitions.
Considerations
- Data in newly attached partitions cannot be replicated automatically. Doing so requires the data in the sub-partition to be refreshed manually by creating a new mapping. If you are mapping a newly added sub-partition to a regular, non-partitioned table on the target, select Do Not Delete for this mapping in the tab of Management Console to avoid truncation on the target table and data loss.
- Adding or dropping of partitions is not supported and must be performed as a planned DDL activity. Sybase does not support DDL awareness. These DDL operations are not detected and they do not cause the subscription to stop.