iqinit Database Administration Utility

The iqinit utility starts a database that gives the user executing the utility permission to create a database. The user must have access to the computer and file system.

iqinit is the SAP Sybase IQ version of the SQL Anywhere dbinit utility. iqinit lets you create either an an SAP Sybase IQ or SQL Anywhere database from the command line without starting a database:
  • If no iqinit command line parameters are specified, iqinit creates a SQL Anywhere database.
  • If the -iqpath command line parameter is specified, iqinit creates an SAP Sybase IQ database.

Syntax

iqinit  options ] new-database-file

Parameters

This table lists the available options for the iqinit utility.

iqinit Options
Option Description

@data

Reads in options from the specified environment variable or configuration file. If you want to protect passwords or other information in the configuration file, you can use the File Hiding utility to obfuscate the contents of the configuration file.

-a

Causes string comparisons to respect accent differences between letters (for example, e is less than é if the Unicode Collation Algorithm (UCA) is used for either CHAR or NCHAR data types (see -z and -zn). With the exception of Japanese databases created with a UCA collation, by default, accents are ignored (meaning e is equal to é). If all base letters (letters with accents and case removed) are otherwise equal, then accents are compared from left to right.

The default accent sensitivity of a UCA collation when creating a Japanese database is sensitive. That is, accents are respected.

-af

Causes string comparisons to respect accent differences between letters (for example, e is less than é) if the UCA is used for either CHAR or NCHAR data types (see -z and -zn). By default, accents are ignored (meaning e is equal to é). If all base letters (letters with accents removed) are otherwise equal, then accents are compared from right to left, consistent with the rules of the French language.

-b

Blank pads the database.

The database server compares all strings as if they are varying length and stored using the VARCHAR domain. This includes string comparisons involving fixed length CHAR or NCHAR columns. In addition, SQL Anywhere never trims or pads values with trailing blanks when the values are stored in the database.

By default, the database server treats blanks as significant characters. So, the value 'a ' (the character 'a' followed by a blank) is not equivalent to the single-character string 'a'. Inequality comparisons also treat a blank as any other character in the collation.

If blank padding is enabled (the iqinit -b option), the semantics of string comparisons more closely follow the ANSI/ISO SQL standard. With blank-padding enabled, SQL Anywhere ignores trailing blanks in any comparison.

In the example above, an equality comparison of 'a ' to 'a' in a blank-padded database returns TRUE. With a blank-padded database, fixed-length string values are padded with blanks when they are fetched by an application. The ansi_blanks connection option controls whether the application receives a string truncation warning on such an assignment.

-c

Considers all values case sensitive in comparisons and string operations. Identifiers in the database are case insensitive, even in case sensitive databases.

With the exception of Japanese databases created with a UCA collation, the default behavior is that all comparisons are case insensitive. The default case sensitivity of a UCA collation when creating a Japanese database is sensitive.

This option is provided for compatibility with the ISO/ANSI SQL standard.

-dba  [ DBA-user ] [ pwd  ]

Specifies the DBA user ID and password. If you specify a new name for the DBA user for the database, you can no longer connect to the database as the user DBA. You can also specify a different password for the DBA database user. If you do not specify a password, the default password sql is used. If you do not specify this option, the default user ID DBA with password sql is created.

The following command creates a database with a DBA user named testuser with the default password sql:

iqinit -dba testuser, mydb.db

The following command uses the default user ID DBA with password mypwd:

iqinit -dba ,mypwd mydb.db

The following command changes the DBA user to user1 with password mypwd:

iqinit -dba user1,mypwd mydb.db

-dbs sizek | m | g | p ]

Pre-allocates space for the database. Pre-allocating space for the database helps reduce the risk of running out of space on the drive the database is located on. As well, it can help improve performance by increasing the amount of data that can be stored in the database before the database server needs to grow the database, which can be a time-consuming operation.

By default, the size is in bytes. You can use k, m, g, or p to specify units of kilobytes, megabytes, or gigabytes, or pages, respectively.

-ea algorithm

Specifies the encryption algorithm used for database or table encryption (-et). Specify -ea simple for simple encryption (do not specify -ek or -ep). Simple encryption is equivalent to obfuscation and is intended only to keep data hidden in the event of casual direct access of the database file, to make it more difficult for someone to decipher the data in your database using a disk utility to look at the file.

For greater security, specify AES or AES256 for 128-bit or 256-bit strong encryption, respectively. Specify AES_FIPS or AES256_FIPS for 128-bit or 256-bit FIPS-certified encryption, respectively. For strong encryption, you must also specify the -ek or -ep option.

To create a database that is not encrypted, specify -ea none, or do not include the -ea option (and do not specify -et, -ep, or -ek). If you do not specify the -ea option, the default behavior is as follows:

  • -ea none, if -ek, -ep, or -et is not specified

  • -ea AES, if -ek or -ep is specified (with or without -et)

  • -ea simple, if -et is used without -ek or -ep

Algorithm names are case insensitive.

File compression utilities cannot compress encrypted database files as much as unencrypted ones.

-ek key

Specifies that you want to create a strongly encrypted database by specifying an encryption key directly in the command. The -ek option is used with an AES algorithm, optionally specified using the -ea option. If you specify the -ek option without specifying the -ea option, AES is used by default. When specified with -et, the database is not encrypted. Instead, table encryption is enabled.

-ep

Specifies that you want to create a strongly encrypted database by inputting the encryption key in a window. This provides an extra measure of security by never allowing the encryption key to be seen in clear text. You must input the encryption key twice to confirm that it was entered correctly. If the keys don't match, the initialization fails. When specified with -et, the database is not encrypted. Instead, table encryption is enabled.

-et

Enables table encryption using the encryption algorithm (and key) specified for the -ea option. Use this option when you want to create encrypted tables instead of encrypting the entire database. If you specify -et with -ek or -ep, but not -ea, the AES algorithm is used by default. When you specify only -et, simple encryption is used.

Enabling table encryption does not mean your tables are encrypted. You must encrypt tables individually, after database creation.

When table encryption is enabled, table pages for the encrypted table, associated index pages, and temporary file pages are encrypted, and the transaction log pages that contain transactions on encrypted tables.

The following example creates the database new.db with strong encryption enabled for tables using the key abc, and the AES_FIPS encryption algorithm:

iqinit -et -ek abc -ea AES_FIPS new.db

-i

Excludes jConnect™ for JDBC™ system objects from the database. To use the jConnect JDBC driver to access system catalog information, you need jConnect catalog support (installed by default). When you specify this option, you can still use JDBC, as long as you do not access system information. You can add jConnect support at a later time using the ALTER DATABASE statement.

-iqblksize

The I/O transfer block size in bytes.

-iqmsgpath

The path name of the segment containing the SAP Sybase IQ message trace file.

-iqpath

The path name of the main segment file containing the SAP Sybase IQ data.

-iqpgsize

The page size in bytes for the SAP Sybase IQ segment of the database.

-iqreservesize

The size in MB of the space to reserve for the IQ main store.

-iqsize

The size in MB of either the raw partition or OS file with the -iqpath.

-iqtmppath

The path name of the temporary segment file.

-iqtmpreservesize

The size in MB to reserve for the temporary IQ store.

-iqtmpsize

The size in MB of either the raw partition or OS file for the -iqtmppath.

-k

Does not create the SYSCOLUMNS and SYSINDEXES views. By default, database creation generates the views SYS.SYSCOLUMNS and SYS.SYSINDEXES for compatibility with system tables that were available in Watcom SQL (versions 4 and earlier of this software). These views conflict with the Sybase Adaptive Server Enterprise compatibility views dbo.syscolumns and dbo.sysindexes.

-l

Lists the available collation sequences and then stops. No database is created. To specify a collation sequence, use the -z option.

-le

Lists the available character set encodings and then stops. No database is created. Each character set encoding is identified by one or more labels. These are strings that can be used to identify the encoding. Each line of text that appears lists the encoding label and alternate labels by which the encoding can be identified. These labels fall into one of several common categories: SA (the SQL Anywhere label), IANA (Internet Assigned Numbers Authority), MIME (Multipurpose Internet Mail Extensions), ICU (International Components for Unicode), JAVA, or ASE (Adaptive Server Enterprise).

If you want to view a list of character set encodings that includes the alternate labels, specify the -le+ option.

When the iqinit utility reports the character set encoding, it always reports the database server version of the label. For example, the following command reports the CHAR character set encoding windows-1250:

iqinit -ze cp1250 -z uca test.db

-m  filename

Creates a transaction log mirror. A transaction log mirror is an identical copy of a transaction log, usually maintained on a separate device, for greater protection of your data. By default, the database server does not use a transaction log mirror.

-n

Creates a database without a transaction log. Creating a database without a transaction log saves disk space, but can result in poorer performance because each commit causes a checkpoint. Also, if your database becomes corrupted and you are not running with a transaction log, data is not recoverable. The transaction log is required for data replication and provides extra security for database information during a media or system failure.

-o  filename

Writes output messages to the named file.

-p  page-size

Specifies the page size for the database. The page size for a database can be (in bytes) 2048, 4096, 8192, 16384, or 32768, with 4096 being the default. Use k to specify units of kilobytes (for example, -p 4k).

Large databases can benefit from a larger page size. For example, the number of I/O operations required to scan a table is generally lower, as a whole page is read in at a time. However, there are additional memory requirements for large page sizes. It is strongly recommended that you do performance testing (and testing in general) when choosing a page size. Then choose the smallest page size that gives satisfactory results. For most applications, 16 KB or 32 KB page sizes are not recommended. You should not use page sizes of 16 KB or 32 KB in production systems unless you can be sure that a large database server cache is always available, and only after you have investigated the trade offs of memory and disk space with its performance characteristics. If a large number of databases are going to be started on the same server, pick a reasonable page size.

-pd If this option is not specified (default), all privileged system procedures execute with the privileges of the invoker. If specified, pre-16.0 privileged system procedures execute with the privileges of the definer, while 16.0 or later privileged system procedures execute with the privileges of the invoker.

-q

Runs in quiet mode—messages are not displayed.

-s

Adds global checksums (a checksum is added to each database page). By default, this option is on. Checksums are used to determine whether a database page has been modified on disk. When you create a database with global checksums enabled, a checksum is calculated for each page just before it is written to disk. The next time the page is read from disk, the page's checksum is recalculated and compared to the checksum stored on the page. If the checksums are different, then the page has been modified or corrupted on disk, and an error occurs. Critical database pages are always checksummed by the database server, regardless of the value of the -s option.

Checksums are automatically enabled for databases running on storage devices such as removable drives to help provide early detection if the database becomes corrupt.

If a database is created with global checksums disabled, you can still add checksums to pages when they are written by using the -wc option or the START DATABASE statement.

-t  transaction-log-name

Specifies the name of the transaction log file. The transaction log is a file where the database server logs all changes, made by all users, no matter what application is being used. The transaction log plays a key role in backup and recovery, and in data replication. If the file name has no path, it is placed in the same directory as the database file. If you run iqinit without specifying -t or -n, a transaction log is created with the same file name as the database file, but with extension .log.

-z  coll [ collation-tailoring-string

Specifies the collation sequence for the database. The collation sequence is used for sorting and comparing character data types (CHAR, VARCHAR, and LONG VARCHAR). The collation provides character comparison and ordering information for the encoding (character set) being used. It is important to choose your collation carefully. It cannot be changed after the database has been created without unloading and reloading the database. If the collation is not specified, the database server chooses a collation based on the operating system language and character set. To view the available collation sequences, see the -l option.

Optionally, you can specify collation tailoring options (collation-tailoring-string) for additional control over the sorting and comparing of characters. These options take the form of keyword=value pairs, assembled in parentheses, following the collation name. For example:

Case and accent settings specified in the collation-tailoring-string override case and accent options for iqinit ( -c, -a, and -af), if you specify both.

-ze encoding

Specifies the encoding for the collation. Most collations specified by -z dictate both the encoding (character set) and ordering. For those collations, -ze should not be specified.

If the collation specified by -z is Unicode Collation Algorithm (UCA), then -ze can specify UTF-8 or any single-byte encoding for CHAR data types.

By default, the database server uses UTF-8. Use -ze to specify a locale-specific encoding and get the benefits of the UCA for comparison and ordering.

-zn coll [ collation-tailoring-string

Specifies the collation sequence used for sorting and comparing of national character data types (NCHAR, NVARCHAR, and LONG NVARCHAR). The collation provides character ordering information for the UTF-8 encoding (character set) being used. Values are UCA (the default), or UTF8BIN which provides a binary ordering of all characters whose encoding is greater than 0x7E. If the dbicu16 and dbicudt16 DLLs are not installed, then the default NCHAR collation is UTF8BIN

Optionally, you can specify collation tailoring options (collation-tailoring-string) for additional control over the sorting and comparing of characters. These options take the form of keyword=value pairs, assembled in parentheses, following the collation name. For example:

iqinit -c -zn UCA(case=LowerFirst) sens.db

Case and accent settings specified in the collation-tailoring-string override case and accent options for iqinit ( -c, -a, and -af), if you specify both.

Example

This command creates a SAP Sybase IQ database called bar.iq.
$ iqinit -iqpath bar.iq -iqsize 20M 
-iqpgsize 2048 
-iqreservesize 10M bar.db 
SQL Anywhere Initialization Utility Version 16.0.0.5530
Debug 
CHAR collation sequence:
ISO_BINENG(CaseSensitivity=Respect) 
CHAR character set encoding:  ISO_8859-1:1987 
NCHAR collation sequence:
UCA(CaseSensitivity=UpperFirst;
AccentSensitivity=Respect;
PunctuationSensitivity=Primary) 
NCHAR character set encoding:  UTF-8 
Creating system tables 
Creating system views 
Setting option values 
Database "bar.db" created successfully