After you have installed datatype definitions, Replication Server database objects, function strings, and class-level translations, you must create a database connection to the replicate database. Replication Server uses database connections to specify how it connects to a database and how it handles the information it sends to and receives from the database.
To create a database connection for a non-Sybase replicate database, log in to the replicate Replication Server and execute a database connection script that invokes the Replication Server create connection to command.
Creating a database connection for a non-Sybase replicate database
Sample scripts are provided for each non-Sybase database supported by HDS. The following databases and connection scripts are supported by HDS in Replication Server version 15.0.1:
Database
Script
ASA
hds_asa_connection_sample.sql
DB2
hds_db2_connection_sample.sql
Informix
hds_informix_connection_sample.sql
Microsoft SQL Server
hds_msss_connection_sample.sql
Oracle
hds_oracle_connection_sample.sql
UDB
hds_udb_connection_sample.sql
Identify the sample script you need, then edit the database connection sample script for the database you want to use as a replicate database.
Modify create connection to to specify the name of the database gateway server and the name of the replicate database:
create connection to rbds.rdb
where:
rdbs – is the service name of the database gateway for the replicate database.
rdb – is the database name of the replicate database, in the format service.database.
Modify set username to specify the user ID of the Replication Server maintenance user for the replicate database; where rs_maint_user is the user ID of the Replication Server maintenance user for the replicate database:
set username rs_maint_user
Modify set password to specify the password of the Replication Server maintenance user for the replicate database, where rs_maint_user_ps is the password of the replicate Replication Server maintenance user for the replicate database:
set password rs_maint_user_ps
The Replication Server maintenance user ID must be granted update permission on the replicate database.
Modify [with log transfer on] [, dsi_suspended] to set up the database connection for the intended use of the database.
If the database is to be used as a bidirectional database (both a primary and a replicate), enable only the log transfer on option:
with log transfer on
If the database is to be used as a primary database only, enable both the log transfer on option and the dsi_suspended option:
with log transfer on, with dsi_suspended
If the database is to be used as a replicate database only, enable only the log transfer off option:
with log transfer off
With a user ID sa permission in the replicate Replication Server to execute the database connection script, log in to the Replication Server host machine or a machine with a network connection to the replicate Replication Server host machine.
In this procedure, isql is used as the Open Client application to access the replicate Replication Server. You can use any Open Client application to access the replicate Replication Server.
At the operating system prompt, enter:
isql -Uuser -Ppw -Sserver -Drepsvr -iscript_name
where:
user – is the user ID with sa permission in the replicate Replication Server.
pw – is the password for the user ID.
server – is the name of the replicate Replication Server host machine.
repsvr – is the server name of the replicate Replication Server.
script_name – is the name of the database connection script file that you edited.
After you create the Replication Server database connection to the replicate database, verify the database side of the connection by using the user ID and password you specified for the Replication Server maintenance user, to log in to the replicate database and select data from tables in the database.