Creating the Replication Definition in Replication Server

Create the table replication definition in the Replication Server. A replication definition describes the data that can be replicated for a table or stored procedure defined in the primary database. RepConnector supports replication of DML commands and stored procedures.

Prerequisites
Mark primary tables or stored procedures for replication. You must know the Adaptive Server® name and database name in which the primary table resides.
Task
  1. Record this information on your worksheet:
    • Primary data server name (in 3.k)

    • Primary database name (in 3.j)

    • Table names and column field names

  2. Create the table replication definition:
    create replication definition
         <replication_definition_name>
    with primary at
         <dataserver>.<database>
    with all tables named '<table_name>'
    ( <column_name> <column_datatype>,
         …)
    primary key (<column name>,..))
    searchable columns (<column_name>,..)
    where:
    • replication_definition_name is the name for the replication definition.

    • dataserver is the name of the server containing the primary data (3.k).

    • database is the name of the database containing the primary data (3.j).

    • table_name is the name of the primary table containing the data.

    • column_name is the column name from the primary table.

    • column_datatype is the datatype for the column name.

    • primary key is a primary key, or a set of primary keys, defined in the table.

    For example:

    create replication definition authors_rep
    with primary at primary_ase.pubs2
    with all tables name 'authors' (
         au_id varchar(11),
         au_lname varchar(40),
         au_fname varchar(20),
         phone char(12),
         address varchar(40),
         city varchar(20),
         state char(2),
         country varchar(12),
         postalcode char(10))
    primary key (au_id)
    searchable columns(au_id)

For more information about create replication definition, see the Replication Server Administration Guide and the Replication Server Reference Manual.