Forum Stats

  • 3,768,883 Users
  • 2,252,868 Discussions
  • 7,874,780 Comments

Discussions

install ROracle 1.3.2 on R 3.6.1 on windows 10

siakhooi
siakhooi Member Posts: 41
edited Nov 17, 2019 9:59PM in R Technologies

I have problem to get ROracle working on windows 10.

i have tried a few methods from internet, no idea.

Install from Repo

C:\Users\xxx\Downloads\R>R

R version 3.6.1 (2019-07-05) -- "Action of the Toes"

Copyright (C) 2019 The R Foundation for Statistical Computing

Platform: x86_64-w64-mingw32/x64 (64-bit)

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(ROracle)

Error in library(ROracle) : there is no package called 'ROracle'

> install.packages("ROracle")

--- Please select a CRAN mirror for use in this session ---

Package which is only available in source form, and may need

  compilation of C/C++/Fortran: 'ROracle'

  These will not be installed

>

Install from Local

I download ROracle-1.3.2.zip  from

https://www.oracle.com/database/technologies/roracle-downloads.html

put in same directory as I started R

C:\Users\xxx\Downloads\R>R

R version 3.6.1 (2019-07-05) -- "Action of the Toes"

Copyright (C) 2019 The R Foundation for Statistical Computing

Platform: x86_64-w64-mingw32/x64 (64-bit)

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.

> install.packages("ROracle-1.3.2.zip")

inferring 'repos = NULL' from 'pkgs'

Error in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :

  cannot open the connection

In addition: Warning message:

In read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :

  cannot open compressed file 'ROracle-1.3.2/DESCRIPTION', probable reason 'No such file or directory'

>

Best Answer

  • siakhooi
    siakhooi Member Posts: 41
    edited Nov 17, 2019 8:34PM Accepted Answer

    Hi Sherry,

    thanks! But none of this work, instead, i found out this, the Version in the DESCRIPTION file might be wrong. probably Oracle need to fix the download file.

    it stated as 'Version: 1.3-2'

    hyphen between 3 and 2, which it should be a dot.

    Below are the steps that i sucessfully install ROracle 1.3.2

    1. unzip ROracle-1.3.2
    2. edit ROracle-1.3.2\DESCRIPTION file
      1. change
        Version: 1.3-2
        to
        Version: 1.3.2
    3. edit ROracle-1.3.2\MD5
      1. change
        61b15fa3d2034b33ff844f3b5687afbc *DESCRIPTION
        to
        c303dd10db14c5c9f8ea2ee532498740 *DESCRIPTION
    4. zip ROracle-1.3.2 back to ROracle-1.3.2.zip
    5. start R, and run
      1. install.packages("ROracle-1.3.2.zip")
    6. go to directory that install R
      1. rename directory
        library/ROracle-1.3.2
        to
        library/ROracle

    I am not sure why I need to do step 6, but apparently the library can be loaded after i do no 6.

    > library(ROracle)

    Loading required package: DBI

    >

    Now, I am facing the " ORA-12560: TNS:protocol adapter error", I will create a new post to discuss on that if i can't find any solutions.

    Thank you for looking into my question.

Answers

  • Sherry Lamonica-Oracle
    Sherry Lamonica-Oracle Posts: 438 Employee
    edited Nov 15, 2019 5:51PM

    The error you are seeing when installing ROracle's source packages indicates that R can't find the compiler on your system to build the package:

    Package which is only available in source form, and may need compilation of C/C++/Fortran: 'ROracle'

    To build R packages on Windows, you need to have devtools installed and configured.

    The error you receive when installing the ROracle binary:

    Error in read.dcf..cannot open the connection

    is typically related to the antivirus blocking the unzipping of the archive on your system. R unpacks the files too quickly for the antivirus to scan it.  In this case you have a few options:

    1) Turn off your antivirus, if possible

    2) Unzip the ROracle binary manually and install the unpacked directory directly

    At the OS command line:

    R CMD INSTALL ROracle-1.3.2

    or, in R:

    install.packages("ROracle-1.3.2", type="win-binary")

    Another cause for this error is that you don't have write access to the directory where you are installing the package, so you'll want to check the file permissions as well.

    Sherry

  • siakhooi
    siakhooi Member Posts: 41
    edited Nov 17, 2019 8:34PM Accepted Answer

    Hi Sherry,

    thanks! But none of this work, instead, i found out this, the Version in the DESCRIPTION file might be wrong. probably Oracle need to fix the download file.

    it stated as 'Version: 1.3-2'

    hyphen between 3 and 2, which it should be a dot.

    Below are the steps that i sucessfully install ROracle 1.3.2

    1. unzip ROracle-1.3.2
    2. edit ROracle-1.3.2\DESCRIPTION file
      1. change
        Version: 1.3-2
        to
        Version: 1.3.2
    3. edit ROracle-1.3.2\MD5
      1. change
        61b15fa3d2034b33ff844f3b5687afbc *DESCRIPTION
        to
        c303dd10db14c5c9f8ea2ee532498740 *DESCRIPTION
    4. zip ROracle-1.3.2 back to ROracle-1.3.2.zip
    5. start R, and run
      1. install.packages("ROracle-1.3.2.zip")
    6. go to directory that install R
      1. rename directory
        library/ROracle-1.3.2
        to
        library/ROracle

    I am not sure why I need to do step 6, but apparently the library can be loaded after i do no 6.

    > library(ROracle)

    Loading required package: DBI

    >

    Now, I am facing the " ORA-12560: TNS:protocol adapter error", I will create a new post to discuss on that if i can't find any solutions.

    Thank you for looking into my question.

  • siakhooi
    siakhooi Member Posts: 41
    edited Nov 17, 2019 9:59PM

    Hi Sherry,

    i am managed to connect to our oracle database, but when i did:

    > dbGetInfo(drv)

    $driverName

    [1] "Oracle (OCI)"

    $driverVersion

    [1] "1.3-2"

    the version still 1.3-2 (a hythen)

    i think there are more fix required for this version of ROracle.

    Anyway, I am able to query tables in our database. All good.

    > dbReadTable(con, 'DUAL')

      DUMMY

    1     X