SQL Anywhere uses environment variables to store various types of information. Not all environment variables need to be set in all circumstances.
For SQL Anywhere Server, you can view the environment variables set for a particular server by starting the server with the -ze option. See -ze server option.
The SQL Anywhere installer creates or modifies the following environment variables in your computer's properties: PATH, SQLANY10, and SQLANYSH10. After installing SQL Anywhere, you must restart your computer for these environment variables to take effect.
Other environment variables can be set by modifying the properties for your computer, or within command prompts or batch files by using the SET command.
The SQL Anywhere installer sets the following environment variables: DYLD_LIBRARY_PATH, ODBCINI, PATH, SQLANY10, and SQLANYSH10. After installing SQL Anywhere, you must log out and log in for the environment variable settings to take effect. Rebooting is not required.
You must run the dbmodenv utility to configure the GUI environment (~/.MacOSX/environment.plist) for each user who wants to use SQL Anywhere applications from the Finder. Each user must log out and log in for the settings to take effect.
The dbmodenv utility is located in /Applications/SQLAnywhere10/System/bin32.
Terminal sessions do not inherit environment variables from the Finder. The following section describes how to set environment variables for terminal sessions.
Once SQL Anywhere 10 is installed, each user must set some environment variables for the system to locate and run SQL Anywhere applications. The SQL Anywhere installer creates two files, sa_config.sh and sa_config.csh, for this purpose. These files are installed in install-dir/bin32 and install-dir/bin64. Each file sets all needed user environment variables.
As the names imply, one file is designed to work under Bourne shell (sh) and its derivatives (such as ksh or bash). The other file is designed to work under C-shell (csh) and its derivatives (such as tcsh).
Some statements are commented out in each of these batch files. The system administrator may want to edit these files and uncomment sections, depending on the configuration of their system.
To run a SQL Anywhere application, you have several choices:
If you add the environment variables from the sa_config files to your system environment, you can run applications by launching them from a GUI, such as X window server, or by typing the application name in a terminal window.
In a terminal window, if you source one of the sa_config files, you can run the application by typing its name.
install-dir/bin32s and install-dir/bin64s contain scripts with the same names as SQL Anywhere applications. These scripts set the appropriate environment variables before launching the application. You can run the application by running the corresponding script. You do not have to source an sa_config file before you run these scripts.
To source a file means to execute commands contained in a text file in the current instance of the shell. This is accomplished using a command built into the shell.
Under Bourne shell and its derivatives, the name of this command is
. (a single period). For example, if SQL Anywhere is installed in /opt/sqlanywhere10, the following statement sources sa_config.sh:
Under C-shell and its derivatives, the command is
source. For example, if SQL Anywhere is installed in /opt/sqlanywhere10, the following statement sources sa_config.csh:
DYLD_LIBRARY_PATH environment variable [Mac OS X]
LD_LIBRARY_PATH environment variable [Linux and Solaris]
LIBPATH environment variable [AIX]
ODBCHOME environment variable [Unix]
ODBCINI and ODBC_INI environment variables [Unix]
PATH environment variable
SACHARSET environment variable
SADIAGDIR environment variable
SALANG environment variable
SALOGDIR environment variable
SATMP environment variable
SHLIB_PATH environment variable [HP-UX]
SQLANY10 environment variable
SQLANYSAMP10 environment variable
SQLANYSH10 environment variable
SQLCONNECT environment variable
SQLPATH environment variable
SQLREMOTE environment variable
SYBASE environment variable
TMP, TEMPDIR, and TEMP environment variables