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

SQL Anywhere 17 » SQL Anywhere Server - Database Administration » Database administration tools and utilities » Database administration utilities

Configuration files

Many of the utilities allow you to store command-line options in a configuration file.

If you use an extensive set of options, you may find it useful to store them in a configuration file.

The @data option allows you to specify an environment variable or configuration file on the command line.

To specify an environment variable, replace @data with the name of the environment variable.

To specify a configuration file, replace data with the path and name of the configuration file.

If both an environment variable and configuration file exist with the same name, the environment variable is used.

Configuration files can contain line breaks, and can contain any set of options, including the @data option. You can use the number sign (#) at the beginning of a line to designate the line as a comment. The ampersand (&) character appearing by itself at the end of a line indicates that the previous token is continued on the next line. For example, the following configuration file could be used to start a server that allows strong encryption:

-ec TLS(FIPS=Y;IDENTITY=rsaserver.id; &
     IDENTITY_PASSWORD=test)
 -x TCPIP c:\mydemo.db

The @data parameter can occur at any point in the command line, and parameters contained in the file are inserted at that point. You can use @data multiple times on one command line to specify multiple configuration files or environment variables.

Utilities read the command line by expanding the specified configuration files and reading the entire command line from left to right. If you specify options that are overridden by other options in the command line, the option closer to the end of the line wins. Conflicting options can cause errors.

Note The Start Server in Background utility (dbspawn) does not expand configuration files specified by the @data option.

To protect passwords or other information in a configuration file, you can use the File Hiding utility (dbfhide) to encrypt the contents of the configuration file.

Configuration file escape characters

Within a configuration file, if the value for an option contains values with spaces, then the value must be enclosed in double quotes. Furthermore, if the quoted value contains additional values with spaces, then the double quotes around the additional values must be escaped. SQL Anywhere supports \\ as an escape sequence for a \, and \" as an escape sequence for a ".

For example, this excerpt from a dblsn configuration file has escaped double quote characters:

-l "subject=$remote_id;
    content=sync cardealer;
    action='run dbmlsync.exe -c \"filedsn=c:\my fdsns\CarDealer.dsn\"
    -ot dbmlsync.log -k -e sa=on';"

Example

The following configuration file holds a set of options for the Validation utility (dbvalid):

#Connect to the sample database as the user DBA with password sql
-c "UID=DBA;PWD=sql;DBF=%SQLANYSAMP17%\demo.db"
#Perform an express check on each table
-fx
#Log output messages to the specified file
-o "c:\validationlog.txt"

If this configuration file is saved as c:\config.txt, it can be used in a command as follows:

dbvalid @c:\config.txt