unixODBC - Administrator Manual
Author: Peter Harvey

unixODBC

ADMINISTRATOR MANUAL

Introduction

Welcome to the unixODBC Administrator Manual. This manual has been created to help system administrators install and manage the ODBC sub-system.

Getting Started

At this point you know what ODBC is and what it can offer the Users of your system(s) - now you want to get it on your system(s).

Platforms

unixODBC implements ODBC on the following platforms;

- Linux
- Mac OSX
- VMS
- and various flavours of UNIX

This manual covers all platforms and will give special indication of differences for any particular platform.

Do You Have It?
It is possible that your system already has unixODBC installed. The best way to check for this is to drop to a terminal and execute 'odbcinst --version'.

[root@p12 qt]# odbcinst --version unixODBC 2.1.1 [root@p12 qt]#

Downloading

You can get the source from Source Forge.

You can get binary distributions from various places. One place to look is with the vendor of your operating system. You can also go to Source Forge and take a look at the Home Page to see the availibility and location of binary distributions.

Whether you choose a binary distribution or source code depends largely upon your site policy and which operating system you are working with. I recommend the following;

- Mac OSX - use a binary distribution
- Others - use a source distribution (tar-ball NOT CVS)

Installing From Source

There are two options when installing from source. You can install from a source distribution (a gzipped tar-ball) or from CVS. In either case you will find README files in the main directory which should help you build and install unixODBC.

The unixODBC build process uses the GNU auto-tools. This will be a concern to you if you choose to build from CVS because you must start the build process with 'make -f Makefile.cvs' - this, in turn, uses the GNU auto-tools (i.e. automake, autoconf) to build a 'configure' script. Unfortunately; the GNU auto-tools can be very version sensitive. See the README file(s) for more on this if you plan to build from CVS source.

[root@p12 unixODBC]# make -f Makefile.cvs

You do not have to 'make -f Makefile.cvs' when using a source distribution. Regardless of whether you choose to use CVS or a source distribution you will want to execute the 'configure' script with options appropriate for your needs.

[root@p12 unixODBC]# ./configure --help

The 'configure' script will check your system for features of interest and build some make files as well as create some include file(s) which will ensure that unixODBC will build without errors and only with features supported by your operating system.

At this point it is important to think about whether or not GUI tools are important to you (and your Users). The 'configure' script will try to detect support for the GUI applications in unixODBC and will build them if such support exists. unixODBC includes GUI tools based upon the Qt class library and GTK. The Qt based tools will be built if libqt*so can be found. Linux systems will probably have this. You can get this from Troll Tech.

Now you are ready to build the sources. Do this with the usual build sequence of commands.

[root@p12 unixODBC]# make [root@p12 unixODBC]# make install

Mac OSX: The Apple folks seem to be grappling with their support for the GNU auto-tools at the time of this writing. I recommend installing from a binary distribution of unixODBC. If you must install from source, and you are having problems with the GNU auto-tools, then you may want to try the qmake build. The qmake build process is not well documented at this time. People familiar with qmake should be able to build unixODBC with the included qmake project files.

Installing From Binary

RPM

Various RPMs exist for unixODBC. The best idea is to use any RPM files you can from your O/S vendor. Typically RPM distributions break unixODBC into more than one RPM distribution such as; core, and GUI.

Mac OSX Disk Images

A binary distribution for OSX has recently become availible in the downloads section at CodeByDesign. This includes proper Mac installs. The install should be done in the following order;

1. Qt Runtime
2. unixODBC
3. drivers in any order

Others

Proper install packages are also avalible for other platforms such as the Debian package format for Debian Linux. Check with the O/S vendor.

Where Are Installed Files

The location for files vary somewhat depending upon how you installed unixODBC (source or binary) and which platform you installed on. Furthermore; the location can be changed during a source install by './configure --prefix='.

Typically;

- library files will go in /usr/lib or /usr/local/lib
- binaries will go in /usr/bin or /usr/local/bin
- system config files will go in /etc or /usr/local/etc

The system config files are;

- odbcinst.ini - list of registered drivers
- odbc.ini - system data source names

The location of the system config files can be changed by setting the ODBCSYSINI environment variable at run-time. The system config files can be edited using a simple text editor but it is recommended that you use the ODBCConfig GUI tool or the odcinst command-line tool because they will validate the reading and writing of these files while ensuring that the current location is used.

Mac OSX: The OSX binary install will use; /usr/lib, /usr/bin, /Applications/Utilities and /etc.

Post Install

You now have an ODBC sub-system installed on your system(s). What is the system administrators role from here? The system administrator is the only person who can install and register ODBC drivers and create/edit/delete system Data Source Names (DSN).

Drivers

Drivers should be installed and configured based upon the driver vendors instructions. Many drivers do not include a full install process - lacking the driver registration step. These drivers can be registered using the ODBCConfig GUI tool or the odbcinst command-line tool.

System DSN

These can be created using the ODBCConfig GUI tool or the odbcinst command-line tool. ODBCConfig is the prefered method but not all drivers have a User Interface (U.I.) part.

Mac OSX: In some cases the ODBCConfig icon will not open. In such a case you should drop to a terminal window and use the open command.

# open /Applications/Utilities/ODBCConfig.app

Summary

unixODBC implements an ODBC sub-system for a wide variety of platforms. unixODBC can be installed using; binary, source and source from CVS. Drivers can be installed using installation methods created by the driver vendor with unixODBC tools availible to fill any gaps. ODBC system information can be managed using; ODBCConfig, odbcinst, or a text editor.