How to install ROracle package on Windows 7?

后端 未结 8 706
北海茫月
北海茫月 2020-12-02 14:52

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 h

相关标签:
8条回答
  • 2020-12-02 15:10

    I had exactly this problem. It was caused because when installing RTools I did not check the 'edit PATH' checkbox. I uninstalled RTools and reinstalled it again, this time making sure the checkbox was checked, and it worked first time! Hope this helps.

    0 讨论(0)
  • 2020-12-02 15:11

    I had a similar error when trying to install ROracle from source.1

    After searching around a bit I had to undertake what others have mentioned as well as redownloading the tar.gz. When I double checked the download size it was 10KB instead of 234KB.

    1. Re-Download source from: http://cran.r-project.org/web/packages/ROracle/index.html
    2. Updated the following Environmental Varibles in windows

      SET PATH=C:\Rtools\bin;C:\Rtools\gcc-4.6.3;%PATH% SET OCI_INC=C:\Oracle_11G_ClientR2\product\11.2.0\client_1\oci\include SET OCI_LIB32=C:\Oracle_11G_ClientR2\product\11.2.0\client_1\BIN SET OCI_LIB64=C:\Oracle_11G_ClientR2\product\11.2.0\client_1\BIN R CMD INSTALL --build "C:\temp\ROracle_1.1-12.tar.gz"

    3. Output should look like the following: samplecmdoutput

    1 Here is what the previous error looked like:

    C:\Temp>R CMD INSTALL --build "C:\\temp\\ROracle_1.1-12.tar.gz" 
    Error in getOctD(x, offset, len) : invalid octal digit
    
    0 讨论(0)
  • 2020-12-02 15:12

    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.

    0 讨论(0)
  • 2020-12-02 15:17

    I had this exact problem as well, including the OCI_INC error. They actually talk about it in the INSTALL file in the .tar.gz package, you can read more there.

    You have to set the OCI_INC variable to the include directory like this:

    set OCI_INC=C:\oracle\product\11.2.0\client_2\oci\include
    

    Or whereever your file is. Here was my complete setup to get things installed from an Admin privileged command line.

    set OCI_LIB64=C:\oracle\product\11.2.0\client_2\BIN
    set OCI_INC=C:\oracle\product\11.2.0\client_2\oci\include
    set PATH=C:\oracle\product\11.2.0\client_2\BIN;C:\Rtools\bin;c:\Rtools\gcc-4.6.3\bin;%PATH%
    "C:/PROGRA~1/R/R-30~1.1/bin/x64/R" CMD INSTALL --build "C:/Your/Path/To/ROracle_1.1-10.tar.gz"
    

    Also, make sure to change client_2 to client_1 and OCI_LIB64 to OCI_LIB32 if you are trying to do a 32-bit install.

    0 讨论(0)
  • 2020-12-02 15:23

    Along with the 'Basic Package' and the 'ODBC Package', with Oracle 11g, you should copy unpacked files from the 'SDK package' into the subdirectory instantclient_11_2. In this case, you will not need to define the environment variable Sys.setenv (OCI_INC = "...").

    0 讨论(0)
  • 2020-12-02 15:24

    This is what worked for me:

    Sys.setenv(OCI_LIB32="C:/oracle/product/12.1.0/client_1/BIN/")
    Sys.setenv(OCI_INC="C:/oracle/product/12.1.0/client_1/oci/include/")
    install.packages("ROracle")
    
    0 讨论(0)
提交回复
热议问题