When you finish setting up the replication system, test that replication works as intended.
CONNECT TO dbalias USER db2_user USING db2_user_ps
where dbalias is the cataloged alias of the primary database, db2_user is the primary database user, and db2_user_ps is the password.
CREATE TABLE PTAB1 (IDNO INTEGER NOT NULL, NAME VARCHAR(20), PRIMARY KEY(IDNO))
grant all on PTAB1 to public
pdb_setreptable PTAB1, mark go
1> rs_create_repdef ptab1 2> go Table/Procedure Name RepDef Name Status --------------------- -------------- -------- <DB2TableOwner>.PTAB1 "<repdefname>" Created (1 row affected)Record the name of the replication definition for use later.
CREATE TABLE <tableowner>.PTAB1 (IDNO INT PRIMARY KEY, NAME VARCHAR(20));case sensitive
grant all privileges on <tableowner>.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.
alter replication definition <repdefname> with replicate table named <tableowner>.ptab1 go
create subscription ptab1_sub for <repdefname> with replicate at rds.rdb without materialization gowhere <repdefname> is the replication definition that you altered in the previous step, and rds.rdb is the name of the replicate SAP HANA database connection created earlier.
INSERT INTO PTAB1 (IDNO, NAME) VALUES (6, 'Dr. Forrester'); COMMIT;
SELECT * FROM <tableowner>.PTAB1;