Configuring and Connecting on UNIX and Linux
The following basic information enables you to configure a data source and test connect with a driver immediately after installation. See "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 System Information File" and follow the instructions for configuring the system information file (odbc.ini).
Environment Configuration
- Check your permissions: You must log in as a user with full r/w/x permissions recursively on the entire product installation directory.
- Determine which shell you are running by executing:
echo $SHELL
- 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.
- 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 ddtestlib tool, located in the installation_directory/bin directory, is used to verify that the driver can be loaded into memory. For example, to load a driver from the /opt/odbc/lib directory, enter:
where
driver_shared_object_nameis the name of the specific driver file. For example, the Oracle Wire Protocol is ddoraxx.so.If the load is successful, ddtestlib returns a success message along with the version string of the driver. If the driver cannot be loaded, ddtestlib returns an error message explaining why.
Configuring a Data Source Through the UNIX ODBC 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:
To configure a data source:
- To start the UNIX ODBC Administrator, change to the
install_dir/tools directory, whereinstall_diris the path to the product installation directory. At a command prompt, enter:odbcadmin
- Click either the User DSN or File DSN tab to display a list of data sources.
- 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.
- 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.
- The following two options appear on the General tab of all driver Setup dialog boxes:
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
- 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.
- 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.
- 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.