The rs_init utility is a Replication Server utility that can add an Adaptive Server database to a replication system, as either a primary or replicate database. When adding a replicate database, rs_init does the following:
Creates a Replication Server DSI thread connection for the replicate database
Creates a Replication Server Maintenance User ID for the replicate database
Creates tables and procedures in the replicate database to support replication
To support the same functionality for a non-Sybase replicate database, Replication Server provides sample scripts. These scripts are located in the $SYBASE/$SYBASE_RS/scripts directory.
To use these scripts, you must perform the following steps manually:
At the replicate database:
Create a Maintenance User ID, with permissions required to update and execute all replicate transactions.
Execute the hds_xxx_setup_for_replicate.sql script.
This script creates the rs_info and rs_lastcommit tables in the replicate database.
This script includes grant statements that need to be changed before execution to reference the correct name of the Maintenance User ID defined in the Replication Server connection. The Maintenance User ID must have update authority to the rs_info and rs_lastcommit tables.
Sybase recommends using the Maintenance User ID to execute this
script.
At the Replication Server System Database (RSSD):
Execute the hds_xxx_udds.sql script.
This script adds the user-defined datatypes (UDDs), which define the attributes of the replicate database native datatypes to the Replication Server RSSD. These datatype definitions are required to ensure that datatypes received from primary database transactions are properly formatted for application to the replicate database. You may need to modify the script to reference the correct RSSD database name.
Execute the hds_xxx_funcstrings.sql script.
This script replaces several default Replication Server function strings with custom function strings designed to communicate with the replicate database and access the tables and procedures created by the hds_xxx_setup_for_replicate.sql script. These function strings are added to the Replication Server rs_xxx_function_class. You may need to modify the script to reference the correct RSSD database name.
If you use older function strings that were supplied
for DB2 in a version of Replication Server prior to 12.0, do not run
the hds_db2_setup_for_replicate.sql script
because the existing rs_db2_function_class
function strings will be replaced.
Execute the class-level translation scripts.
Class-level translations identify primary database native datatypes and the replicate database native datatypes the data should be translated into. For example, Oracle DATE should be translated to DB2 TIMESTAMP.
Class-level translations impact Replication Server performance. Only the translations that are needed should be applied to the RSSD. The following scripts are an example for DB2:
hds_clt_ase_to_db2.sql – translations for Adaptive Server datatypes to DB2 datatypes.
hds_clt_informix_to_db2.sql – translations for Informix datatypes to DB2 datatypes.
hds_clt_msss_to_db2.sql – translations for Microsoft SQL Server datatypes to DB2 datatypes.
hds_clt_oracle_to_db2.sql – translations for Oracle datatypes to DB2 datatypes.
At the replicate Replication Server:
Execute the hds_xxx_connection_sample.sql script.
This script provides a template for creating the Replication Server connection for a replicate database, using the default database-specific function-string class provided with Replication Server. Before executing the script, the template must be modified to include your actual replicate data server name, database name, and Maintenance User ID.
The Replication Server create connection command
uses the dsi_sql_data_style option,
even for DB2. If you use this option, you effectively turn off datatype
translations for that connection. The dsi_sql_data_type option
remains available in Replication Server for backward compatibility
only.