Set up a Multi-Path Replication system with two primary and replicate paths for end-to-end replication from an Adaptive Server primary to a HANA DB replicate.
Use create connection or rs_init to create the default connection. See Replication Server Configuration Guide > Configure Replication Server and Add Databases using rs_init.
sp_config_rep_agent pdb, ‘multithread rep agent’, ‘true’where pdb is the primary Adaptive Server database.
sp_config_rep_agent pdb, 'max number of replication paths', '2'
sp_replication_path "pdb", 'add', "pdb_conn2", "PRS", "muser", "mpwd"where:
PRS is the Replication Server.
muser is the maintenance user.
mpwd is the maintenance user password.
create alternate connection to pds.pdb named pds.pdb_conn2 set error class to rs_sqlserver_error_class set function string class to rs_sqlserver_function_class set username to muser set password to mpwd with primary onlywhere pds is the primary Adaptive Server.
CREATE USER muser PASSWORD mpwd;
[dataservername] master tcp ether hostname port query tcp ether hostname portwhere hostname and port are the host and port number of the HANA DB dataserver, and dataservername is a label used to identify the host and port number.
hdbuserstore set rds myhost:xxxxx my_securestore_user my_securestore_pwdwhere
create connection to rds.rdb using profile rs_ase_to_hanadb;ech set username muser set password mpwd go
create connection to rds.rdb using profile rs_ase_to_hanadb;ech set username auser set password apwd set dsi_connector_sec_mech to "hdbuserstore" go
rds is the replicate HANA DB data server. For a standard connection, this must match the interfaces file entry. For an SAP Secure User Store connection, this must match what you used as the key to create a user store of encrypted credentials with the hdbuserstore utility.
rdb is placeholder: You must provide a value, but it is not used..
muser is the maintenance user for the replicate HANA DB instance.
mpwd is the replicate HANA DB maintenance user password.
auser and apwd are unused values supplied only to satisfy the syntax of the create connection command.
create alternate connection to rds.conn2 using profile rs_ase_to_hanadb;ech set username muser set password mpwd go
create connection to rds.conn2 using profile rs_ase_to_hanadb;ech set username auser set password apwd set dsi_connector_sec_mech to "hdbuserstore" go
sp_setreptable ptab1,'true' go sp_setreptable ptab2,'true' go
sp_config_rep_agent pdb, ‘multipath distribution model’, 'object’
sp_replication_path pdb, 'bind', "table", "dbo.ptab2", "pdb_conn2"
create replication definition ptab1_repdef with primary at pds.pdb with all tables named 'ptab1' ... goTo create the ptab2_repdef replication definition for the ptab2 table:
create replication definition ptab2_repdef with primary at pds.pdb with all tables named 'ptab2' ... go
create subscription ptab1_sub for ptab1_repdef with replicate at rds.rdb without materialization go
create subscription ptab2_sub for ptab2_repdef with replicate at rds.conn2 without materialization go