All Forums Connectivity
sreevaddi 9 posts Joined 07/12
07 Nov 2012
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 ?
 

ulrich 816 posts Joined 09/09
07 Nov 2012

I would try JDBC connect on Linux
check
http://forums.teradata.com/forum/analytics/connecting-to-teradata-in-r-via-the-teradatar-package
 

feel free to donate bitcoin:12kgAUHFUqvG2sQgaRBXFhCwyf9HXdkGud

toddb 13 posts Joined 10/10
29 May 2013

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.

Alexander K 22 posts Joined 09/13
28 Feb 2014

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-teradata-express-vm-version

You must sign in to leave a comment.