Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » MobiLink - Getting Started » Tutorial: Using MobiLink with an Oracle 10g Consolidated Database » Lesson 1: Create your databases

Create the Oracle consolidated database Next Page

Set up your consolidated database


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.

Create MobiLink system tables within Oracle
  1. 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.

  2. 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.

  3. To verify that the system tables are installed
    1. Start SQL Plus. Choose Start > Programs > Oracle - OraDb10g_home1 > Application Development > SQL Plus.

    2. 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.

    3. To drop the MobiLink system tables (if necessary)
      1. 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.

      2. 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.

      3. 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.