Trying to use Teradata ODBC drivers on linux redhat with UnixODBC driver manager

Database

Trying to use Teradata ODBC drivers on linux redhat with UnixODBC driver manager

Hello,
Where can one find instructions on how to get the Teradata ODBC drivers with the UnixODBC Driver Manager?
Regards!
Tags (1)
8 REPLIES

Re: Trying to use Teradata ODBC drivers on linux redhat with UnixODBC driver manager

After a day of research and trial and error I found a solution that works.

Simply install
1. Teradata ODBC Drivers
2. UnixODBC 2.3.0

Turnes out unixODBC prior to 2.3.0 had a bug that was preventing the proper use of the teradata drivers.
Shoot me a note if you want more details.
N/A

Re: Trying to use Teradata ODBC drivers on linux redhat with UnixODBC driver manager

Could you, please, post here more details? I have a similar issue (with unixODBC 2.2.11).

Thanks!

Re: Trying to use Teradata ODBC drivers on linux redhat with UnixODBC driver manager

Nope, does not work even when using UnixODBC 2.3.0

Please someone post some solutions.

Re: Trying to use Teradata ODBC drivers on linux redhat with UnixODBC driver manager

Using unixODBC 2.3.1 and tdodbc 13.00.00.08, I am able to connect to Teradata using the 'isql' command included with unixODBC.

My Teradata driver entry in odbcinst.ini:

[Teradata]

Driver=/opt/teradata/client/ODBC_64/lib/tdata.so

APILevel=CORE

ConnectFunctions=YYY

DriverODBCVer=3.51

SQLLevel=1

The DSN entry in odbc.ini:

[DSN NAME]

Driver=Teradata

Description=MY TERADATA SERVER

DBCName=dbname

DateTimeFormat=III

SessionMode=Teradata

UseDataEncryption=Yes

Some other configuration comments:

  1. I do not have 'root' level access on my server so I installed 'unixODBC' into a custom directory, not into the root-level directories.
  2. At one point I moved my 'unixODBC' top-level directory into a different directory structure, this seemed to break things.  I re-configured and re-compiled it with the new location.  I may have had other issues that caused moving it to break, but this is how I fixed the issues.
  3. For unixODBC, I am setting the following environment variables:

    ODBCHOME: Set to my custom installation directory

    PATH: Modified to include '$ODBCHOME/bin'

    LD_LIBRARY_PATH: Modified to include '$ODBCHOME/lib'

    ODBCINI: Set to $ODBCHOME/etc/odbc.ini

     
  4. For Teradata, I am setting the following environment variables:

    LD_LIBRARY_PATH: Adding '.../teradata/client/lib'

In addition to the above, I am also using Perl's DBI and DBD::ODBC packages to access Teradata.  When accessing Teradata from Perl, SQL executes correctly but if I encounter a database error, I get the text:

[unixODBC][Driver Manager]Driver returned SQL_ERROR or SQL_SUCCESS_WITH_INFO but no error reporting API found (SQL-HY000)

Without error messages being returned I don't feel comfortable using unixODBC and Teradata, but I'm very close I think.

Re: Trying to use Teradata ODBC drivers on linux redhat with UnixODBC driver manager

So if I am on a corporate system with unixODBC 2.2.1 I am SOL unless I go the route of building my own version based on 2.3.0 or 2.3.1?

Also, since I cannot modify /etc/odbcinst.ini, what do I need to do to my odbc.ini to (try) to make it work?

Fan

Re: Trying to use Teradata ODBC drivers on linux redhat with UnixODBC driver manager

I am facing similar issues with Teradata connectivity. Using unixODBC ( which is the only option if you need to connect to multiple database servers in one application ), there is no error reporting.

This is a serious flaw in the driver stack on Linux.

Is there an official stance on this ( other than the 'unixODBC is not supported' line )?

Enthusiast

Re: Trying to use Teradata ODBC drivers on linux redhat with UnixODBC driver manager

I need to setup some perl scripts to access a teradata db.  I'm on Red Hat 5.7 and I don't have root so I have done the following:

1) Installed unixODBC-2.3.2 into a custom directory

2) I used CPAN to install DBD::ODBC into a custom directory

I see that I'm supposed to now get the teradata ODBC drivers, however the download site only allows an RPM install, and I can't do that on my server.  Right now both my 'odbc.ini' and 'odbcinst.ini' are empty.  

Can the teradata install be done as non-root?  

Enthusiast

Re: Trying to use Teradata ODBC drivers on linux redhat with UnixODBC driver manager

I'm hoping someone can help me get this to work.  I'll be glad to post anything you need to help debug this.  So far this is what I've done being a non-root user into custom directories.  We're running RedHat 5.7.

1) installed unixODBC-2.3.2

2) installed DBD::ODBC via cpan

3) installed these Teradata odbc drivers 

    tdicu__linux_indep.14.10.00.00-1.tar.gz

    tdodbc__linux_indep.14.10.00.00-1.tar.gz

4) updated both the odbc.ini and the odbcinst.ini located in the path for the unixODBC manager.  Does the unixODBC manager odbcinst.ini contain info for the teradata? 

     odbc.ini

    [tera_dsn]

    Driver=/home/mechid/lib/libodbc.so

    odbcinst.ini

    [Default]

    Driver          =  /home/mechid/lib/libodbc.so

    [tera_dsn]

    Driver          =  /home/mechid/teradata/client/14.10/odbc_64/lib/tdata.so

    APILevel=CORE

    ConnectFunctions=YYY

    DriverODBCVer=3.51

    SQLLevel=1

5) There are numerous paths where I can edit the odbc.ini and the odbcinst.ini files within the teradata directory.  I'm not exactly sure which one is correct?

    odbcinst.ini

    /home/mechid/teradata/client/.ODBC_32_PRE130_BRIDGE/odbcinst.ini

    /home/mechid/teradata/client/ODBC_32/odbcinst.ini

    /home/mechid/teradata/client/14.10/odbc_64/odbcinst.ini

    /home/mechid/teradata/client/14.10/odbc_32/odbcinst.ini

    /home/mechid/teradata/client/.ODBC_64_PRE130_BRIDGE/odbcinst.ini

    /home/mechid/teradata/client/ODBC_64/odbcinst.ini

    odbc.ini

    /home/mechid/teradata/client/ODBC_32/odbc.ini

    /home/mechid/teradata/client/14.10/odbc_64/odbc.ini

    /home/mechid/teradata/client/14.10/odbc_32/odbc.ini

    /home/mechid/teradata/client/ODBC_64/odbc.ini

6)  I picked path /home/mechid/teradata/client/14.10/odbc_64 and this is what I have in the odbc.ini and odbcinst.ini files.

    odbc.ini

    [tera_dsn]

    Driver=/home/mechid/teradata/client/14.10/odbc_64/lib/tdata.so

    Description=MYDSN06/EDWP

    DBCName=cnewp.sbc.com

    LastUser=

    Username=XXXXXX

    Password=xxxx

    Database=

    DefaultDatabase=

    odbcinst.ini

    [ODBC DRIVERS]

    Teradata=Installed

    [tera_dsn]

    Driver=/home/mechid/teradata/client/14.10/odbc_64/lib/tdata.so

    APILevel=CORE

    ConnectFunctions=YYY

    DriverODBCVer=3.51

    SQLLevel=1

7)  These are set in my profile

    LD_LIBRARY_PATH=/home/mechid/lib:/home/mechid/teradata/client/14.10/odbc_64/lib

    ODBCINI=/home/mechid/teradata/client/ODBC_64/odbc.ini

8)  This is in my perl script for the connection string

    my $dbh = DBI->connect('dbi:ODBC:tera_dsn',$username,$password);

9)  and this is the error that I'm getting when running the script

    DESTROY for DBI::db=HASH(0xb70c4d0) ignored - handle not initialised

DBI connect('tera_dsn','XXXXXX',...) failed: [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed (SQL-IM004) at ./SendReports.pl line 18