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

SQL Anywhere 17 » UltraLite - Database Management and Developer Guide » UltraLite database reference » UltraLite utilities

UltraLite Initialize Database utility (ulinit)

Creates a new UltraLite database.

This utility functions under one of the following modes:

  • Empty mode

    Creates an empty database with characteristics specified with the command line arguments.

  • Extract mode

    Creates a database based on a SQL Anywhere database.

    An initial schema is created that matches tables and indexes in the SQL Anywhere reference database. Many of the reference database characteristics are extracted and used in the new UltraLite database.

Syntax
ulinit options dbname 
Option Description
@ data Use this to read in options from the specified environment variable or configuration file. If both exist with the same name, the environment variable is used.

-a "keyword=value;..."

OR

--SAconnect="keyword=value;..."

Sets the utility to extract mode and connects to an existing database using the specified connection parameters.

If this option is not present, the utility creates a new database using the specified connection parameters (empty mode).

-c

OR

--case

Empty mode.

Enforce case sensitivity on all string comparisons.

-d

OR

--datacopy

Extract mode.

For each table in the new UltraLite database, copy data from the corresponding table in the SQL Anywhere database. The new database is initially empty unless you use this option.

By default, this data is not be uploaded in subsequent synchronizations. To include the data in the next upload synchronization, use -i with -d.

--date_format=format

Empty mode.

Sets the format for dates retrieved from the database.

--date_order=date-format-interpretation

Empty mode.

Sets the interpretation of the date format.

-e value

OR

--fips=value

Empty mode.

On or off, 1 or 0, and so on. This option controls the use of FIPS-certified AES encryption.

-f

OR

--exactschema

Extract mode.

Fail if exact schema is not supported in UltraLite; otherwise, warnings will appear if schema differs.

-g id

OR

--databaseid=id

Set the initial global database ID to the INTEGER value you assign. This initial value is used with a partition size for new rows that have global autoincrement columns. When deploying an application, you must assign a different range of identification numbers to each database for synchronization with the MobiLink server.

-i

OR

--insertforupload

Extract mode.

Use with -d. Include inserted rows in the next upload synchronization. By default, rows inserted by this utility are not uploaded during synchronization.

--identity-file=file Specify the file containing the client TLS, PEM, or PKCS12 identity.
--identity-password=password Specify the password for the client TLS identity.

-k key

OR

--key=key

Extract mode.

Specify the encryption key for an encrypted database.

-K

OR

--prompt

Empty mode.

Specify that you want to be prompted for the encryption key.

-l filename

OR

--sql=filename

Extract mode.

Log DDL database schema creation SQL statements, as executed, to the specified file.

--log=filename

Empty mode.

Log operations to the specified file.

-m filename

OR

--mirror_file=filename

Extract mode.

Specify the database mirror file.

--max_hash_size=size

Empty mode.

Sets the default index hash size in bytes.

-n pubname

OR

--publication=pubname

Extract mode.

Required. Add tables to the UltraLite database schema.

pubname specifies a publication in the reference database. Tables in the publication are added to the UltraLite database.

Specify the option multiple times to add tables from multiple publications to the UltraLite database. To add all tables in the reference database to the UltraLite database, specify -n*.

--nearest_century=yy

Empty mode.

Controls the interpretation of two-digit years in string-to-date conversions.

-o value

OR

--obfuscate=value

Empty mode.

On or off, 1 or 0, and so on. Controls whether data in the database is obfuscated. Obfuscation is not secure against skilled and determined attempts to gain access to the data.

-p size

OR

--page_size= size

Empty mode.

Specify the database page size.

--precision=precision

Empty mode.

Specifies the maximum number of digits in decimal point arithmetic results.

-q

OR

--quiet

Set the utility to run in quiet mode. Suppress informational banners, version numbers, and status messages. Error messages and warnings are still displayed, however.

-r size

OR

--reserve_size

Database connection only.

Reserve size.

-s pubname

OR

--sync_publication

Extract mode.

Create a publication in the UltraLite database with the same definition as pubname in the reference database. Publications are used to configure synchronization. Supply more than one -s option to name more than one synchronization publication.

The tables in this publication must be included in a publication listed by the -n option.

If -s is not supplied, the UltraLite remote database has no named publications.

-S checksum_level

OR

--checksum_level=checksum_level

Empty mode.

0, 1, or 2. Specifies the checksum level validation on database pages.

--scale=scale

Empty mode.

Specifies the minimum number of digits after the decimal point when an arithmetic result is truncated to the maximum precision.

-t file

OR

--rootcert=file

Specify the file containing the trusted root certificate. This certificate is required for server authentication.

--time_format=format

Empty mode.

Sets the format for times retrieved from the database.

--timestamp_format=format

Empty mode.

Sets the format for timestamps retrieved from the database.

--timestamp_increment=increment

Empty mode.

Determines how the timestamp is truncated in UltraLite.

--timestamp_with_time_zone_format=

format

Empty mode.

This option sets the format for TIMESTAMP WITH TIME ZONE values retrieved from the database.

-u <uid>,<pwd>

OR

--dba=<uid>,<pwd>

Database connection only.

Specify the user ID and password.

--utf8_encoding=value

Empty mode.

On or off, 1 or 0, and so on. Encodes data using the UTF-8 character set format, 8-bit multibyte encoding for Unicode.

-w

OR

--nowarnings

Extract mode.

Do not display warnings.

-x table

OR

--exclude

Extract mode.

Exclude the tables named in the list.

-y

OR

--overwrite

Over-write the existing database file.

-z collation-sequence

OR

--collation=collation-sequence

Empty mode.

Specify the collation sequence.

-Z

OR

--listcollation

Empty mode.

List the available collation sequences and exit.

-?

OR

--help

Display utility usage and exit.
Note An option can be used in either mode if one is not specified in its description.
Remarks

When run in extract mode, the ulinit utility attempts to create an UltraLite database that matches, as closely as possible, the SQL Anywhere database. 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 used instead. A warning is generated and creation continues. This supports the case where SQL Anywhere tables cannot be modified, but a reasonable UltraLite alternative is available. To enforce an exact schema match, use the -f option. The ulinit utility fails if the schema does not support a reasonable UltraLite alternative.

Example

Create a file called customer.udb that contains the tables defined in TestPublication:

ulinit -a "DSN=MySADb;UID=JimmyB;PWD=secret" -n TestPublication -k mykey customer.udb

This example connects to a SQL Anywhere database defined in the MySADb datasource. It creates an UltraLite database with all the database options from that database and all the tables contained in the TestPublication publication. The new UltraLite database is called customer.udb and is encrypted with the key mykey.

Create a file called customer.udb that contains two distinct publications. Specifically, Pub1 may contain a small subset of data for priority synchronization, while Pub2 could contain the bulk of the data:

ulinit -a "DSN=MySADb;UID=JimmyB;PWD=secret" --exactschema -n Pub1 -n Pub2 -s Pub1 -s Pub2 customer.udb

This example connects to a SQL Anywhere database defined in the MySADb datasource. It creates an UltraLite database with all the database options from that database and all the tables contained in the publications Pub1 and Pub2. The new UltraLite database is also created with the publications Pub1 and Pub2. Since the --exactschema option is set, ulinit will fail if it cannot extract the all precise schema.

Create a new blank database that overwrites another customer.udb file if it already exists. The new database has no schema and all the database options are set to default values.

ulinit -y customer.udb