ROracle not working in R studio

谁说我不能喝 提交于 2019-11-29 07:53:21

Seems that the problem is caused by the $LD_LIBRARY_PATH environment variable not being set in a way that is system-wide. Unlike other environment variables, $LD_LIBRARY_PATH needs special treatment (see the Ubuntu Help page and search for ld.so.conf.d)

I was able to solve this by setting the $LD_LIBRARY_PATH as per comment 15:

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

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

Then update the cache:

sudo ldconfig -v

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

I had the exact same problem, and I have just resolved it thanks to a conference with some very kind and helpful Oracle personnel.

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

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

i.e. the R & Oracle home directories:

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

You have to restart the RStudio server after modifying the configuration file.

I have checked this only with RStudio server, so not sure if it is necessary for RStudio Desktop, too...

See here for more details (although it refers to Oracle R Enterprize, it is also applicable to vanilla R).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!