Testing Replication

When you finish setting up the replication system, test that replication works as intended.

  1. Connect to the primary Adaptive Server instance as a non-maintenance user with the ability to create tables.
  2. At the primary Adaptive Server database, create a table named ptab1 to replicate:
    create table ptab1
    (idno int not null,
    name varchar(20) null)
    go
    sp_primarykey ptab1, idno
    go
    Note: By default, this DDL creates a table with the owner dbo.
  3. Grant permissions to any new or existing object to be replicated in the primary database:
    grant all on ptab1 to public;
  4. Mark the ptab1 table for replication:
    sp_setreptable ptab1, 'true'
    go
  5. At the replicate SAP HANA database instance, create a table named PTAB1:
    CREATE TABLE PTAB1 
    (IDNO INT PRIMARY KEY, 
    NAME VARCHAR(20));
    Note: SAP HANA database is not case-sensitive and uses uppercase characters if lowercase characters are provided.
    If an owner is not specified with the tablename, the owner of the table—<tableowner>—is the user that is signed on at the time the table is created.
  6. Grant permissions to any new or existing object to be replicated in the replicate database so that the Replication Server maintenance user can update this table:
    grant all privileges on PTAB1 to public
  7. Log in to Replication Server:
    isql –Usa –Psa_pass –SSAMPLE_RS
    If you have not set up the sample Replication Server instance, enter your Replication Server instance name in place of SAMPLE_RS.
  8. Create a replication definition against the primary Adaptive Server database.
    To create the ptab1_repdef replication definition for the ptab1 table:
    create replication definition ptab1_repdef
    with primary at pds.pdb
    with primary table named ptab1
    with replicate table named <tableowner>.ptab1
    (idno integer,
    "name" varchar(20))
    primary key (idno)
    go
    where the replicate table on SAP HANA database—ptab1— is owned by <tableowner>, and pds.pdb is the name of the primary connection created earlier.
  9. Create a subscription against the replicate connection.
    To create the ptab1_sub subscription for the ptab1_repdef replication definition:
    create subscription ptab1_sub 
    for ptab1_repdef
    with replicate at rds.rdb
    without materialization
    go
    where rds.rdb is the name of the replicate SAP HANA database connection created earlier.
    For information on using the create subscription command in direct load materialization, see Replication Server Reference Manual.
  10. On the Adaptive Server database, insert data into the primary ptab1 table:
    insert into ptab1
    values (3, "Tom Servo")
    go
  11. On the SAP HANA database, verify that the data replicated to the replicate PTAB1 table:
    SELECT * FROM PTAB1;