When you finish setting up the replication system, test that replication works as intended.
Connect to the primary IBM DB2 Universal
Database instance as a regular user, rather than as the maintenance user. Make
sure the regular user also exists in the replicate database.
To connect to the database
with CLP, use:
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 a test table in the primary database:
create table T1( a int, b char(10))
Grant permissions to any new or existing object
to be replicated in the primary database:
grant all on T1 to public
Connect to the replicate IBM DB2 Universal
Database instance as a regular user, rather than as the maintenance
user.
Create a test table in the replicate database:
create table T1( a int, b char(10))
Grant permissions to any new or existing object
to be replicated in the replicate database, so that the Replication
Server maintenance user can update this table:
grant all on T1 to public
Connect to the Replication Agent and resume replication:
resume
Mark the table:
pdb_setreptable T1, mark
After the table is marked and the Replication
Agent is in a replicating state, insert test data into the test
table and commit it.
By default, the work performed by the maintenance user of
the primary connection is not replicated. The user ID used to insert
transactions cannot be the same as the maintenance user defined
in the primary connection.
Use your preferred IBM DB2 Universal Database
query tool to examine the replicate site for results and compare
the contents of your test table from both the primary and replicate
sites.