R连接到Oracle - 库(ROracle)失败

时间:2016-07-04 14:28:59

标签: r oracle dll

它不会加载库。

setwd("C:/Users/***/Desktop")
install.packages('ROracle_1.2-1.zip', repos = NULL)
#Installing package into ‘C:/Users/***/Documents/R/win-library/3.3 (as ‘lib’ is unspecified)

#package ‘ROracle’ successfully unpacked and MD5 sums checked

library('ROracle')
#Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'C:/Users/***/Documents/R/win-library/3.3/ROracle/libs/x64/ROracle.dll': LoadLibrary failure:  The specified module could not be found.

我手动检查了文件路径,ROracle.dll就在那里。

编辑:

我有RODBC和RJDBC工作。我只是不明白为什么不会安装ROracle:

library(ROracle)
Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  unable to load shared object 'C:/Users/robsoo01/Documents/R/win-library/3.3/ROracle/libs/x64/ROracle.dll':
  LoadLibrary failure:  The specified module could not be found.

Error: package or namespace load failed for ‘ROracle’
 install.packages("ROracle")
Installing package into ‘C:/Users/***/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘ROracle’
Do you want to attempt to install these from sources?
y/n: y
installing the source package ‘ROracle’

trying URL 'https://cran.rstudio.com/src/contrib/ROracle_1.2-2.tar.gz'
Content type 'application/x-gzip' length 304229 bytes (297 KB)
downloaded 297 KB

* installing *source* package 'ROracle' ...
** package 'ROracle' successfully unpacked and MD5 sums checked
ERROR: cannot find Oracle Client.
       Please set OCI_LIB64 to specify its location.
Warning: running command 'sh ./configure.win' had status 1
ERROR: configuration failed for package 'ROracle'
* removing 'C:/Users/***/Documents/R/win-library/3.3/ROracle'
* restoring previous 'C:/Users/***/Documents/R/win-library/3.3/ROracle'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\***\Documents\R\win-library\3.3" C:\Users\***\AppData\Local\Temp\RtmpMvcLO4/downloaded_packages/ROracle_1.2-2.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\***\AppData\Local\Temp\RtmpMvcLO4\downloaded_packages’

我猜测有些Oracle文件需要安装,但没有一个文档非常清楚。

1 个答案:

答案 0 :(得分:1)

为了正确安装和加载ROracle,您应该拥有Oracle Client 64位和Windows 64位。在我的计算机上安装64位Oracle客户端后,此错误就消失了。