Sybase SQL Remote DC38133-01-0902-01 User Manual

Page of 485
Introduction
This chapter presents a tutorial to lead you through setting up a SQL Remote
installation. The installation replicates data between an Adaptive Server
Enterprise database (the consolidated database) and an Adaptive Server
Anywhere database (the remote database).
Goals
In the tutorial you act as the system administrator of a consolidated Adaptive
Server Enterprise database, and set up a simple replication system. The
replication system consists of a simple sales database, with two tables.
The consolidated database holds all of the database, while the remote
database has all of one table, but only some of the rows in the other table.
The tutorial takes you through the following steps:
Creating a consolidated database on your Adaptive Server Enterprise
server.
Creating a file-sharing replication system with a single Adaptive Server
Anywhere remote database.
Replicating data between the two databases.
The database
The tutorial uses a simple two-table database. One table holds information
about sales representatives, and the other about customers. The tables are
much simpler than you would use in a real database; this allows us to focus
just on those issues important for replication.
Database schema
The database schema for the tutorial is illustrated in the figure.
rep_key =
rep_key
SalesRep
rep_key
char(5)
name
char(40)
Customer
cust_key
char(10)
name
char(40)
rep_key
char(5)
Features to note include the following:
Each sales representative is represented by one row in the SalesRep table.
Each customer is represented by one row in the customer table.
Each customer is assigned to a single Sales representative, and this
assignment is built in to the database as a foreign key from the Customer
54