Using ROracle with Oracle Instant Client 12c

Christos - Iraklis TsatsoulisOracle R, R Leave a Comment

The other day, while setting up the new Oracle R Enterprise (ORE) 1.5 client packages in a Linux server, we installed the Oracle DB Instant Client v. 12.1, as advised in the relevant documentation.

Problem was, ORE failed to load, in fact due to ROracle failure:

> library(ORE)
[...]
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/usr/lib64/R/library/ROracle/libs/ROracle.so':
  libclntsh.so.11.1: cannot open shared object file: No such file or directory
Error: package ‘OREdm’ could not be loaded

Truth is, the file libclntsh.so.11.1 did not exist, but this was expected, simply due to the installed client being 12.1, and not 11.1:

[ctsats@dev-hd-01 ~]$ cd /usr/lib/oracle/12.1/client64/lib
[ctsats@dev-hd-01 lib]$ ll
total 190276
[...]
-rwxrwxr-x 1 root root   6990875 Jul  7  2014 libclntshcore.so.12.1
-rwxrwxr-x 1 root root  58793741 Jul  7  2014 libclntsh.so.12.1
[...]

What is happening is that ROracle, despite being up to date (version 1.2-1), looks only for the 11.1 client.

The solution is to create a symbolic link in the Oracle Instant Client directory, pointing from the file libclntsh.so.11.1 (which is what ROracle is looking for) to libclntsh.so.12.1 (the existing one):

[ctsats@dev-hd-01 lib]$ ln -s libclntsh.so.12.1 libclntsh.so.11.1
[ctsats@dev-hd-01 lib]$ ll
total 190276
[...]
lrwxrwxrwx 1 root root        17 Feb 16 12:36 libclntsh.so.11.1 -> libclntsh.so.12.1
[...]

after which the issue is resolved.

See also the discussion I opened in the relevant Oracle R Technologies forum.

Christos - Iraklis Tsatsoulis
Latest posts by Christos - Iraklis Tsatsoulis (see all)
Subscribe
Notify of
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments