Heterogeneous Mapping

Replication Server supports datatype translation and mapping between data servers of a different type or version.

Replication Server provides default support for datatypes on the primary database that have a datatype of matching length, scale, range and interpretation on the replicate database. Primary datatypes that have no match on the replicate database are supported but require customization.

Default Mapping

If there is no difference between the primary and replicate datatype—as in mapping Oracle CHAR to HANA DB char—or if the replicate datatype exceeds the limits of the primary—as in mapping Oracle CHAR to HANA DB varchar—Replication Server makes no special adjustment.

If the only difference between the primary and replicate datatype is in semantics or scale—as in mapping Adaptive Server datetime to HANA DB timestamp—Replication Server performs default class-level translations to match the primary datatype value to that of the replicate database.

Custom Mapping

For replication between data servers of a different type or version, Replication Server provides no default mapping for primary datatypes that have no match on the replicate database. You must provide custom mapping if:
  • The length, precision, or range of the replicate datatype is narrower than that of the primary datatype and may result in the truncation of data.
  • The replicate data server has no datatype with the same purpose as that of the primary datatype—for example, intervals, sequences, XML types, or spatial types on the primary have no equivalent datatypes on the replicate data server.
You can customize the Replication Server mapping and attempt to replicate from one datatype at the primary database to a different datatype at the replicate database by:
  • altering the published datatype for a column in the replication definition, or
  • using custom function strings
Note: Be sure you fully understand the capabilities of these customization features and your business objectives before customizing the mapping behavior.
One way to alter the published datatype is by using the map to clause in a replication definition. For example, to map an Oracle column named col2 of type INTERVAL to a HANA DB column of type varchar:
col2 rs_oracle_interval map to varchar
To preview the expected results of this mapping, use the Replication Server admin translate command:
1> admin translate, '+000000005 01:01:01.000000000', rs_oracle_interval, 'varchar(40)' 
2> go
Delimiter Prefix  Translated Value               Delimiter Postfix 
----------------  -----------------------------  ----------------- 
'                 +000000005 01:01:01.000000000  ' 

See Replication Server Administration Guide Volume 1 > Getting Started with Translating Datatypes > Create Column-Level Translations.