Create an UltraLite database from a SQL Anywhere reference database by running the ulinit utility with the -a option. The new database is created with the same settings as those in the reference database where possible.
The SQL Anywhere reference database acts as a database template, and uses the following settings to create an UltraLite database schema:
You can include data, and choose the columns, tables, and indexes as part of a publication in the reference database.
Prior to running the ulinit utility, consider if the following reference database tasks are required:
Add the tables and set primary keys as needed. You can also assign foreign key relationships that you need within your UltraLite application.
Indexes can improve performance dramatically, particularly on slow devices. Primary key columns are automatically indexed, but other types of columns are not.
Use synchronization publications to synchronize different tables at different times. You can use multiple synchronization publications to define table subsets and set the synchronization priority with them.
For example, if a column in the SQL Anywhere database includes a clause that UltraLite does not support, the default value is ignored and the UltraLite default is specified for the new database.
UltraLite uses the name of the collation sequence that is defined in the reference database. You can still choose to use UTF-8 to encode the database by setting the utf8_encoding property.
To see a list of collations and corresponding codepages supported by UltraLite, run ulinit with the -Z option at a command prompt. If the reference database uses a collation sequence that is not supported, such as UCA for CHAR collation sequences, change the collation sequence to one that is supported by performing the following steps:
Use the Unload utility to unload the SQL Anywhere reference database.
Create a new SQL Anywhere database with a different collation and run the reload.sql script through Interactive SQL.
The following command creates a new UltraLite database named customer.udb from an existing SQL Anywhere reference database defined in the MySADb data source. Tables in the reference database are defined in TestPublication. The created UltraLite database contains all the same database options and tables contained in TestPublication, and is encrypted with the mykey encryption key.
ulinit -a "DSN=MySADb;UID=JimmyB;PWD=secret" -n TestPublication -k mykey customer.udb
The following command creates a new UltraLite database named customer.udb from an existing SQL Anywhere database named MySource.db. The tables and indexes in the created database match those contained in the Pub1 schema publication. The Pub2 synchronization publication is created in the UltraLite database.
ulinit -a DBF=MySource.db;UID=JimmyB;PWD=secret customer.udb -n Pub1 -s Pub2