Chapter 4. Tutorials for Adaptive Server Anywhere Users

Start replicating data

You now have a replication system in place. In this section, data is replicated from the consolidated database to the remote database, and from the remote to the consolidated database.

Enter data at the consolidated database

First, enter some data into the consolidated database.

To enter data at the consolidated database

1.Connect to the consolidated database hq from the Interactive SQL utility with a user ID of DBA and a password of SQL.

2.Insert two rows into the SalesRep table and commit the insertion by executing the following statement:

INSERT INTO SalesRep (rep_key, name)

VALUES (’rep1’, ’Field User’) ;

INSERT INTO SalesRep (rep_key, name)

VALUES (’rep2’, ’Another User’) ;

COMMIT ;

3.Insert two rows into the Customer table and commit the insertion by executing the following statement:

INSERT INTO Customer (cust_key, name, rep_key)

VALUES (’cust1’, ’Ocean Sports’, ’rep1’ ) ;

INSERT INTO Customer (cust_key, name, rep_key)

VALUES (’cust2’, ’Sports Plus’, ’rep2’ ) ;

COMMIT ;

4.Confirm that the data has been entered by executing the following statements:

SELECT *

FROM SalesRep;

SELECT *

FROM Customer;

The next step is to send the relevant rows to the remote database.

Send data from the consolidated database

To send the rows to the remote database, you must run the Message Agent at the consolidated database. The dbremote program is the Message Agent for Adaptive Server Anywhere.

47

Page 65
Image 65
Sybase DC38133-01-0902-01 manual Start replicating data, Enter data at the consolidated database