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

Page of 485
Introduction
These tutorials describe how to set up a simple SQL Remote replication
system using Adaptive Server Anywhere.
Goals
In the tutorials, you act as the system administrator of a consolidated
Adaptive Server Anywhere 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 tutorials take you through the following steps:
Creating a consolidated database on your Adaptive Server Anywhere
server.
Creating a file-sharing replication system with a single Adaptive Server
Anywhere remote database.
Replicating data between the two databases.
The database
The tutorials use 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 tutorials 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
table to the SalesRep table. The relationship between the Customer table
and the SalesRep table is many-to-one.
28