Creating Replication Definitions and Subscriptions

Create replication definitions and subscriptions for the tables marked for replication to Sybase IQ after you enable and configure RTL.

  1. Create the repdef_testtab replication definition. Add any required referential constraint clauses to the replication definition to support RTL:
    • Adaptive Server:
      create replication definition repdef_testtab
      with primary at ASE_DS.pdb1
      with primary table named ‘testtab’
      with replicate table named dbo.‘testtab’
      (c1 int, c2 int, c3 char(10))
      primary key(c1)
      go

    • Oracle:
      create replication definition repdef_testtab
      with primary at ORA_DS.pdb1
      with primary table named ‘TESTTAB’
      with replicate table named dbo.‘testtab’
      (C1 as c1 int, C2 as c2 int, C3 as c3 char(10))
      primary key(C1)
      go
      Note: The default character case of Oracle is all upper case for object names. You can convert object names from upper to lower case in the replication definition, as shown in the example, or by using the ltl_character_case Replication Agent for Oracle configuration parameter. See Replication Server Options > Replication Agent Reference Manual > Configuration Parameters > Configuration Parameter Reference > ltl_character_case.
  2. Create subscriptions to match each of the table and stored procedure replication definitions:
    create subscription sub_testtab for repdef_testtab
    with replicate at IQSRVR.iqdb
    go
  3. Verify that testtab is materialized by logging in to Sybase IQ and executing:
    select * from dbo.testtab
    go
    If materialization is successful, you see:
    c1           c2           c3
    ---------    ---------    ---------
    1            1            testrow 1
    2            2            testrow 2
    3            3            testrow 3
    (3 rows affected)