This presentation shows how to install and configure Oracle R Enterprise Client 1.5 for Oracle Database 11G Linux OEL6.
Architecture
Following picture shows general architecture of Oracle R. This article will focus only on installation of Client parts.
Installation steps for Client parts
NOTE – following article shows installation of Oracle Enterprise Linux 6:
Installation consists of three steps:
- Install Oracle Database Client
- Install Oracle R Distribution (presented in this article) or Open Source R
- Install Oracle R Enterprise Client
Install Oracle Database Client
This part is done as user Oracle
1. Create an installation directory for the Oracle Database Client components
cd /home/oracle mkdir oreclient_dir
2. Download to the directory Instant Client Package – Basic or Instant Client Package – Basic Lite zip for Oracle Database version 11.2.0.4 on platform Linux x86-64
instantclient-basic-linux.x64-11.2.0.4.0.zip
http://www.oracle.com/technetwork/database/features/instant-client/
ls /home/oracle/oreclient_dir instantclient-basic-linux.x64-11.2.0.4.0.zip
3. Unzip the file
cd /home/oracle/oreclient_dir unzip instantclient-basic-linux.x64-11.2.0.4.0.zip Archive: instantclient-basic-linux.x64-11.2.0.4.0.zip inflating: instantclient_11_2/BASIC_README inflating: instantclient_11_2/adrci inflating: instantclient_11_2/genezi inflating: instantclient_11_2/libclntsh.so.11.1 inflating: instantclient_11_2/libnnz11.so inflating: instantclient_11_2/libocci.so.11.1 inflating: instantclient_11_2/libociei.so inflating: instantclient_11_2/libocijdbc11.so inflating: instantclient_11_2/ojdbc5.jar inflating: instantclient_11_2/ojdbc6.jar inflating: instantclient_11_2/uidrvci inflating: instantclient_11_2/xstreams.jar
it should look like this after unzip
ls /home/oracle/oreclient_dir instantclient_11_2 instantclient-basic-linux.x64-11.2.0.4.0.zip
4. Download another zip Instant Client Package – SDK for Oracle Database version 11.2.0.4 on platform Linux x86-64
instantclient-sdk-linux.x64-12.1.0.2.0.zip
ls /home/oracle/oreclient_dir/ instantclient_11_2 instantclient-basic-linux.x64-11.2.0.4.0.zip instantclient-sdk-linux.x64-12.1.0.2.0.zip
5. Unzip the file
cd /home/oracle/oreclient_dir unzip instantclient-sdk-linux.x64-12.1.0.2.0.zip Archive: instantclient-sdk-linux.x64-11.2.0.4.0.zip creating: instantclient_11_2/sdk/ creating: instantclient_11_2/sdk/include/ inflating: instantclient_11_2/sdk/include/occi.h ... inflating: instantclient_11_2/sdk/include/nzt.h inflating: instantclient_11_2/sdk/include/nzerror.h inflating: instantclient_11_2/sdk/include/ldap.h creating: instantclient_11_2/sdk/demo/ ... inflating: instantclient_11_2/sdk/SDK_README extracting: instantclient_11_2/sdk/ottclasses.zip inflating: instantclient_11_2/sdk/ott
6. Download another zip Instant Client Package – SQL*Plus for Oracle Database version 11.2.0.4 on platform Linux x86-64
instantclient-sqlplus-linux.x64-11.2.0.4.0.zip
ls /home/oracle/oreclient_dir/ instantclient_11_2 instantclient-basic-linux.x64-11.2.0.4.0.zip instantclient-sdk-linux.x64-12.1.0.2.0.zip instantclient-sqlplus-linux.x64-11.2.0.4.0.zip
7. Unzip the file
cd /home/oracle/oreclient_dir unzip instantclient-sqlplus-linux.x64-11.2.0.4.0.zip Archive: instantclient-sqlplus-linux.x64-11.2.0.4.0.zip inflating: instantclient_11_2/SQLPLUS_README inflating: instantclient_11_2/glogin.sql inflating: instantclient_11_2/libsqlplus.so inflating: instantclient_11_2/libsqlplusic.so inflating: instantclient_11_2/sqlplus
8. Change bash profile for user Oracle
Add following lines to .bash_profile
cd /home/oracle vi .bash_profile
# Oracle Settings export TMP=/tmp export ORACLE_HOME=/home/oracle/oreclient_dir/instantclient_11_2 export TNS_ADMIN=$ORACLE_HOME PATH=/usr/sbin:$PATH:$ORACLE_HOME export LD_LIBRARY_PATH=$ORACLE_HOME:/lib:/usr/lib; alias cdoh='cd $ORACLE_HOME' alias tns='cd $ORACLE_HOME' alias envo='env | grep ORACLE' envo
Installation Matrix
Following table shows software certification matrix 64-bit Red Hat Enterprise Linux Release 5 update 6 through Red Hat Enterprise Linux 6
Oracle R Enterprise Open source R or Oracle R Distribution Oracle Database (see Note)
Oracle R Enterprise | Open source R or Oracle R Distribution | Oracle Database (see Note) |
---|---|---|
1.5 | 3.2.x | 11.2.0.4, 12.1.0.1, 12.1.0.2 |
1.4.1 | 3.0.1, 3.1.1 | 11.2.0.3, 11.2.0.4, 12.1.0.1 |
1.4 | 3.0.1, 3.1.1 | 11.2.0.3, 11.2.0.4, 12.1.0.1 |
1.3.1 | 2.15.1, 2.15.2, 2.15.3 | 11.2.0.3, 11.2.0.4, 12.1.0.1 |
1.3 | 2.15.1 | 11.2.0.3, 11.2.0.4, 12.1.0.1 |
1.2 | 2.15.1 | 11.2.0.3, 11.2.0.4, 12.1.0.1 |
1.1 | 2.13.2 | 11.2.0.3, 11.2.0.4, 12.1.0.1 |
1.0 | 2.13.2 | 11.2.0.3, 11.2.0.4, 12.1.0.1 |
So following software will be used:
- Oracle R Distribution version 3.2.X
- Oracle R Enterprise Client version 1.5
Install Oracle R Distribution
Based on installation matrix Oracle R Distribution 3.2.x version will be installed.
As user root modify file public-yum-ol6.repo and set enable=1:
cd /etc/yum.repos.d/
vi public-yum-ol6.repo
... [public_ol6_addons] name=Oracle Linux $releasever Add ons ($basearch) baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/addons/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=1 enabled=1 ...
Once it’s done install following package
yum install R-3.2.0
Install Oracle R Enterprise Client
Based on installation matrix Oracle R Enterprise Client ORE 1.5 version will be installed. It’s available in here:
http://www.oracle.com/technetwork/database/database-technologies/r/r-enterprise/downloads/index.html
Download following packages ORE 1.5 “Client” and “Supporting” for platform Linux 64-bit.:
ore-client-linux-x86-64-1.5.zip
ore-supporting-linux-x86-64-1.5.zip
Copy them as user root to directory /home/oracle/oreclient_dir) and change owner and group(oracle:oinstall)
cp ore* /home/oracle/oreclient_dir cd /home/oracle/oreclient_dir chown oracle:oinstall ore*
Install Oracle R Enterprise Client packages
As user root unizp software
cd /home/oracle/oreclient_dir unzip ore-client-linux-x86-64-1.5.zip Archive: ore-client-linux-x86-64-1.5.zip inflating: client/ORE_1.5_R_x86_64-unknown-linux-gnu.tar.gz inflating: client/OREbase_1.5_R_x86_64-unknown-linux-gnu.tar.gz extracting: client/OREcommon_1.5_R_x86_64-unknown-linux-gnu.tar.gz inflating: client/OREdm_1.5_R_x86_64-unknown-linux-gnu.tar.gz inflating: client/OREeda_1.5_R_x86_64-unknown-linux-gnu.tar.gz inflating: client/OREembed_1.5_R_x86_64-unknown-linux-gnu.tar.gz inflating: client/OREgraphics_1.5_R_x86_64-unknown-linux-gnu.tar.gz inflating: client/OREmodels_1.5_R_x86_64-unknown-linux-gnu.tar.gz inflating: client/OREpredict_1.5_R_x86_64-unknown-linux-gnu.tar.gz inflating: client/OREstats_1.5_R_x86_64-unknown-linux-gnu.tar.gz extracting: client/ORExml_1.5_R_x86_64-unknown-linux-gnu.tar.gz
Install client packages
cd /home/oracle/oreclient_dir/client
R CMD INSTALL ORE_1.5_R_x86_64-unknown-linux-gnu.tar.gz R CMD INSTALL OREbase_1.5_R_x86_64-unknown-linux-gnu.tar.gz R CMD INSTALL OREcommon_1.5_R_x86_64-unknown-linux-gnu.tar.gz R CMD INSTALL OREdm_1.5_R_x86_64-unknown-linux-gnu.tar.gz R CMD INSTALL OREeda_1.5_R_x86_64-unknown-linux-gnu.tar.gz R CMD INSTALL OREembed_1.5_R_x86_64-unknown-linux-gnu.tar.gz R CMD INSTALL OREgraphics_1.5_R_x86_64-unknown-linux-gnu.tar.gz R CMD INSTALL OREmodels_1.5_R_x86_64-unknown-linux-gnu.tar.gz R CMD INSTALL OREpredict_1.5_R_x86_64-unknown-linux-gnu.tar.gz R CMD INSTALL OREstats_1.5_R_x86_64-unknown-linux-gnu.tar.gz R CMD INSTALL ORExml_1.5_R_x86_64-unknown-linux-gnu.tar.gz
Install Oracle R Enterprise Supporting packages
As user root unizp software
cd /home/oracle/oreclient_dir unzip ore-supporting-linux-x86-64-1.5.zip
Install supporting packages
cd /home/oracle/oreclient_dir/supporting
R CMD INSTALL arules_1.1-9_R_x86_64-unknown-linux-gnu.tar.gz R CMD INSTALL Cairo_1.5-8_R_x86_64-unknown-linux-gnu.tar.gz R CMD INSTALL DBI_0.3.1_R_x86_64-unknown-linux-gnu.tar.gz R CMD INSTALL png_0.1-7_R_x86_64-unknown-linux-gnu.tar.gz R CMD INSTALL randomForest_4.6-10_R_x86_64-unknown-linux-gnu.tar.gz R CMD INSTALL ROracle_1.2-1_R_x86_64-unknown-linux-gnu.tar.gz R CMD INSTALL statmod_1.4.21_R_x86_64-unknown-linux-gnu.tar.gz
Verification
As user Oracle just type R to start console
[oracle@oel6 client]$ R Oracle Distribution of R version 3.2.0 (--) -- "Full of Ingredients" Copyright (C) The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. You are using Oracle's distribution of R. Please contact Oracle Support for any problems you encounter with this distribution. >
Type this command in console
library(ORE)
to start Oracle R Enterprise
> library(ORE) Loading required package: OREbase Loading required package: OREcommon Attaching package: ‘OREbase’ The following objects are masked from ‘package:base’: cbind, data.frame, eval, interaction, order, paste, pmax, pmin, rbind, table Loading required package: OREembed Loading required package: OREstats Loading required package: MASS Loading required package: OREgraphics Loading required package: OREeda Loading required package: OREmodels Loading required package: OREdm Loading required package: lattice Loading required package: OREpredict Loading required package: ORExml >
to connect to a database run following command. It’s just sample.
> ore.connect(user="test_user", sid="ORA11G.dbaora.com", host="OEL6.dbaora.com", password="test_user", port=1521, all=TRUE) Loading required package: ROracle Loading required package: DBI
Have a fun 🙂
Tomasz