In this lesson, data is replicated from the consolidated database(hq) to the remote database (field).
If you are not currently connected to the consolidated database (hq), run the following command:
dbisql -c "UID=DBA;PWD=sql;SERVER=server_hq;DBF=c:\tutorial\hq.db" |
Execute the following statements to add sample data to the SalesReps and Customers tables:
INSERT INTO SalesReps ( rep_key, name ) VALUES ( 'rep3', 'Example User' ); INSERT INTO Customers ( cust_key, name, rep_key ) VALUES ( 'cust3', 'Land Sports', 'rep1' ); INSERT INTO Customers ( cust_key, name, rep_key ) VALUES ( 'cust4', 'Air Plus', 'rep2' ); COMMIT; |
Execute the following statements to confirm that the data has been entered:
SELECT * FROM SalesReps; SELECT * FROM Customers; |
To send the rows to the remote database (field), run the Message Agent on the consolidated database (hq).
At the consolidated database (hq) run the Message Agent from the c:\tutorial directory:
dbremote -c "UID=DBA;PWD=sql;SERVER=server_hq;DBF=c:\tutorial\hq.db" |
This command assumes that the consolidated database (hq) is currently running on the default server. If the database is not running, you must supply a DBF parameter with the database file name instead of the DBN parameter.
When the Message Agent window displays Execution Completed
, click Shutdown.
Browse to c:\tutorial\field.
A file named hq.0 is listed in the directory. This file contains the changes sent from the consolidated database (hq).
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |