Teradata ODBC Driver
To access a Teradata Database via unixODBC you need a driver.
The Teradata ODBC Driver is part of the Informix Client SDK.
You get it the Teradata ODBC Driver free after registration from https://downloads.teradata.com/
At time of writing I used https://downloads.teradata.com/download/connectivity/odbc-driver/linux and downloaded the 64-Bit Version tdodbc2000__linux_x8664.20.00.00.48-1.tar.gz
Teradata ODBC Driver Installation
Prerequisites
unixODBC should be installed first, see Unix ODBC Installation
Extract tar file to installation directory
I created a directory /opt/install/informix and copied the tar file to this directory
cd /opt/install/
tar xfz tdodbc2000__linux_x8664.20.00.00.48-1.tar.gz
# this will create a directory /opt/install/tdbodbc2000 containing an rpm file
dnf install /opt/install/tdodbc2000/tdodbc2000-20.00.00.48-1.x86_64.rpm
# Warning: if you installed unixODBC as a package, this will overwrite /usr/lib64/libodbc.so
# with a symbolic link
# /usr/lib64/libodbc.so -> /opt/teradata/client/20.00/lib64/libodbc.so
# Repair unixODBC
dnf reinstall unixODBC
# Check
ls -l /usr/lib64/libodbc.so
# This should show repaired link:
# /usr/lib64/libodbc.so -> libodbc.so.2.0.0
Configure unixODBC
Next step is to integrate the Teradata ODBC Driver into unixODBC.
Configure dsn in odbc.ini
The file odbc.ini in usually located /usr/local/etc/odbc.ini, /etc/odbc.ini, /etc/unixODBC/odbc.ini.
If you have installed unixODBC from repository, you will use /etc/odbc.ini.
For each connection a datasource name dsn is configured in odbc.ini
[VantageExpress20]
; VantageExpress20 is the datasource name
Description=VantageExpress20 demo database
Driver=/opt/teradata/client/20.00/lib64/tdataodbc_sb64.so
DBCName=vantage.mycompany.intern
; DBCName can be an ip address, a dns name or a name for cop naming schema you got from your Teradata DB Administration
Test the configured dsn
For testing you need to set these environment varibles:
export ODBCINI=/etc/odbc.ini
The configured dsn can be tested with isql:/usr/local/bin/isql (if your compiled unixODBC from source) or /usr/bin/isql (unixODBC installed as package)
$ echo "select * from dbc.dbcinfo;" | isql -v vantageexpress20 username password
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| InfoKey | InfoData |
+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| VERSION | 20.00.28.81 |
| LANGUAGE SUPPORT MODE | Standard |
| RELEASE | 20.00.28.81 |
+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
SQLRowCount returns 3
3 rows fetched $
Troubleshooting
Some typical errormessages
| isql errormessage | Reason |
|---|---|
| [ISQL]ERROR: Could not SQLConnect | use isql -v to get a more detailed message |
| [IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified | Wrong datasource in isql command |
| [28000][unixODBC][Teradata][ODBC Teradata Driver][Teradata Database] (210) The UserId, Password or Account is invalid. FailCode = -8017 [ISQL]ERROR: Could not SQLConnect | Wrong username or wrong password |
Next Step
If the isql Test works, your are ready to configure the Oracle Gateway to ODBC and the Database Link in your Oracle Database: Configure Oracle Gateway for ODBC with Informix ODBC