Ensure unixODBC has not been installed via rpm. If it has remove it prior to trying to install unixODBC 2.3.1.
# rpm -qa | grep unixODBC
This should return nothing; if any packages are listed, use yum to remove them:
Install other prerequisite packages necessary for the successful build and installation of the drivers:
Create a link to ksh so the tdodbc rpm will properly install:
# ln -s /bin/ksh /usr/bin/ksh
Build and install the unixODBC 2.3.1 driver manager:
# wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.1.tar.gz
# tar -zxf unixODBC-2.3.1.tar.gz
By default configure will cause unixodbc to install under /usr/local/
Install the Teradata ODBC driversGet the files:
Sign in to
http://downloads.teradata.com/download/connectivity/odbc-driver/linux and download
tdodbc__linux_indep.14.10.00.00-1.tar.gz to directory teradata_odbc.
# tar -zxf tdodbc__linux_indep.14.10.00.00-1.tar.gz
# tar -zxf tdicu__linux_indep.14.10.00.00-1.tar.gz
# tar -zxf TeraGSS_linux_x64__linux_indep.14.10.00.06-1.tar.gz
Install RPMs:
# rpm -ihv tdicu/tdicu-14.10.00.00-1.noarch.rpm
# rpm -ihv TeraGSS/TeraGSS_linux_x64-14.10.00.06-1.noarch.rpm
# rpm -ihv tdodbc/tdodbc-14.10.00.00-1.noarch.rpm
Update ODBC ini files. To find the ini files enter:
Edit odbcinst.ini (drivers) and add the following:
Driver=/opt/teradata/client/14.10/odbc_64/lib/tdata.so
Edit odbc.ini (DSNs) and add the following. Modify Username, Password and Database if desired otherwise leave blank:
InstallDir=/opt/teradata/client/14.10/odbc_64
TraceDll=/opt/teradata/client/14.10/odbc_64/lib/odbctrac.so
TraceFile=/usr/joe/odbcusr/trace.log
Driver=/opt/teradata/client/14.10/odbc_64/lib/tdata.so
Description=Teradata database
DBCName=<MachineName or ip>
Verify Teradata connection using isql:# isql tddsn <username> <password>
+---------------------------------------+
+---------------------------------------+
SQL> select * from Database.Table;
Modify LD_LIBRARY_PATH to so that Revolution R Enterprise can locate the driver:# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(odbc_config --lib-prefix)
Example in Revolution R Enterprise (DSNless). Modify TeradataConnString parameters as needed:TeradataConnString <- "DRIVER=Teradata;DBCNAME=machinename;DATABASE=databasename;UID=username;PWD=password;"
rxOdbcDS <- RxOdbcData(sqlQuery = "SELECT * FROM db.table", connectionString = TeradataConnString)