[R] need help to resolve RODBC error

Marc Schwartz marc_schwartz at me.com
Fri Feb 26 23:32:09 CET 2010


On Feb 26, 2010, at 1:04 PM, Yan Zhang wrote:

> I've installed R-2.9.2 (64 bit), unixODBC-2.2.14-p2 (64 bit) and RODBC_1.2-5 (64 bit) on a 64 bit Redhat Linux server (Red Hat Enterprise Linux Server release 5.4 (Tikanga), x86_64) release 2.6.18-164.2.1.el5.  I've tested the ODBC drive via isql and the test was success:
> 
> [yzhang at ROracleTest ~]$ isql -v DRTST yzhang  test
> +---------------------------------------+
> | Connected!                            |
> |                                       |
> | sql-statement                         |
> | help [tablename]                      |
> | quit                                  |
> |                                       |
> +---------------------------------------+
> SQL> select sysdate from dual;
> +--------------------+
> | SYSDATE            |
> +--------------------+
> | 2010-02-26 13:57:00|
> +--------------------+
> SQLRowCount returns -1
> 1 rows fetched
> SQL> quit;
> 
> However, when I started up R console on the machine and test the RODBC connectivity to oracle, I got following error:
> 
> [oracle at ROracleTest R]$ R
> 
> R version 2.9.2 (2009-08-24)
> Copyright (C) 2009 The R Foundation for Statistical Computing
> ISBN 3-900051-07-0
> 
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
> 
> Natural language support but running in an English locale
> 
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
> 
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
> 
>> library(RODBC)
>> channel <- odbcConnect("DRTST", uid="yzhang", pwd="test")
> 
> *** caught segfault ***
> address (nil), cause 'unknown'
> 
> Traceback:
> 1: .Call(C_RODBCDriverConnect, as.character(connection), id, as.integer(believeNRows))
> 2: odbcDriverConnect(st, ...)
> 3: odbcConnect("DRTST", uid = "yzhang", pwd = "test")
> 
> Possible actions:
> 1: abort (with core dump, if enabled)
> 2: normal R exit
> 3: exit R without saving workspace
> 4: exit R saving workspace
> 
> I searched around and haven't found any resolution.  Please help.
> 
> Thanks.
> 
> Yan Zhang


Three quick comments:

1. R 2.9.2 is dated and 2.10.1 is available for RHEL 5 via the EPEL:

  http://fedoraproject.org/wiki/EPEL

as you can see here:

  http://download.fedora.redhat.com/pub/epel/5/x86_64/repoview/r.html

I presume that you installed R via RPMs.


2. RODBC version 1.2-5 is a year out of date and has been updated twice since then to version 1.3-0.


3. I don't see any indication above that you installed the Oracle Linux 64 bit ODBC drivers, which are available from:

  http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxx86_64soft.html

The Oracle instant client does not require or use ODBC, but native drivers. So the success of the iSQL connection only serves to confirm that important environment variables and config files are probably ok.


  
At least to start, you need to install the Oracle 64 bit ODBC driver (if you have not already) and update both R and RODBC and see if you still get the errors.

Once you get those installed/updated, be sure to read the vignette for the RODBC package, which will be available within R using:

  vignette("RODBC")


Also, just to be sure that you have 64 bit R installed, check:

  .Machine$sizeof.pointer

and be sure that it returns 8, not 4.


Lastly, there is a R-SIG-DB e-mail list, where this topic is better discussed. More information here:

  https://stat.ethz.ch/mailman/listinfo/r-sig-db

HTH,

Marc Schwartz



More information about the R-help mailing list