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 Linux environment, you can use the DataDirect ODBC Data Source Administrator for Linux (the Linux ODBC Administrator) to create or modify data source definitions in this file (see
“Configuration Through the Administrator” for details). If you do not, see
“Configuration Through the System Information (odbc.ini) File” and follow the instructions for configuring the file.
NOTE: The Linux ODBC Administrator is currently supported only on Linux for x86 and x64 processors with Motif 2.0.3 and higher. It is not supported on Linux for Itanium II or other UNIX platforms.
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.
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 ships an enhanced library to perform tracing. This library appears by default in the Trace Library field. If you want to use a custom library instead, type the path and name of the library in the Trace Library field or click
Browse to select a library.
To enable tracing, select the Enable Tracing check box on the Trace 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.
When you are finished with the Linux 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.
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 file that is installed by the product installer. You can add this section manually or, if you are using the Linux 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, for example:
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 file.
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 exists or if the dbc.ini file does not contain an
[ODBC] section, they check for an
[ODBC] section in the odbcinst.ini file. See
“DSN-less Connections” for details.
ODBC tracing allows you to trace calls to ODBC drivers and create a log of the traces for troubleshooting purposes. The following keywords all control tracing: Trace, TraceFile, TraceDLL, ODBCTraceMaxFileSize, and ODBCTraceMaxNumFiles.
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.
Progress 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 /samples/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: