This lesson assumes you have completed all preceding lessons. See Lesson 1: Designing the schemas.
In the remote schema, each remote database represents one salesperson. The synchronization scripts you wrote included logic that instructed the MobiLink server to download a subset of data based on the remote ID of the remote database. You must set the database's remote ID to the value of a valid salesperson identifier.
You must complete this step before the first synchronization because when the remote device synchronizes for the first time, it downloads all information related to the chosen salesperson.
Choose a valid salesperson identifier:
Connect as the SYS user with SYSDBA privileges using the Oracle SQL Plus application. At a command prompt, run the following command:
sqlplus SYS/your-password-for-sys as SYSDBA
To view a list of valid salesperson identifiers in the ORDERS table, execute the following statement:
SELECT COUNT( SALES_REP_ID ), SALES_REP_ID FROM OE.ORDERS GROUP BY SALES_REP_ID;
In this example, the remote database represents a salesperson with a SALES_REP_ID of 154.
To exit Oracle SQL Plus, run the following command:
To set the database's remote ID to a value of 154, run the following command:
dbisql -c "SERVER=remote_eng;DBN=remote_db;UID=DBA;PWD=sql" "SET OPTION PUBLIC.ml_remote_id='154';"
dbisql is the application used to execute SQL commands against a SQL Anywhere database.
ENG specifies the database server name remote_eng.
DBN specifies the database name remote_db.
UID is the user name used to connect to your remote database.
PWD is the password used to connect to your remote database.
SET OPTION PUBLIC.ml_remote_id='154' is the SQL statement used to set the remote ID to a value of 154.
Proceed to Lesson 10: Synchronizing.
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1|