This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Installing ODBC drivers on Linux

Read Driver Prerequisites before you proceed.

Read Driver prerequisites before you proceed.

For Red Hat Enterprise Linux and SUSE Linux Enterprise Server, you can download and install a client RPM that installs both the ODBC and JDBC driver and the vsql client. See Installing the client RPM on red hat and SUSE.

The ODBC driver installation packages are broken down by client platform on the Vertica driver downloads page. The package's filename is named based on its operating system and architecture (for example, vertica_ 11.1.x.xx_odbc_x86_64_linux.tar.gz)

Installation procedure

  1. Open a web browser and browse to the Vertica driver downloads page.

  2. Locate and download the driver package that matches your Vertica version and platform.

  3. If you did not directly download to the client system, transfer the downloaded file to it.

  4. Log in to the client system as root.

  5. If the directory /opt/vertica/ does not exist, create it:

    # mkdir -p /opt/vertica/
    
  6. Copy the downloaded file to the /opt/vertica/ directory. For example:

    # cp vertica_11.1.x.xx_odbc_x86_64_linux.tar.gz /opt/vertica/
    
  7. Change to the /opt/vertica/ directory:

    # cd /opt/vertica/
    
  8. Uncompress the file you downloaded. For example:

    $ tar vzxf vertica_ 11.1.x.xx_odbc_x86_64_linux.tar.gz

    Two folders are created: one for the include file, and one for the library files. The path of the library file depends on the processor architecture: lib for 32-bit libraries, and lib64 for 64-bit libraries. So, a 64-bit driver client download creates the directories:

    • /opt/vertica/include, which contains the header file

    • /opt/vertica/lib64, which contains the library file

Post driver installation configuration

You must configure the ODBC driver before you can use it. There are two required configuration files:

1 - Required ODBC driver configuration settings for Linux and UNIX

In addition to DSN settings, Vertica provides additional ODBC client driver configuration parameters.

In addition to DSN settings, Vertica provides additional ODBC client driver configuration parameters. These settings control the following:

  • The text encoding used by the driver manager (for example, UTF-8 or UTF-16).

  • The location of the directory containing the Vertica ODBC driver's error message files.

  • Whether and how the ODBC driver logs messages.

On Linux and UNIX platforms, you must provide these additional settings manually so that the ODBC driver can function properly. To do so, edit the vertica.ini file to supply the necessary additional configuration settings. You specify where the ODBC driver can find the vertica.ini file using an environment variable named VERTICAINI. See Setting ODBC driver settings on Linux and UNIX-Like platforms.

2 - Setting ODBC driver settings on Linux and UNIX-Like platforms

Driver settings specific to Vertica are stored in a text file named vertica.ini (although you may choose a different file name).

Driver settings specific to Vertica are stored in a text file named vertica.ini (although you may choose a different file name). On Linux and UNIX platforms, you must edit the vertica.ini file to supply additional configuration settings before the ODBC driver can function properly. You tell the Vertica ODBC driver where to find the vertica.ini file using an environment variable named VERTICAINI.

Required settings

On Linux and UNIX platforms, you must configure two settings in order for the ODBC driver to work correctly:

  • ErrorMessagesPath

  • ODBCInstLib (unless the driver manager's installation library is in a directory listed in the LD_LIBRARY_PATH or LIB_PATH environment variables).

If your driver manager does not use UTF-8 encoding, you need to set DriverManagerEncoding to the proper encoding.

Create a vertica.ini file

There is no standard location for the vertica.ini file—you can store the file anywhere that it is convenient for you on your client system. One possible location is in the /etc directory if you have multiple users on your client system that need to access it. You can also have a vertica.ini file in each user's home directory so users can alter their own settings. Wherever you store it, be sure users have read access to the file.

The format of the vertica.ini file is similar to the odbc.ini file, with a section followed by parameter definitions. Unlike the odbc.ini file, vertica.ini contains a single section named Driver:

[Driver]

Following the section definition, you add setting definitions, one per line. A setting definition consists of the setting name, followed by an equal sign (=), followed by the value. The value does not need quotes. For example, to set the ODBCInstLib setting, you add a line like this:

ODBCInstLib=/usr/lib64/libodbcinst.so

See Additional parameter settings for a list of the additional settings.

Set the VERTICAINI environment variable

You must set an environment variable named VERTICAINI to the absolute path of the vertica.ini file. The Vertica ODBC driver uses this variable to find the settings.

Where you set this variable depends on whether users on your client system need to have separate vertica.ini files. If you want to have a single, system-wide vertica.ini file, you can add a command to set VERTICAINI in /etc/profile or some other system-wide environment file. For example:

export VERTICAINI=/etc/vertica.ini

If users need individual vertica.ini files, set VERTICAINI in their ~/.profile or similar configuration file. For example:

export VERTICAINI=~/.vertica.ini

Example vertica.ini file

The following example vertica.ini file configures the ODBC driver to:

  • use the 64-bit UNIXODBC driver manager.

  • get its error messages from the standard Vertica 64-bit ODBC driver installation directory.

  • log all warnings and more severe messages to log files stored in the temporary directory.

[Driver]
DriverManagerEncoding=UTF-16
ODBCInstLib=/usr/lib64/libodbcinst.so
ErrorMessagesPath=/opt/vertica
LogLevel=4
LogPath=/tmp