Example: Replicating an XMLTYPE Table from Oracle to Oracle

Replicate an XMLTYPE table from an Oracle primary database to an Oracle replicate database.

This statement creates a simple XMLTYPE table with one implicit CLOB column that can be accessed through a default pseudocolumn named XMLDATA:

CREATE TABLE sampletable OF XMLTYPE;

To replicate a table defined by this DDL statement:

  1. Manually create a replication definition on Replication Server using this RCL command and the hidden column SYS_NC_OID$, which contains the object ID for sampletable:
    create replication definition ra$xxx_sampletable
    with primary at myprimary.pdb
    with all tables named sampletable (
    SYS_NC_OID$ rs_oracle_binary,
    XMLDATA text )
    primary key (SYS_NC_OID$)
    go

    The Replication Server name for the Oracle RAW datatype is rs_oracle_binary.

    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. Create a corresponding table at the replicate Oracle database:
    CREATE TABLE sampletable OF XMLTYPE;