Creates a new UltraLite database. This utility will either create an empty database with characteristics specified with the command line arguments ("empty mode"), or it can create a database based on a SQL Anywhere database "extract mode". In the latter case, an initial schema is created that matches tables and indexes in the SQL Anywhere reference database. Moreover, many of the SQL Anywhere reference database characteristics will be used for the new UltraLite database.
In the usage below, some options are only permissible in "extract mode," while others are only permissible in "empty mode." If no mode is stated in the description, then the option can be used in either mode.
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. See Configuration files. |
-a " keyword=value;..." OR --SAconnect="keyword=value;..." |
Sets the utility to "extract" mode and connects to an existing database using the specified connection parameters (extract mode). 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. By default, this data will 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. See UltraLite date_format creation parameter. |
--date_order=date-format-interpretation |
Empty mode. Sets the interpretation of the date format. See UltraLite date_order creation parameter. |
-e value OR --fips=value |
Empty mode. On or off, 1 or 0, and so on. This option controls AES FIPS-certified encryption by using a Certicom certified cryptographic algorithm. See UltraLite database security and UltraLite fips creation parameter. |
-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 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. See UltraLite global_database_id option. |
-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 identity. See identity. |
--identity-password = password | Specify the password for the client TLS identity. See identity_password. |
-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 logfile OR --sql=logfile |
Extract mode. Log DDL database schema creation SQL statements, as executed, to logfile. |
--log=filename |
Empty mode. Log operations to the specified file. |
-m filename OR --mirror_file=filename |
Extract mode. Specify the database mirror file. See UltraLite MIRROR_FILE connection parameter. |
--max_hash_size=size |
Empty mode. Sets the default index hash size in bytes. See UltraLite max_hash_size creation parameter. |
-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. See UltraLite nearest_century creation parameter. |
-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 a form of simple encryption. See UltraLite database security and UltraLite obfuscate creation parameter. |
-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. See UltraLite precision creation parameter. |
-q OR --quiet |
Empty mode and extract mode. 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. See UltraLite RESERVE_SIZE connection parameter. |
-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. Note that 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. For more information about how to create publications for MobiLink synchronization, see Publishing data in UltraLite. |
-S checksum_level OR --checksum_level=checksum_level |
Empty mode. 0, 1, or 2. Specifies the checksum level validation on database pages. See UltraLite checksum_level creation parameter. |
--scale=scale |
Empty mode. Specifies the minimum number of digits after the decimal point when an arithmetic result is truncated to the maximum precision. See UltraLite scale creation parameter. |
-t file OR --rootcert=file |
Empty mode and extract mode. 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. See UltraLite time_format creation parameter. |
--timestamp_format=format |
Empty mode. Sets the format for timestamps retrieved from the database. See UltraLite timestamp_format creation parameter. |
--timestamp_increment=increment |
Empty mode. Determines how the timestamp is truncated in UltraLite. See UltraLite timestamp_increment creation parameter. |
--timestamp_with_time_zone_format= format |
Empty mode. This option sets the format for TIMESTAMP WITH TIME ZONE values retrieved from the database. See UltraLite timestamp_with_time_zone_format creation parameter. |
-u <uid>,<pwd> OR --dba=<uid>,<pwd> |
Database connection only. Specify the userid and password. |
--utf8_encoding=value |
Empty mode. On or off, 1 or 0, and so on. Encodes data using the UTF-8 format, 8-bit multibyte encoding for Unicode. See UltraLite character sets and UltraLite utf8_encoding creation parameter. |
-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 |
Empty mode and extract mode. 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. |
The SQL Anywhere reference database, when used, acts as the source for:
Together they help create the UltraLite schema—information that defines the structure of the new UltraLite database. However, the new database you create is initially empty unless you use the -d option.
When run in extract mode, ULINIT will attempt 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 will be ignored and the UltraLite default used instead. A warning will be generated and creation will continue. 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. If the schema will not support a reasonable UltraLite alternative, ulinit will fail.
If you want to initialize an UltraLite database from an RDBMS other than SQL Anywhere, use the Create Synchronization Model Wizard in Sybase Central. When you run the wizard, you are prompted to connect to a consolidated database to obtain schema information.
UltraLite uses the name of the collation sequence that was defined in the reference database. However, you can still choose to use UTF-8 to encode the database, by setting the utf8_encoding property.
To see a list of supported collations (and corresponding codepages), run ulinit -Z at a command prompt. If your collation sequence is not supported by UltraLite, you should change it to one that is. For example, if your reference database collation is the UCA collation, you should:
Unload the reference database and then reload it with a different collation.
Run ulinit on this new version of the database.
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 |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |