Set up the Replication Server adapter, schema, and source location on
the Replication Server workstation.
Context
These configuration instructions are compatible with source data coming from the
SAPĀ® Adaptive ServerĀ® Enterprise database, as
well as other databases.
Procedure
- Set up the replication system according to the SAP
Replication Server documentation.
- On a machine that can connect to the Replication Server, create a temporary
directory and go to that directory.
- Copy the following scripts from the
$STREAMING_HOME/adapters/repserver/config
directory on the machine where you installed
Event Stream Processor to the temporary directory you just
created.
- Apply these scripts to the Replication Server.
- isql -Usa -SSAMPLE_RS -P -i
srsa_funcstrings.sql
- isql -Usa -SSAMPLE_RS -P -i
srsa_errors.sql
- isql -Usa -SSAMPLE_RS -P -i
srsa_rs_errors.sql
- Using the dsedit utility, add
an entry to the interfaces (sql.ini) file
with the name of the Event Stream Processor
workstation and the port used for the Replication Server adapter connection.
This entry specifies the Replication Server adapter
data server name and TDS
Port in the Replication Server Adapter configuration process. The
port must match the adapter's tdsListenerPort configuration parameter. See Chapter 6: Using dsedit in the SAP Adaptive Server
Enterprise 15.7 Utility Guide for more information on modifying the
interface or sql.ini files. For example, if
the adapter and the Event Streaming Processor are on a workstation named my_workstation and the connection is to be made on
port 5100, use:
[RSadapter]
query=TCP,my_workstation,5100
- Define the user name and password used for this connection within the
Replication Server. This user name must NOT be the same as that of the
administrator user (adminUser) of the Replication Server adapter.
- Connect to the Replication Server using isql.
- Define the user name and password: they must match the
adapter's repConnUser and repConnPasswd configuration
parameters.
create user rsuser
set password rspassword
go
- Create the connection from the Replication Server to the adapter. This must
match the adapter's repSubscriptionServer configuration
parameter. Log in to the Replication Server to create the Replication Server
adapter connection. For example,
create connection to RSadapter.RSadapter
set error class to srsa_error_class
set function string class srsa_function_class
set username rsuser
set password rspassword
set batch to 'off'
with dsi_suspended
go
alter connection to RSadapter.RSadapter
set replication server error class to srsa_rs_error_class
go
Turn off minimal columns,
alter connection to RSadapter.RSadapter
set replicate_minimal_columns to 'off'
go
Note Do not use minimal columns in the repdef.
To enable batching,
alter connection to RSadapter.RSadapter
set batch to 'on'
go
alter connection to RSadapter.RSadapter
set dsi_cmd_separator to ';'
go
- Create the replication definitions. A replication definition specifies the
schema and the source location for a given table or stored procedure.
There is a replication definition for a source table named "TEST" (
create table TEST (ID int, FNAME char(15)), which
is defined on a sourced database located on an Adaptive Server Enterprise server
named
ASEHOST.
create replication definition TESTrep
with primary at ASEHOST.sourcedb
with all tables named 'TEST'
(ID int, FNAME char(15))
primary key (ID)
go
- Mark the Adaptive Server Enterprise source "TEST" table for replication. Log in
to the Adaptive Server Enterprise server, locate the source table "TEST", and
execute:
followed by
command:
sp_setreptable 'TEST', true
go
- Define the subscriptions. Each subscription defines a target for the
information coming through the Replication Server. In the following example, the
target is the Replication Server adapter connection for the Replication Server
adapter located on the Event Stream Processor workstation.
create subscription TESTsub
for TESTrep
with replicate at RSadapter.RSadapter
without materialization
go
Note You must follow the Setting the JAVA_HOME Environment
Variable procedure before using the Replication Server Adapter
with SAP Event Stream Processor
Studio. Doing it now is
recommended.
You may now log off from the Replication Server.