When you finish setting up the replication system, test that replication works as intended.
use pubs2 go create table ptab1 (idno int not null, name varchar(20) null) go sp_primarykey ptab1, idno go
grant all on ptab1 to public go
sp_setreptable ptab1, 'true' go The replication status for 'ptab1' is set to true, owner_off.
insert into ptab1 values (1, "Burt Gringlesby") insert into ptab1 values (2, "Douglas Wong") insert into ptab1 values (3, "Tom Servo") insert into ptab1 values (4, "Innes del Castillo") insert into ptab1 values (5, "Akiko Yokomoto") go
CREATE TABLE PTAB1 (IDNO INT PRIMARY KEY, NAME VARCHAR(20))
grant all privileges on PTAB1 to public
isql –Usa –Psa_pass –SSAMPLE_RSIf you have not set up the sample Replication Server instance, enter your Replication Server instance name in place of SAMPLE_RS.
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) gowhere the replicate table on SAP HANA database—ptab1— is owned by <tableowner>, and sunak1502i.pubs2 is the name of the primary connection created earlier.
create subscription ptab1_sub for ptab1_repdef with replicate at rds.rdb without holdlock direct_load user puser password ppwd gowhere:
check subscription ptab1_sub for ptab1_repdef with replicate at rds.rdb go
If there are errors, see Troubleshooting Subscription Problems.
insert into ptab1 values (10, "Michel DeFrance") insert into ptab1 values (11, "Dirk Stringer") go
check subscription ptab1_sub for ptab1_repdef with replicate at rds.rdb go Subscription ptab1_sub is VALID at the replicate.
SELECT * FROM PTAB1