MobiLink comes with a script called syncora.sql, located in the MobiLink\setup subdirectory of your SQL Anywhere installation. You run this script to set up your Oracle database to work with MobiLink.
Syncora.sql contains SQL statements, written in Oracle SQL, to prepare Oracle databases for use as consolidated databases. It creates a series of MobiLink system tables, triggers, and procedures for use by MobiLink. The system tables are prefaced with ML_. MobiLink uses these tables during the synchronization process.
Start SQL Plus. Choose Start > Programs > Oracle - OraDb10g_home1 > Application Development > SQL Plus.
Connect to your Oracle database using Oracle SQL Plus. Log on using the system schema with password manager.
Run syncora.sql by typing the following command:
@path\syncora.sql;
where path is the MobiLink\setup subdirectory of your SQL Anywhere 10 installation. If there are spaces in your path, enclose the path and file name in quotation marks.
Start SQL Plus. Choose Start > Programs > Oracle - OraDb10g_home1 > Application Development > SQL Plus.
Run the following SQL statement to yield a listing of the MobiLink system tables, procedures, and triggers:
SELECT object_name FROM all_objects WHERE object_name LIKE 'ML_%';
If there are no objects starting with ML_, the procedure you just completed was not successful. In this case, you need to review the MobiLink error messages to see what went wrong; correct the problem; and then drop the MobiLink system tables as follows.
Run the following SQL statement in SQL Plus:
select 'drop ' || object_type || ' ' || object_name || ';' from all_objects where object_name like 'ML_%';
This statement generates a list of tables, procedures, and triggers to be dropped.
Copy this list to a text file and save it as drop.sql in your OracleTut directory. Remove any lines that do not contain drop statements.
Execute the SQL statements in drop.sql by running the following command:
@path\OracleTut\drop.sql;
Replace path with the location of your OracleTut directory. Run drop.sql a second time to delete tables that were not removed the first time because of dependencies.
You can now repeat the instructions in Create MobiLink system tables within Oracle, above.
For more information about setting up an Oracle consolidated database, see Oracle consolidated database.