RODBC fails and teradataR crashes on RHEL6

Connectivity
Enthusiast

RODBC fails and teradataR crashes on RHEL6

Hi,

R fails to connect to teradata using RODBC.

Installed required packages/drivers on OS in ksh (pdksh)

R v2.15.1

RedHat Enterprise Linux 6

LD_LIBRARY_PATH=/opt/teradata/client/14.00/odbc_64/lib:/usr/pgsql-8.4/lib

ODBCINI=/opt/teradata/client/14.00/odbc_64/odbc.ini

RODBC:

> library(RODBC)
> odbcDataSources()
ODBC
""
testdsn
"/opt/teradata/client/14.00/odbc_64/lib/tdata.so"
default
"/opt/teradata/client/14.00/odbc_64/lib/tdata.so"
mytd
"/opt/teradata/client/14.00/odbc_64/lib/tdata.so"
> channel <- odbcDriverConnect("dsn=mytd;uid=tduser;pwd=passwd;")
Warning message:
In odbcDriverConnect("dsn=mytd;uid=tduser;pwd=passwd;") :
ODBC connection failed
> stat <- .Call(RODBC:::C_RODBCDriverConnect, as.character("dsn=mytd;uid=tduser;pwd=passwd;"), 994.9, as.integer(TRUE), as.logical(FALSE))
> stat
[1] -1

odbcDriverConnect() is higher level function with more steps after establishing the basic connection; which is the second call C_RODBCDriverConnect(). stat should be greater than 0.

teradataR:

> library(teradataR)
> tdConnect("mytd")

*** caught segfault ***
address (nil), cause 'memory not mapped'

Traceback:
1: .Call(C_RODBCDriverConnect, as.character(connection), id, as.integer(believeNRows), as.logical(readOnlyOptimize))
2: odbcDriverConnect(st)
3: tdConnect("mytd")

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection:

teradataR crashes R.

Any help connecting from R (ODBC or JDBC or teradataR) to TeraData ?

3 REPLIES
Supporter

Re: RODBC fails and teradataR crashes on RHEL6

Teradata Employee

Re: RODBC fails and teradataR crashes on RHEL6

You actually need to compile RODBC with teradata to get this to work...try the following in R:

install.packages('RODBC', configure.args=c('--with-odbc-include=/opt/teradata/client/14.00/odbc_32/include','--with-odbc-lib=/opt/teradata/client/14.00/odbc_32/lib'))

You may need to change your teradata directories if you have a different version on your system.

Teradata Employee

Re: RODBC fails and teradataR crashes on RHEL6

I know there are differences between the SLES and Redhat versions, but for ROBDC connectivity and teradataR, check also the following article for ideas; I recently figured out how to get things together under a SLES11 SP1 Teradata Express VM.

http://forums.teradata.com/forum/analytics/connecting-to-teradata-in-r-via-the-teradatar-package-ter...