Table of Contents

Search

  1. Preface
  2. Data Replication Overview
  3. Understanding Data Replication
  4. Sources - Preparation and Replication Considerations
  5. Targets - Preparation and Replication Considerations
  6. Starting the Server Manager
  7. Getting Started with the Data Replication Console
  8. Defining and Managing Server Manager Main Servers and Subservers
  9. Creating and Managing User Accounts
  10. Creating and Managing Connections
  11. Creating Replication Configurations
  12. Materializing Targets with InitialSync
  13. Scheduling and Running Replication Tasks
  14. Implementing Advanced Replication Topologies
  15. Monitoring Data Replication
  16. Managing Replication Configurations
  17. Handling Replication Environment Changes and Failures
  18. Troubleshooting
  19. Data Replication Files and Subdirectories
  20. Data Replication Runtime Parameters
  21. Command Line Parameters for Data Replication Components
  22. Updating Configurations in the Replication Configuration CLI
  23. DDL Statements for Manually Creating Recovery Tables
  24. Sample Scripts for Enabling or Disabling SQL Server Change Data Capture
  25. Glossary

Datatype Conversion Rules

Datatype Conversion Rules

The
DataReplication_installation
\uiconf\DataTypes.xml file defines rules that Data Replication uses to convert source datatypes to compatible target datatypes.
The conversion occurs when Data Replication generates target schema based on source schema or other target schema and when Data Replication replicates CREATE TABLE, ADD COLUMN, and MODIFY COLUMN changes.
The
DataReplication_installation
\uiconf\DataTypes.xml file contains a <ConversionRule> section for each combination of supported source and target types. The <ConversionRule> sections define the datatype conversion rules. You can edit the rules or add rules if necessary.
To understand how conversion rules are defined, review the following example <ConversionRule> sections in the DataTypes.xml file:
  • Example 1.
    The following <ConversionRule> section defines a rule for converting the Oracle NUMBER datatype, which has a precision greater than 18 and a scale equal to 0, to the Netezza NUMERIC datatype with the same precision and scale:
    <ConversionRule source_db="ORACLE" destination_db="NETEZZA"> <DataTypes> <DataType> <OriginalDataType>NUMBER</OriginalDataType> <Condition><![CDATA[DataPrecision>18 && DataScale==0]]></Condition> <DataPrecision>DestinationDataPrecision=DataPrecision</DataPrecision> <DataScale>DestinationDataScale=DataScale</DataScale> <DestinationDataType>NUMERIC</DestinationDataType> </DataType> </DataTypes> </ConversionRule>
  • Example 2.
    The following <ConversionRule> section defines a rule for converting the Oracle VARCHAR datatype to the Teradata VARCHAR datatype:
    <ConversionRule source_db="ORACLE" destination_db="TERADATA"> </DataTypes> <DataType> <OriginalDataType>VARCHAR</OriginalDataType> <DestinationDataType>VARCHAR</DestinationDataType> <Calculation>DestinationDataSize=(DataSize+SrcMinCharsetSize-1)/SrcMinCharsetSize*TgtCharsetSize</Calculation> </DataType> </DataTypes> </ConversionRule>
    If the character sets of the source and target CHAR columns do not match, the target column size in bytes might differ from the source column size. In this case, Data Replication uses the following formula to calculate the target column size:
    DestinationDataSize=(DataSize+SrcMinCharsetSize-1)/SrcMinCharsetSize*TgtCharsetSize
    SrcMinCharsetSize
    is the minimum number of bytes per character for the source character set.
    TgtCharsetSize
    is the number of bytes per character for the target character set. Data Replication gets the
    SrcMinCharsetSize
    and
    TgtCharsetSize
    values from the
    DataReplication_installation
    \uiconf\ICU_table.xml file.
    Data Replication uses the formula that is defined by the
    Calculation
    parameter only if the character sets of the source and target columns do not match.
To add a conversion rule, add a <DataType> section under the <ConversionRule> section for the source and target type combination in the
DataReplication_installation
\uiconf\DataTypes.xml file. The <DataType> section has the following syntax:
<DataType> <OriginalDataType>
source_column_datatype
</OriginalDataType> <Condition>
rule_condition
<Condition> <DestinationDataType>
target_column_datatype
</DestinationDataType> </DataType>
Replace the
source_column_datatype
,
rule_condition
, and
target_column_datatype
variables with the appropriate values.

0 COMMENTS

We’d like to hear from you!