How to install ROracle package on Windows 7?

installation, oracle, r

Solution

From http://jgilfillan.github.io/2016/05/28/how-to-install-roracle-in-windows-7/

Download binary from oracle: http://www.oracle.com/technetwork/database/database-technologies/r/roracle/downloads/index.html

The run the following command in r, substituting the file path:

setwd('xxxxx')   # set to path of download
install.packages('ROracle_1.2-1.zip', repos = NULL)

Then load the library and use the package - you may have to change XXXX to whatever is in your TNS Names:

library('ROracle')
drv <- dbDriver("Oracle")
con <- dbConnect(drv, "USER GOES HERE", "PASSWORD GOES HERE", dbname='XXX')

test connection:

dbReadTable(con, 'DUAL')

Note that this has also been confirmed to work on Windows 10.

Problem

I'm trying to install ROracle package on my Windows 7 client. I have Oracle Instant client and Rtools installed, DBI package is istalled, OCI32_LIB environmental variable has been set. But when I try to install from command line: ``` C:\Temp>R CMD INSTALL --build ROracle_1.1-10.tar.gz * installing to library 'C:/Users/myaccount/Documents/R/win-library/3.0' * installing *source* package 'ROracle' ... ** package 'ROracle' successfully unpacked and MD5 sums checked ERROR: configuration failed for package 'ROracle' * removing 'C:/Users/myaccount/Documents/R/win-library/3.0/ROracle' C:\Temp> ``` When I try to install from source: ``` > install.packages("ROracle",type = "source") Warning in install.packages : package ‘ROracle’ is not available (for R version 3.0.0) Installing package into ‘C:/Users/myaccount/Documents/R/win-library/3.0’ (as ‘lib’ is unspecified) trying URL 'http://cran.at.r-project.org/src/contrib/ROracle_1.1-10.tar.gz' Content type 'application/x-gzip' length 168193 bytes (164 Kb) opened URL downloaded 164 Kb * installing *source* package 'ROracle' ... ** package 'ROracle' successfully unpacked and MD5 sums checked ERROR: configuration failed for package 'ROracle' * removing 'C:/Users/myaccount/Documents/R/win-library/3.0/ROracle' Warning in install.packages : running command '"C:/PROGRA~1/R/R-30~1.0/bin/i386/R" CMD INSTALL -l "C:\Users\myaccount\Documents\R\win-library\3.0" C:\Users\myaccount\AppData\Local\Temp\RtmpGggbyp/downloaded_packages/ROracle_1.1-10.tar.gz' had status 1 Warning in install.packages : installation of package ‘ROracle’ had non-zero exit status The downloaded source packages are in ‘C:\Users\myaccount\AppData\Local\Temp\RtmpGggbyp\downloaded_packages’ ``` What should I do, how to proceed?

Original source