Replicating UDDs

To replicate user-defined datatypes in Oracle, the datatype specified in the replication definition must be rs_rs_char_raw. If you are using Replication Server 15.1 or earlier, see “Replication Server and RSSD scripts” first.

StepsCreating a datatype definition in Replication Server

To create the datatype requires Replication Server administrator privileges or granted permission.

  1. Log in to the RSSD.

  2. Add a row to the rs_datatype table using the following example as a guide:

    /*  rs_oracle_udd_raw - char with no delimiters */
    insert into rs_datatype values(
    0,                   /* prsid */
    0x0000000001000008,  /* classid */
    'rs_oracle_udd',     /* name */
    0x0000000000010210,  /* dtid */
    0,                   /* base_coltype */
    255,                 /* length */
    0,                   /* status */
    1,                   /* length_err_act */
    'CHAR',              /* mask */
    0,                   /* scale */
    0,                   /* default_len */
    '',                  /* default_val */
    0,                   /*-delim_pre_len-*/
    '',                  /* delim_pre */
    0,                   /*-delim_post_len-*/
    '',                  /* delim_post */
    0,                   /* min_boundary_len */
    '',                  /* min_boundary */
    3,                   /* min_boundary_err_act */
    0,                   /* max_boundary_len */
    '',                  /* max_boundary_err_act */
    0                    /* rowtype */
    )
    go
    
  3. You must restart Replication Server after adding a new type.

  4. In Replication Server, test the new type:

    admin translate, 'The quick brown fox jumped over the lazy dog.', 'char(255)', 'rs_oracle_udd'
    
    go
    
    Delimiter Prefix   Translated                  Value Delimiter Postfix
    
    ----------------------------------------------------------------------
    
    NULL               The quick brown fox jumped over the lazy dog.  NULL
    

The new type has been defined correctly if the sentence was translated correctly.

Example

The following example demonstrates how to create a replication definition, using the rs_rs_char_raw type defined in Replication Server. The following Oracle table and type definitions are used in the example:

create replication definition use_name_t_repdef
with primary at ra_source_db.ra_source_ds
with all tables named 'USE_NAME_T'
(
   PKEY int,
   PNAME rs_rs_char_raw
)
primary key (PKEY)
searchable columns (PKEY)
go

NoteThe ltl_character_case must be upper for this example.