Creating an UltraLite database from a SQL Anywhere reference database

A reference database is a SQL Anywhere database that serves as a template for the UltraLite database you are creating. Your UltraLite database is a subset of the columns, tables, and indexes in the reference database. You select these objects as part of a publication in the reference database. You can also choose to include data from your SQL Anywhere database in your new UltraLite database.

Creating a database from a reference database may be useful if you want to first model your data with an architecture tool such as Sybase PowerDesigner.

To create a database from a reference database, use the ulinit utility. See Creating an UltraLite database from a SQL Anywhere reference database and UltraLite Initialize Database utility (ulinit).

 Initialize/extract a new UltraLite database from a reference database (command line)
  1. Create a new SQL Anywhere database as the reference database.

    You can create a new SQL Anywhere database with the dbinit utility or Sybase Central. You can also create a SQL Anywhere database from non-SQL Anywhere databases, by migrating data from these third-party files.

    See SQL Anywhere database creation.

  2. Prepare the reference database by adding objects required by the UltraLite database:

    • Tables and keys   Add the tables and remember to set primary keys as they are required by UltraLite. If you need to, you can also assign foreign key relationships that you need within your UltraLite application. You can use Sybase Central, Sybase PowerDesigner Physical Data Model, or another database design tool. See UltraLite tables and columns.

    • Indexes   An index can improve performance dramatically, particularly on slow devices. Note that primary keys are automatically indexed, but other columns are not. See When to use an index.

    • Publications   If you want to synchronize different tables at different times, use publications. You can use multiple UltraLite publications to define table subsets and set synchronization priority with them. See Publishing data in UltraLite.

    Tip

    If your UltraLite applications frequently retrieve information in a particular order, consider adding an index to your reference database specifically for this purpose. See Use index scans.

  3. Run the ulinit utility, including any necessary options:

    ulinit -a DBF=MySource.db customer.udb -n Pub1 -s Pub2

    In this example, MySource.db is the SQL Anywhere reference database and customer.udb is the UltraLite database that gets created. The tables and indexes will match those contained in the Pub1 and Pub2 publications. A publication for the UltraLite database is created for Pub2.

 See also