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 Create an UltraLite database from a SQL Anywhere reference database and UltraLite Initialize Database utility (ulinit).
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 Creating a SQL Anywhere database.
Configure the database with UltraLite usage in mind The UltraLite database is generated with the same settings as those in the reference database. By setting the following options in the reference database, you also control the behavior of your UltraLite database:
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 Working with 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 Publications in UltraLite.
If your UltraLite applications frequently retrieve information in a particular order, consider adding an index to your reference database specifically for this purpose. See Using index scans.
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.
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |