Skip to content

Instantly share code, notes, and snippets.

@jgilfillan
Last active December 21, 2021 17:35
Show Gist options
  • Save jgilfillan/7b0281067ed9feb4a71c to your computer and use it in GitHub Desktop.
Save jgilfillan/7b0281067ed9feb4a71c to your computer and use it in GitHub Desktop.
Instructions on how to install ROracle for R on Windows.

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.1-11.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")
# NOTE: never store passwords in a saved script!!
con <- dbConnect(drv, "USER GOES HERE", "PASSWORD GOES HERE", dbname='XXX')

test connection:

dbReadTable(con, 'DUAL')
@AlbertoCamposSilva
Copy link

Installation of ROracle is a bit tricky.

  1. Download ROracle package on your PC: https://www.oracle.com/database/technologies/roracle-downloads.html
    Download the tar.gz package!

  2. Access the INSTALL file on ROracle sub-directory and follow the instructions. The installation differs if you have or not Oracle installed on your machine.

Good instructions in: # https://medium.com/analytics-vidhya/how-to-install-roracle-on-windows-10-144b0b923dac

IMPORTANT

ROracle can't be directly installed on R4+

So, download ROracle package on your PC: https://www.oracle.com/database/technologies/roracle-downloads.html
Download the tar.gz package!

Install it on your RStudio with the following command:

install.packages('C:\Downloads\ROracle_1.3-2.tar.gz', repos = NULL, type="source")

Don't forget to correct the directory in which you've downloaded the file. This will recompile your package to version 4 of R.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment