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.
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. 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. 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 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 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. 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 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 |
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. 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 |
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 |
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. |
An option can be used in either mode if one is not specified in its description.
When run in extract mode, ULINIT 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.
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 |
![]() |
Discuter à propos de cette page dans DocCommentXchange.
|
Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0 |