如何在 Windows 7 上安装 ROracle 包?

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

问题描述

我正在尝试在我的 Windows 7 客户端上安装 ROracle 包.我安装了 Oracle Instant 客户端和 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:UsersmyaccountDocumentsRwin-library3.0" C:UsersmyaccountAppDataLocalTempRtmpGggbyp/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:UsersmyaccountAppDataLocalTempRtmpGggbypdownloaded_packages’

我该怎么办,如何进行?

What should I do, how to proceed?

推荐答案

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

从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 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Execute complex raw SQL query in EF6(在EF6中执行复杂的原始SQL查询)
Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)