ROracle does not work in studio R

I am trying to install the ROracle package on a unix box. The package is installed correctly. But the library (ROracle) is not working properly with an error

library(ROracle) Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/u01/group1/home/oracle/R/x86_64-redhat-linux-gnu-library/3.1/ROracle/libs/ROracle.so': libclntsh.so.11.1: cannot open shared object file: No such file or directory Error: package or namespace load failed for 'ROracle' 

The package installs fine from the command line, but just doesn’t work in studio R. I went through many threads on the forum, and many of them suggested exporting LD_LIBRARY_PATH and reset it.infact, and I went over and copied all the R system variables from the command line to R Studio But that still doesn't work.

One thing I also noticed is that the R system variables change every time I restart studio R. Maybe the problem is that studio R is not taking the path values ​​correctly.

+4
source share
2 answers

It seems that the problem is caused by the environment variable $ LD_LIBRARY_PATH, which is not set in such a way that it is system-wide. Unlike other environment variables, $ LD_LIBRARY_PATH requires special handling (see Ubuntu's help page and find ld. So.conf.d )

I managed to solve this problem by setting $ LD_LIBRARY_PATH according to comment 15 :

echo "/usr/lib/oracle/11.2/client64/lib" | sudo tee /etc/ld.so.conf.d/oracle.conf

Modify the echo statement where your Oracle Instant Client libraries are stored. (Mine can be found by running echo $OCI_LIB .

Then update the cache:

sudo ldconfig -v

Then open RStudio, execute library("ROracle") and it should work.

+6
source

I had the same problem, and I just resolved it through a conference with very friendly and helpful Oracle staff.

We need to include the following line in the /etc/rstudio/rserver.conf file (which is empty by default ):

 rsession-ld-library-path=/usr/lib64/R/lib:/u01/app/oracle/product/12.1.0.2/dbhome_1/lib 

i.e. R and Oracle source directories:

 $ echo $R_HOME /usr/lib64/R $ echo $ORACLE_HOME /u01/app/oracle/product/12.1.0.2/dbhome_1 

After changing the configuration file, you need to restart the RStudio server.

I checked this only with an RStudio server, so I'm not sure if this is necessary for RStudio Desktop either ...

See here for more details (although this applies to Oracle R Enterprize, it also applies to vanilla R).

+2
source

All Articles