Install ROracle on Linux

There are a lot of guides/stackoverflow questions related to installing Oracle Instant Client and ROracle on Linux. I had to combine multiple sources to get it working.

The guide uses the as of writing current version 12.1, change the version numbers below if you live in the future.

Here is the end-to-end process I took:

1. Installing Oracle Instant Client and setting up the environment

  • install alien for rpm conversion & libaio
sudo apt-get install alien
sudo apt-get install libaio1
  • go here:

http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html

  • Create an account (Oracle needs to know your shoesize…)
  • Download:

oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm

  • optionally also:

oracle-instantclient12.1-jdbc-12.1.0.2.0-1.x86_64.rpm
oracle-instantclient12.1-odbc-12.1.0.2.0-1.x86_64.rpm

  • cd into where you downloaded the files and for debian-based (like ubuntu) systems convert rpm and then install:
sudo alien -i oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
sudo alien -i oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
sudo alien -i oracle-instantclient12.1-jdbc-12.1.0.2.0-1.x86_64.rpm
sudo alien -i oracle-instantclient12.1-odbc-12.1.0.2.0-1.x86_64.rpm
sudo alien -i oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm
  • add paths to your config & source them:
export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib/${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export ORACLE_HOME=/usr/lib/oracle/12.1/client64
export PATH=$PATH:$ORACLE_HOME/bin
  • add the path to oracle.conf & update cache
echo "/usr/lib/oracle/12.1/client64/lib" | sudo tee /etc/ld.so.conf.d/oracle.conf
sudo ldconfig -v
  • test if paths are set and you see the tools:
echo $LD_LIBRARY_PATH
echo $ORACLE_HOME
echo $PATH
sqlplus   # should give you the command prompt

2. Installing ROracle

sudo R CMD INSTALL --configure-args='--with-oci-lib=/usr/lib/oracle/12.1/client64/lib --with-oci-inc=/usr/include/oracle/12.1/client64' ROracle_1.2-2.tar.gz

Congratulations, we made it!

lpglf54a2wd0y

Advertisements

One thought on “Install ROracle on Linux

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s