如何在Windows 7上安装ROracle软件包? [英] How to install ROracle package on Windows 7?

查看:103
本文介绍了如何在Windows 7上安装ROracle软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows 7客户端上安装ROracle软件包.我安装了Oracle Instant Client和Rtools,安装了DBI软件包,设置了OCI32_LIB环境变量.但是当我尝试从命令行安装时:

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?

推荐答案

来自从oracle下载二进制文件: http://www.oracle.com/technetwork/database/database-technologies/r/roracle/downloads/index.html

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

在r中运行以下命令,替换文件路径:

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)

然后加载库并使用软件包-您可能必须将XXXX更改为TNS名称中的名称:

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')

测试连接:

dbReadTable(con, 'DUAL')

请注意,这也已确认可以在Windows 10上使用.

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

这篇关于如何在Windows 7上安装ROracle软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆