4 Configuring the Product on UNIX/Linux : Environment Variables

Environment Variables
The first step in setting up and configuring the drivers for use is to set several environment variables. The following procedures require that you have the appropriate permissions to modify your environment and to read, write, and execute various files. You must log in as a user with full r/w/x permissions recursively on the entire DataDirect Connect Series for ODBC installation directory.
Library Search Path
The library search path variable can be set by executing the appropriate shell script located in the ODBC home directory. From your login shell, determine which shell you are running by executing:
echo $SHELL
C shell login (and related shell) users must execute the following command before attempting to use ODBC-enabled applications:
source ./odbc.csh
Bourne shell login (and related shell) users must initialize their environment as follows:
. ./odbc.sh
Executing these scripts sets the appropriate library search path environment variable:
The library search path environment variable must be set so that the ODBC core components and drivers can be located at the time of execution. After running the setup script, execute:
env
to verify that the installation_directory/lib directory has been added to your shared library path.
Some of the client-based drivers must have additional environment variables set. Consult the driver requirements in each of the individual driver chapters for additional environment variable information.
ODBCINI
Setup installs in the product installation directory a default system information file, named odbc.ini, that contains data sources. See “Data Source Configuration” for an explanation of the odbc.ini file. The system administrator can choose to rename the file and/or move it to another location. In either case, the environment variable ODBCINI must be set to point to the fully qualified path name of the odbc.ini file.
For example, to point to the location of the file for an installation on /opt/odbc in the C shell, you would set this variable as follows:
setenv ODBCINI /opt/odbc/odbc.ini
In the Bourne or Korn shell, you would set it as:
ODBCINI=/opt/odbc/odbc.ini;export ODBCINI
As an alternative, you can choose to make the odbc.ini file a hidden file and not set the ODBCINI variable. In this case, you would need to rename the file to .odbc.ini (to make it a hidden file) and move it to the user’s $HOME directory.
The driver searches for the location of the odbc.ini file as follows:
1
2
If the driver does not locate the system information file, it returns an error.
ODBCINST
Setup installs in the product installation directory a default file, named odbcinst.ini, for use with DSN-less connections. See “DSN-less Connections” for an explanation of the odbcinst.ini file. The system administrator can choose to rename the file or move it to another location. In either case, the environment variable ODBCINST must be set to point to the fully qualified path name of the odbcinst.ini file.
For example, to point to the location of the file for an installation on /opt/odbc in the C shell, you would set this variable as follows:
setenv ODBCINST /opt/odbc/odbcinst.ini
In the Bourne or Korn shell, you would set it as:
ODBCINST=/opt/odbc/odbcinst.ini;export ODBCINST
As an alternative, you can choose to make the odbcinst.ini file a hidden file and not set the ODBCINST variable. In this case, you would need to rename the file to .odbcinst.ini (to make it a hidden file) and move it to the user’s $HOME directory.
The driver searches for the location of the odbcinst.ini file as follows:
1
2
If the driver does not locate the odbcinst.ini file, it returns an error.
DD_INSTALLDIR
This variable provides the driver with the location of the product installation directory so that it can access support files. DD_INSTALLDIR must be set to point to the fully qualified path name of the installation directory.
For example, to point to the location of the directory for an installation on /opt/odbc in the C shell, you would set this variable as follows:
setenv DD_INSTALLDIR /opt/odbc
In the Bourne or Korn shell, you would set it as:
DD_INSTALLDIR=/opt/odbc;export DD_INSTALLDIR
The driver searches for the location of the installation directory as follows:
1
2
If the driver does not locate the installation directory, it returns an error.
The next step is to test load the driver.