This section describes the configuration steps required for replication from the primary database. It includes:
Creating a Replication Server connection to the primary database
Creating a database replication definition
Creating the database replication subscription
Creating a Replication Server connection to the primary database
Go to the $SYBASE/RAX-15_2/scripts/sybase (UNIX or Linux) or %SYBASE%\RAX-15_2\scripts\sybase (Windows) directory.
Make a copy of the rs_create_test_primary_connection.sql script named my_udb_rs_create_test_primary_connection.sql.
Before executing the my_udb_rs_create_test_ primary_connection.sql script against your Replication Server, change all occurrences of value {rax}.{test} to the name of the Replication Server connection between it and Replication Agent for UDB, where:
rax is the name of the data server of the primary IBM DB2 Universal Database.
test is the name of the primary IBM DB2 Universal Database.
For example, NY.NYudb9.
Save these values to be used later for the rs_source_ds and rs_source_db parameters in the Replication Agent ibmudb.rs file.
Change sys and sys_pwd to the user ID and password of the IBM DB2 Universal Database user who must have permission to apply DML operations against all user tables to be replicated, where:
sys is the user ID of the IBM DB2 Universal Database user (sys).
sys_pwd is the password of the IBM DB2 Universal Database user (change_on_install).
This user must be a valid user in the IBM DB2 Universal Database.
The following command creates a Replication Server connection to the primary database example:
create connection to NY.NYudb9
set error class rs_sqlserver_error_class
set function string class rs_udb9_function_class
set username sys
set password change_on_install
with log transfer on, dsi_suspended
go
Execute this script in Replication Server:
isql –Usa –P –SSAMPLE_RS -i my_udb_rs_create_test_primary_connection.sql
A message appears that indicates the Replication Server connection to the primary database has been created.
Creating the database replication definition
Navigate to the $SYBASE/RAX-15_2/script/sybase (UNIX or Linux) or %SYBASE%\RAX-15_2\script\sybase (Windows) directory.
Make a copy of the rs_create_test_db_repdef.sql script named my_udb_rs_create_test_db_repdef.sql.
Before executing the my_udb_rs_create_test_db_repdef.sql script, change the value of {pds}.{pdb} to the name of the connection string you defined for the primary database, where:
pds is the name of the data server of the primary IBM DB2 Universal Database.
pdb is the name of the primary IBM DB2 Universal Database.
For example, NY.NYudb9.
Save these values to be used later for the rs_source_ds and rs_source_db parameters in the Replication Agent ibmudb.rs file.
This is a database replication definition example:
create database replication definition NY_repdef1
with primary at NY.NYudb9
go
Connect to the Replication Server and enter:
isql -Usa -P –SSAMPLE_RS -i my_udb_rs_create_test_db_repdef.sql
A message appears that indicates the database replication definition has been created.
Creating the database replication subscription
Make a copy of the rs_create_test_db_sub.sql script named my_udb_rs_create_test_db_sub.sql.
Before executing the my_udb_rs_create_test_db_sub.sql script, change the {pds}.{pdb} and {rds}.{rdb} to the appropriate connection name, where:
pds is the name of the data server of the primary IBM DB2 Universal Database.
pdb is the name of the primary IBM DB2 Universal Database.
rds is the DirectConnect service name.
rdb is any valid identifier. Sybase recommends that you use the IBM DB2 Universal Database replicate database name.
Save these values to be used later in the Replication Agent ibmudb.rs file.
Here is an example of create database replication subscription:
create subscription NY_sub1
for database replication definition NY_repdef1
with primary at NY.NYudb9
with replicate at DCService.udb_db
without materialization
go
Connect to Replication Server and execute:
isql -Usa -P –SSAMPLE_RS -i my_udb_rs_create_test_db_sub.sql
A message appears that indicates the subscription is being created.