http://goo.gl/EmKxy0

Home > Replication Server, Sybase ASE/REP Interview Questions > Sybase Replication Setup using rs_init on Linux -4

Sybase Replication Setup using rs_init on Linux -4

5. Creating Rep Def , Sub and testing Replication:

a) creating table in the pdb and rdb with name table1

1> use pdb
2> go
1> create table table1 ( col1 int primary key, col2 varchar(10))
2> go

1> use rdb
2> go
1> create table table1 ( col1 int primary key, col2 varchar(10))
2> go

b) Marking the table1 for replication.
1> use pdb
2> go
1> sp_setreptable table1
2> go
The replication status for ‘table1’ is currently false, owner_off.
(return status = 0)
1> sp_setreptable table1,true
2> go
The replication status for ‘table1’ is set to true, owner_off.
(return status = 0)

c) Creating replication Definitation & Sub:

1> create replication definition repdef_pdb_table1
2> with primary at PROD_ASE.pdb
3> with all tables named table1
4> (col1 int, col2 varchar(10))
5> primary key (col1)
6> replicate minimal columns
7>
8> go
Replication definition ‘repdef_pdb_table1’ is created.

1> create subscription repdef_pdb_table1_sub
2> for repdef_pdb_table1
3> with replicate at PROD_ASE.rdb
4> without materialization
5> go
Subscription ‘repdef_pdb_table1_sub’ is in the process of being created.

1> check subscription repdef_pdb_table1_sub
2> for repdef_pdb_table1
3> with replicate at PROD_ASE.rdb
4> go
Subscription repdef_pdb_table1_sub is VALID at the replicate.
Subscription repdef_pdb_table1_sub is VALID at the primary.

Now setup is completed.
d) Testing the data movement :

1> use pdb
2> go
1> insert table1 values(100,’val1′)
2> go
(1 row affected)
1> use rdb
2> go
1> select * from table1
2> go
col1 col2
———– ——————–
100 val1

(1 row affected)
1> use pdb
2> go
1> insert table1 values(101,’val2′)
2> go
(1 row affected)
1> use rdb
2> go
1> select * from table1
2> go
col1 col2
———– ——————–
100 val1
101 val2

(2 rows affected)

Now its working fine and setup is complicated!!

In Next post , I will try to setup the replication without rs_int and will post here.
Till then Happy Sybase Learning! Bye

Check the Sybase Wiki @ sybasewiki.com
  1. No comments yet.
  1. No trackbacks yet.