1 Quick Start Connect : Configuring and Connecting on UNIX and Linux

Configuring and Connecting on UNIX and Linux
UNIX iconThe following basic information enables you to configure a data source and test connect with a driver immediately after installation. See Chapter 4 “Configuring the Product on UNIX/Linux” for detailed information about configuring the UNIX/Linux environment and data sources.
NOTE: The following data source configuration information assumes that you have a Motif Graphical User Interface (GUI) in your UNIX/Linux environment. If you do not, see “Configuration Through the odbc.ini File” and follow the instructions for configuring the system information file (odbc.ini).
NOTE: In the following examples, xx in a driver filename represents the driver level number.
Environment Configuration
1
Check your permissions: You must log in as a user with full r/w/x permissions recursively on the entire product installation directory.
2
From your login shell, determine which shell you are running by executing:
echo $SHELL
3
Run one of the following product setup scripts from the installation directory to set variables: odbc.sh or odbc.csh. For Korn, Borne, and equivalent shells, execute odbc.sh. For a C shell, execute odbc.csh. After running the setup script, execute:
env
to verify that the installation_directory/lib directory has been added to your shared library path.
4
Set the ODBCINI environment variable. The variable must point to the path from the root directory to the system information file where your data source resides. The system information file can have any name, but the product is installed with a default file called odbc.ini in the product installation directory. For example, if you use an installation directory of /opt/odbc and the default system information file, from the Korn or Borne shell, you would enter:
ODBCINI=/opt/odbc/odbc.ini; export ODBCINI
From the C shell, you would enter:
setenv ODBCINI /opt/odbc/odbc.ini
Test Loading the Driver
The ivtestlib (32-bit drivers) and ddtestlib (64-bit drivers) test loading tools are provided to test load drivers and help diagnose configuration problems in the UNIX and Linux environments, such as environment variables not correctly set or missing database client components. This tool is installed in the /bin subdirectory in the product installation directory. It attempts to load a specified ODBC driver and prints out all available error information if the load fails.
For example, if the drivers are installed in /opt/odbc/lib, the following command attempts to load the 32-bit Oracle Wire Protocol driver on Solaris, where xx represents the version number of the driver:
ivtestlib /opt/odbc/lib/ivoraxx.so
NOTE: On Solaris, AIX, and Linux, the full path to the driver does not have to be specified for tool. The HP-UX version, however, requires the full path.
If the load is successful, the tool returns a success message along with the version string of the driver. If the driver cannot be loaded, the tool returns an error message explaining why.
Configuring a Data Source Through the Administrator
The DataDirect ODBC Data Source Administrator for UNIX/Linux (the UNIX ODBC Administrator) is located in the /tools directory of the product installation directory. For example:
/opt/odbc/tools/odbcadmin
To configure a data source:
1
To start the UNIX ODBC Administrator, change to the install_dir/tools directory, where install_dir is the path to the product installation directory. At a command prompt, enter:
n
UNIX: odbcadmin
n
Linux: ./odbcadmin
2
Click either the User DSN or File DSN tab to display a list of data sources.
n
User DSN: Select the appropriate data source name and click Configure to display the driver Setup dialog box.
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.
n
File DSN: 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.
The General tab of the Setup dialog box appears by default.
NOTE: The General tab displays only fields that are required for creating a data source. The fields on all other tabs are optional, unless noted otherwise in this book.
3
Data Source Name: Type a string that identifies this data source configuration, such as Accounting.
Description: Type an optional long description of a data source name, such as My Accounting Database.
Provide the requested information for all other options on the General tab; then, click Apply to configure the data source.
Testing the Connection
1
After you have configured the data source, you can click Test Connect on the Setup dialog box to attempt to connect to the data source using the connection options specified in the dialog box. Some drivers immediately return a message indicating success or failure. For most drivers, a logon dialog box appears as described in each individual driver chapter.
2
Supply the requested information in the logon dialog box and click OK. Note that the information you enter in the logon dialog box during a test connect is not saved.
n
If the driver can connect, it releases the connection and displays a Connection Established message. Click OK.
n
If the driver cannot connect because of an incorrect environment or connection value, it displays an appropriate error message. Click OK.
3
On the driver Setup dialog box, click OK. The values you have specified are saved and are the defaults used when you connect to the data source. You can change these defaults by using the previously described procedure to modify your data source. You can override these defaults by connecting to the data source using a connection string with alternate values. See individual driver chapters for information about using connection strings.