Create a User or System odbc.ini File

User and system DSNs are defined in one of several odbc.ini file types.

On Linux and UNIX, user DSNs are defined in the file $HOME/.odbc.ini or in a file named by the ODBCINI environment variable. This file is referred to as the user odbc.ini file. System DSNs are defined in the system odbc.ini file, which is located in timesten_home/conf/sys.odbc.ini.

The syntax for user and system odbc.ini files are the same. The syntax is described in odbc.ini File Entry Descriptions. The system odbc.ini file is created when TimesTen is installed on the system. Users must create their own user odbc.ini file.

Perform the following to create the DSN:

  1. Specify the DSN in the odbc.ini file. The DSN appears inside square brackets at the top of the DSN definition on a line by itself. For example:
    [AdminDS]
  2. Specify the TimesTen ODBC driver.

    Note:

    JDBC users need to specify the TimesTen ODBC driver to be used by the JDBC driver, as described in Connecting Using the TimesTen JDBC Driver and Driver Manager.

    To set the TimesTen ODBC driver, specify the Driver attribute in the odbc.ini file. The following example provides the TimesTen ODBC driver that this DSN is configured to use, where /disk1/timesten is the timesten_home:

    [AdminDS]
    Driver=/disk1/timesten/lib/libtten.so

    Note:

    For a list of TimesTen ODBC drivers that you can use, see Table 1-1.

  3. Specify the database directory path and prefix in the odbc.ini file. The following example defines /disk1/databases as the database directory path and FixedDs as the prefix for the database files:
    DataStore=/disk1/databases/FixedDs

    The database directory path can use environment variables, as discussed in Using Environment Variables in Database Path Names.

  4. Choose a database character set. The following example defines the database character set in the odbc.ini file as AL32UTF8:
    DatabaseCharacterSet=AL32UTF8
  5. Set connection attributes in your odbc.ini file. Attributes that do not appear in the odbc.ini file assume their default value.

    Note:

    See Connection Attributes in Oracle TimesTen In-Memory Database Reference. For examples, see DSN Examples for TimesTen.