1

I am working on a machine without admin rights. I use sql developer to connect to an internal database. I would like to connect via R also.

Is there any way I can do this, without admin rights? Some solutions require me to set up a systemDNS - which I can not do. Other requires me to install jvm.dll

My environment: Windows7, sqldeveloper, connection method is via TNS file.

12
  • use ROracle package? this will require Oracle instant client to be unzipped into a folder locally Commented Jul 20, 2018 at 7:57
  • Well. I Tried but got Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘ROracle’. Various solutions to this was e.g. install "RTools" package - but that didn't help. Another solution was to choose another repo (my default is a rstudio mirror) - but that did'nt work either. Commented Jul 21, 2018 at 9:40
  • U can install Rtools into a folder that does not require admin rights Commented Jul 21, 2018 at 12:12
  • Ahhh - I tried to downlaod rtools via install.packages - but I donwload it manually from Cran. Now I can compile ROracle. But I need an oracle account to download the instant client. And it seems the account confirmation email is caught in my spamfilter. Will report my progress tomorrow. :-) Commented Jul 22, 2018 at 20:38
  • Got the instant client unzipped locally. But the install fails with this message: "ERROR: cannot find Oracle Client. Please set OCI_LIB64 to specify its location." - I guess this is a system enivoronment variable i win 7? Which I need an admin account to change. Is that correct? Commented Jul 22, 2018 at 20:50

2 Answers 2

1

Connecting to SQL Developer via R is far more difficult than other databases I've encountered. It's important that you have jdbc6.jar installed on your machine, and that you know the file path to where it was installed. Installing the jar file does not require admin rights. You can install the jar file from Oracle's website.

I use the RJDBC package to connect like so:

    library(RJDBC)

    jdbcDriver <- JDBC("oracle.jdbc.OracleDriver", classPath = "file path to where ojdbc6.jar is installed on your computer")

    jdbcConnection <- dbConnect(jdbcDriver, "jdbc:oracle:thin:@YOUR_SERVER","YOUR_USERNAME","YOUR_PASSWORD")

You can then test the connection with a number of commands; I typically use:

    dbListTables(jdbcConnection)

Another favorite of mine is to use dbplyr for dplyr-like functions when working with databases:

    library(dbplyr)

    tbl(jdbcConnection, "SAMPLE_TABLE_NAME")

The resulting output will be the data from the queried table in tibble form.

Sign up to request clarification or add additional context in comments.

Comments

0

You can set the environment variables in your R session.

Sys.setenv(OCI_LIB64="/Path/to/instantclient",OCI_INC="/Path/to/instantclient/sdk/include")

You can put this in the file .Rprofile in your home directory, and RStudio will run it each time you begin a new session. Once you have this in .Rprofile you should be able to install ROracle.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.