The ODBC initialization file is used by the ODBC Driver Manager and ODBC drivers. Although ODBC initialization information exists on both Windows and UNIX systems, on Windows systems the information resides in the Registry, and all changes are made using the Windows ODBC Administrator (launched by clicking on the ODBC Data Sources icon in the Windows Control Panel) as described in Connect to Database.

On UNIX systems, the ODBC initialization file is a text file that must be modified manually to reflect the data sources available in your environment. During the IDL installation process, a template initialization file named odbc.ini is installed in the IDL_DIR/resource/dm/os/ directory, where IDL_DIR is the root directory of the IDL distribution and os is the directory named after your particular operating system. This file contains information about the ODBC drivers installed along with the DataMiner.

You must modify the ODBC initialization file reflect your system’s data source configuration, and you must make the file available to all IDL DataMiner users on the system. Do the following:

  1. Create a backup copy of the template IDL_DIR/resource/dm/os/odbc.ini file named odbc.ini.orig.
  2. Modify the template odbc.ini file to reflect your system’s data source configuration. The format of the initialization file is described in ODBC Initialization File Format below. See Connect to Database for how to retrieve information on the specific ODBC drivers used at your site.
  3. Make the initialization file available to IDL DataMiner users. You can do this in either of the following ways:

    • Create an environment variable named ODBCINI that contains the path to the initialization file in each IDL DataMiner user’s environment. This method is useful if every IDL DataMiner user uses the same datasource configuration.

      Copy the modified odbc.ini file to each IDL DataMiner user’s home directory, using .odbc.ini as the filename (note the initial dot). This method is useful if different IDL DataMiner users use different datasource configurations.

Note: When the IDL DataMiner starts, it looks first for the ODBCINI environment variable. If the variable exists, the DataMiner will use the file it refers to and ignore any .odbc.ini file in the user’s $HOME directory.

Default ODBC Configuration


The defaultIDL_DIR/resource/dm/os/odbc.ini file contains information about the ODBC drivers installed on your system by IDL, but nothing about your specific data sources. At a minimum, you will need to add the data source names to the ODBC initialization file. Depending on your specific installation, you may also need to add details such as the database host name, database instance name. You might also want to make database access more convenient by specifying login or password information.

Changing the ODBC Configuration


If you change the values in the ODBC initialization file while the IDL DataMiner is in use, you must destroy any existing database object and reconnect before the changes will be apparent. See Destroy a Database Object for details on destroying a database object.

ODBC Initialization File Format


The ODBC initialization file is made up of the following sections:

  • ODBC Data Sources: This section lists the name of each data source and describes its associated driver.
  • Data Source Specification: For each data source listed in the ODBC Data Sources section, there is a section that contains additional information about that data source.
  • Default Data Source Specification: This section is optional and specifies the default data source to use when no data source is specified.
  • ODBC Options: This section specifies the ODBC root directory and the ODBC options that may be enabled or disabled.

ODBC Data Sources


Each entry in the ODBC Data Sources section lists a data source and a description of the driver it uses. Entries in this section have the following format:

data_source_name = driver_description

The data_source_name identifies the data source to which the driver connects. You choose this name. This field is required.

The driver_description describes the driver to which the data source connects. This field is optional.

For example, to define an Agencies data source that uses the SYBASE SQL Server 10 driver, the ODBC initialization file entry would look like the following:

[ODBC Data Sources]
Agencies=Sybase SQL Server 10

Data Source Specification


Each data source listed in the ODBC Data Sources section has its own data source specification section. This section has the following format:

[Data_source_name]
Driver=path_specification
Attribute=keyword_value

The data_source_name is the name defined in the ODBC Data Sources section of the ODBC initialization file.

The path_specification is the full path to the driver shared library.

Each Attribute and keyword_value pair specifies the value of a driver-specific keyword. Each driver has its own set of keywords. For driver-specific keywords and attributes, refer to the ODBC DriverSet Reference chapter. There can be any number of Attribute/keyword pairs included in the Data Source Specification.

For example, the data source called Agencies connects to a Sybase SQL Server 10 driver for UNIX called dmsyb13.so. The database that Agencies accesses is also called agencies and it resides on the SYBASE10 server. The data source specification entry for the Agencies data source would look like the following:

[Agencies]
Driver=IDL_DIR/bin/bin.platform/dm/drivers/dmsyb13.so
Server=SYBASE10
Database=agencies
UID=marvin

where IDL_DIR is the root directory of the IDL distribution and platform is the platform-specific bin directory, for example solaris2.sparc.

In this example, the driver-specific keywords for the Sybase driver are Server, Database, and UID.

Default Data Source Specification


This section is optional. The Default Data Source specification contains information about the default data source. This data source is called Default and has the same format as any other data source specification section. However, the Default data source is not listed in the ODBC Data Sources section.

The following example shows a Default data source specification entry for an Oracle7 database.

[Default]
Driver=IDL_DIR/bin/bin.platform/dm/drivers/dmor713.so
Server=t:mickey:customers
UID=marvin

where IDL_DIR is the root directory of the IDL distribution and platform is the platform-specific bin directory, for example solaris2.sparc.

In this example, the driver-specific keywords for the Oracle7 driver are Server and UID. The Server keyword identifies the SQL*Net connect string for the ORACLE7 server called customers.

ODBC Options


The ODBC Options section ([ODBC]) specifies the ODBC root directory and indicates whether tracing is enabled or disabled. With tracing, all ODBC function calls made from an application can be logged to the specified trace file.

Note: This section of the ODBC initialization file is recommended so that the Driver Manager can find the message files. The Driver Manager also uses this section to load the Cursor Library and the Connection Dialog Library. At a minimum, the [ODBC] section must contain the InstallDir keyword with the value set to the path in which the DriverSet is installed.

This section has the following format:

InstallDir=odbc_path
Trace= 1 or 0
TraceFile=log_path
TraceDll=odbc_path/odbctrac.so

The odbc_path is the full path to the ODBC root directory.

If the TRACE keyword is set to 0, tracing is disabled. If the TRACE keyword is set to 1, tracing is enabled.

The log_path is the full path to the specified trace file that is logging the ODBC function calls. If a trace file is not specified and tracing is enabled, logging information is written to the sql.log file located in your current directory.

The TraceDll keyword indicates the shared library that contains the ODBC tracking system.

[ODBC]
InstallDir=IDL_DIR/bin/bin.platform/dm
Trace=1
TraceFile=IDL_DIR/bin/bin.platform/dm/drivers/trace.log
TraceDll=IDL_DIR/bin/bin.platform/dm/lib/odbctrac.so

where IDL_DIR is the root directory of the IDL distribution and platform is the platform-specific bin directory, for example solaris2.sparc.

ODBC Initialization File Example


The following example shows a UNIX ODBC initialization file.

[ODBC Data Sources]
Informix9=INTERSOLV 3.11 Informix 9 Driver
Text=INTERSOLV 3.11 Text Driver
 
[Text]
Driver=IDL_DIR/bin/bin.platform/dm/lib/dmtxt13.so
Description=Text driver
Database=/home/kirk/dmtest
AllowUpdateAndDelete=1
 
[Informix9]
Driver=IDL_DIR/bin/bin.platform/dm/lib/dminf913.so
Description=Informix9
Database=odbc
HostName=informixhost
LogonID=odbc01
Password=odbc01
 
[ODBC]
InstallDir=IDL_DIR/bin/bin.platform/dm
Trace=1
TraceFile=IDL_DIR/bin/bin.platform/dm/drivers/trace.log
TraceDll=IDL_DIR/bin/bin.platform/dm/lib/odbctrac.so

where IDL_DIR is the root directory of the IDL distribution and platform is the platform-specific bin directory, for example solaris2.sparc.