In the UNIX and Linux environments, a system information file is used to store data source information. Setup installs a default version of this file, called odbc.ini, in the product installation directory (see
“ODBCINI” for details about relocating and renaming this file). This is a plain text file that contains data source definitions.
If you have a Motif graphical user interface (GUI) in your UNIX or Linux environment, you can use the DataDirect ODBC Data Source Administrator for UNIX/Linux (the UNIX ODBC Administrator) to create or modify data source definitions in this file (see
“Configuration Through the Administrator” for details). On Linux, you can determine if you are using Motif through the following command:
Commands for determining whether Motif is installed vary among UNIX systems. Please refer to your operating system documentation for details specific to your system.
If you are configuring a new user data source, click Add to display a list of installed drivers. Select the appropriate driver and click
Finish to display the driver Setup dialog box.
To configure a new file data source, click Add to display a list of installed drivers. Select the appropriate driver and click
Advanced to specify attributes; otherwise, click
Next to proceed. Specify a name for the data source and click
Next. Verify the data source information; then, click
Finish to display the driver Setup dialog box.
NOTE: If you want to set a default directory for File DSNs, select the directory from the Directories list; then, click
Set Directory. The next time that you open the Administrator, it displays data source files from this directory.
You enable tracing by selecting the
Enable Tracing check box on the Tracing tab of the Administrator. Clear the check box to disable tracing. Tracing continues until you disable it. Be sure to turn off tracing when you are finished reproducing the issue because tracing decreases the performance of your ODBC application.
To specify the path and name of the trace log file, type the path and name in the Trace File field or click
Browse to select a log file. If no location is specified, the trace log resides in the working directory of the application you are using.
DataDirect Technologies ships a default shared object, odbctrac.so, to perform tracing. If you want to use a custom shared object instead, type the path and name of the shared object in the Trace Library field or click
Browse to select a shared object.
When you are finished with the UNIX ODBC Administrator, click OK or
Cancel. If you click
OK, any changes you have made to the Trace tab are accepted and the Administrator closes. If you click
Cancel, the Administrator closes without saving any changes.
To configure a data source manually, you edit the odbc.ini file with a text editor. The content of this file is divided into three sections.
The [ODBC Data Sources] section also includes data source definitions. The default odbc.ini contains a data source definition for each driver. Each data source definition begins with a data source name in square brackets, for example,
[Oracle Wire Protocol 2]. The data source definitions contain connection string
attribute=value pairs with default values. You can modify these values as appropriate for your system. Descriptions of these attributes are in each individual driver chapter. See
“Sample Default odbc.ini File” for sample data sources.
The second section of the file is named [ODBC File DSN] and includes one keyword:
NOTE: This section is not included in the default odbc.ini that is installed by the product installer. You can add this section manually or, if you are using the UNIX ODBC Administrator, it will be added automatically when you click
Set Directory on the File DSN tab (see
Step 2 under
“Configuration Through the Administrator”).
The third section of the file is named [ODBC] and includes several keywords:
The IANAAppCodePage keyword defines the default value that all UNIX/Linux drivers use if individual data sources have not specified a different value. See the individual driver chapters and refer to
Chapter 1 “Code Page Values” in the
DataDirect Connect Series for ODBC Reference for details. The default value is 4.
The InstallDir keyword must be included in this section. The value of this keyword is the path to the installation directory under which the /lib and /Locale directories are contained. The installation process automatically writes your installation directory to the default odbc.ini.
For example, if you choose an installation location of /opt/odbc, then the following line is written to the
[ODBC] section of the default odbc.ini:
NOTE: If you are using only DSN-less connections through an odbcinst.ini file and do not have an odbc.ini file, then you must provide
[ODBC] section information in the
[ODBC] section of the odbcinst.ini file. The drivers and Driver Manager always check first in the
[ODBC] section of an odbc.ini file. If no odbc.ini file or
[ODBC] section exists, they check for an
[ODBC] section in the odbcinst.ini file. See
“DSN-less Connections” for details.
The [ODBC] section of the system information file includes three keywords related to tracing: Trace, TraceFile, and TraceDll. For example:
You enable tracing by setting the value of Trace to 1. Set the value to 0 to disable tracing. Tracing continues until you disable it. Be sure to turn off tracing when you are finished reproducing the issue because tracing decreases the performance of your ODBC application.
To specify the path and name of the trace log file, enter it as the value for TraceFile. If no location is specified, the trace log resides in the working directory of the application you are using.
DataDirect Technologies ships a default shared object, odbctrac.so, to perform tracing. If you want to use a custom shared object instead, enter the path and name of the shared object as the value for TraceDll.
The following is a sample odbc.ini file that Setup installs in the installation directory. All occurrences of ODBCHOME are replaced with your installation directory path during installation of the file. Values that you must supply are enclosed by angle brackets (< >). If you are using the installed odbc.ini file, you must supply the values and remove the angle brackets before that data source section will operate properly. Commented lines are denoted by the # symbol. This sample shows 32-bit drivers with file names beginning with iv. A 64-bit driver file would be identical except that driver names would begin with dd and the list of data sources would include only the 64-bit drivers.
IMPORTANT: The "Connection Option Descriptions" section of each driver chapter
lists both the long and short names of the attribute. When entering attribute names into odbc.ini, you must use the long name of the attribute. The short name is not valid in the odbc.ini file.
IMPORTANT: The "Connection String Attributes" table of each driver chapter
lists both the long and short name of the attribute. When entering attribute names into odbc.ini, you must use the long name of the attribute. The short name is not valid in the odbc.ini file.
DataDirect provides a sample translator named "OEM to ANSI" that provides a framework for coding a translation library. Refer to the readme.trn file in the /src/trn subdirectory in the product installation directory for details.
To perform a translation with a particular driver, you must include the TranslationSharedLibrary keyword in that driver’s data source definition in the odbc.ini file. The TranslationSharedLibrary keyword represents the full path to the translation library.
For example, the 32-bit DB2 driver would be:
The TranslationOption keyword is the ASCII representation of the 32-bit integer translation option. Use of the TranslationOption keyword is optional.