Replicating DML

Replicate DML.

  1. Log in to the primary database using a user ID that has permission to insert, update, delete and truncate a table. See Replication Server Administration Guide Volme 1 > Manage Database Connections > Manage the Maintenance User for information on how to grant permission to the maintenance user ID.
    Note: Do not use the same maintenance user ID that you have used to set up the primary connection.
  2. In the primary database, insert a row to t1:
    insert into t1 values('a',1,'this is the first row')
    go
  3. Check whether the row exists in the replicate database:
    select * from t1
    go

    If the row does not exist, follow instructions in steps 4 and 5 otherwise, go to step 6.

  4. Check the Replication Server log file at: $SYBASE/REP- 15_5/install/PRS.log. Correct the errors and restart the connection to the replicate database:
    resume connection to rds.rdb
    go
  5. If you want Replication Server to skip any current transaction when trying to resume connection to the replicate database, use:
    resume connection to rds.rdb
    skip transaction
    go

    See the Replication Server Reference Manual > Replication Server Commands > resume connection for other available options for the resume connection command.

  6. Log in to the primary database and update the row:
    update t1 set c = 'this is an update' where b = 1
    go
  7. Log in to the replicate database and verify whether the row exists:
    select * from t1
    go
  8. Log in to the primary database and enter:
    truncate table t1
    go
  9. Log in to the replicate database and enter:
    select count (*) from t1
    go

    The number of rows at the replicate table, t1, should now be zero.