Example: Replicating XMLTYPE Column Data from Oracle to SAP Adaptive Server Enterprise

Replicate XMLTYPE column data from an Oracle primary database to an SAP Adaptive Server Enterprise (SAP ASE) replicate database.

To replicate a table defined by this DDL statement:

CREATE TABLE sampletable
( col1 INT,
  col2 INT,
  xml1 XMLTYPE,
  xml2 XMLTYPE)
XMLTYPE xml1 STORE AS CLOB
XMLTYPE xml2 STORE AS CLOB;
  1. Manually create a replication definition on SAP Replication Server using this RCL command:
    create replication definition ra$xxx_sampletable
    with primary at myprimary.pdb
    with all tables named sampletable (
    col1 int,
    col2 int,
    xml1 as SYS_NC00004$ text,
    xml2 as SYS_NC00006$ text )
    primary key (col1, col2)
    go
    Note: If the Replication Agent pdb_auto_create_repdefs configuration parameter is set to true, a replication definition is created automatically.
  2. Mark the table for replication:
    pdb_setreptable sampletable, mark
  3. Because of the hidden CLOB columns, you must enable replication for the table using pdb_setrepcol:
    pdb_setrepcol sampletable, enable
  4. Create a corresponding table at the replicate SAP ASE database using the hidden column names from the primary database table:
    create table sampletable
    ( col1 int,
    col2 int,
    SYS_NC00004$ text,
    SYS_NC00006$ text)
    go
    Note: The XMLTYPE columns from the Oracle primary database table map to text columns in the SAP ASE replicate database table.