Learn the procedures for replicating tables between two Adaptive Servers.
isql -Usa -P -STOKYO_DS use pubs2 go sp_help publishers go
isql -Usa -P -STOKYO_DS sp_addlogin pubs2_user, pubs2_pw, pubs2 go
use pubs2 go sp_adduser pubs2_user go grant select on publishers to pubs2_user go
isql -Usa -P -STOKYO_RS create user pubs2_user set password pubs2_pw go grant primary subscribe to pubs2_user go
isql -Usa -P -SSYDNEY_RS create user pubs2_user set password pubs2_pw go grant create object to pubs2_user go
isql -Ujohn -P -STOKYO_RS create replication definition publishers_rep with primary at TOKYO_DS.pubs2 with all tables named 'publishers' (pub_id char(4), pub_name varchar(40), city varchar(20), state char(2)) primary key (pub_id) searchable columns (pub_id, pub_name) replicate minimal columns go
In this example, the user “john” creates the replication definition. This user requires create object permission in TOKYO_RS.
sp_setreptable publishers, 'true' go
isql -Usa -P -SSYDNEY_DS use pubs2 go sp_help publishers go
When you add the replicate pubs2 database using Sybase Central or rs_init, the maintenance user is created and given replication_role. The maintenance user must have replication_role, sa_role, or alias the database owner to replicate truncate table.
grant all on publishers to SYDNEY_DS_maint go
isql -Upubs2_user -Ppubs2_pw -SSYDNEY_RS create subscription publishers_sub for publishers_rep with replicate at SYDNEY_DS.pubs2 subscribe to truncate table go
This subscription uses the default atomic materialization. No where clause is included, so all rows will be replicated. Execution of the truncate table command will be reproduced at the destination database.
check subscription publishers_sub for publishers_rep with replicate at SYDNEY_DS.pubs2 go
isql -Usa -P -STOKYO_DS use pubs2 go insert publishers values ('9950', 'Who Donut', 'Butler', 'CA') go
isql -Usa -P -SSYDNEY_DS use pubs2 go select * from publishers go