Note: I am going to install the tool (or option) on a linux server (OEL 6.3 64 bit) with Oracle DB 11.2.0.4., so only "server" configuration is described.
Step 1 - Oracle R 3.0.1
Let's start. According to documentation, Oracle R 3.0.1 is required for Oracle R Enterprise 1.4.0 (I think you can use the regular R, but Oracle strongly recommends to use their own version). Install the software using yum.
[root@oel ~]# yum install R-3.0.1 Loaded plugins: refresh-packagekit, security Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package R.x86_64 0:3.0.1-2.el6 will be installed --> Processing Dependency: libRmath-devel = 3.0.1-2.el6 for package: R-3.0.1-2.el6.x86_64 --> Processing Dependency: R-devel = 3.0.1-2.el6 for package: R-3.0.1-2.el6.x86_64 --> Running transaction check ---> Package R-devel.x86_64 0:3.0.1-2.el6 will be installed --> Processing Dependency: R-core = 3.0.1-2.el6 for package: R-devel-3.0.1-2.el6.x86_64 ---> Package libRmath-devel.x86_64 0:3.0.1-2.el6 will be installed --> Processing Dependency: libRmath = 3.0.1-2.el6 for package: libRmath-devel-3.0.1-2.el6.x86_64 --> Running transaction check ---> Package R-core.x86_64 0:3.0.1-2.el6 will be installed ---> Package libRmath.x86_64 0:3.0.1-2.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================================================== Package Arch Version Repository Size ======================================================================================================================================================================== Installing: R x86_64 3.0.1-2.el6 ol6_addons 15 k Installing for dependencies: R-core x86_64 3.0.1-2.el6 ol6_addons 45 M R-devel x86_64 3.0.1-2.el6 ol6_addons 86 k libRmath x86_64 3.0.1-2.el6 ol6_addons 111 k libRmath-devel x86_64 3.0.1-2.el6 ol6_addons 20 k Transaction Summary ======================================================================================================================================================================== Install 5 Package(s) Total download size: 46 M Installed size: 81 M Is this ok [y/N]: y Downloading Packages Rdevel-3.0.1-2.el6.x86_64.rpm | 86 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : libRmath-3.0.1-2.el6.x86_64 1/5 Installing : libRmath-devel-3.0.1-2.el6.x86_64 2/5 Installing : R-core-3.0.1-2.el6.x86_64 3/5 Installing : R-devel-3.0.1-2.el6.x86_64 4/5 Installing : R-3.0.1-2.el6.x86_64 5/5 Verifying : libRmath-devel-3.0.1-2.el6.x86_64 1/5 Verifying : R-core-3.0.1-2.el6.x86_64 2/5 Verifying : libRmath-3.0.1-2.el6.x86_64 3/5 Verifying : R-devel-3.0.1-2.el6.x86_64 4/5 Verifying : R-3.0.1-2.el6.x86_64 5/5 Installed: R.x86_64 0:3.0.1-2.el6 Dependency Installed: R-core.x86_64 0:3.0.1-2.el6 R-devel.x86_64 0:3.0.1-2.el6 libRmath.x86_64 0:3.0.1-2.el6 libRmath-devel.x86_64 0:3.0.1-2.el6 Complete! [root@oel ~]#
Check that everything works fine.
[root@oel ~]# R Oracle Distribution of R version 3.0.1 (--) -- "Good Sport" 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. > q(); Save workspace image? [y/n/c]: n [root@oel ~]#
Step 2 - Oracle R Enterprise
Download the "server" file from OTN. Unzip the file and run install.sh. Don't forget to set ORACLE_HOME and ORACLE_SID.
[oracle@oel server]$ ./install.sh Oracle R Enterprise 1.4 Server Installation. Copyright (c) 2012, 2013 Oracle and/or its affiliates. All rights reserved. Checking R ................... Pass Checking R libraries ......... Pass Checking ORACLE_HOME ......... Pass Checking ORACLE_SID .......... Pass Checking sqlplus ............. Pass Checking ORACLE instance ..... Pass Checking ORE ................. Pass Current configuration R_HOME = /usr/lib64/R R_LIBS_USER = /u01/app/oracle/product/11.2.0.4/dbhome_1/R/library ORACLE_HOME = /u01/app/oracle/product/11.2.0.4/dbhome_1 ORACLE_SID = orcl Do you wish to install ORE? [yes] Choosing RQSYS tablespaces PERMANENT tablespace to use for RQSYS [SYSAUX]: USERS TEMPORARY tablespace to use for RQSYS [TEMP]: Tablespaces summary PERMANENT tablespace = USERS TEMPORARY tablespace = TEMP Installing libraries ......... Pass Password to use for user RQSYS [ORE1_4RQsys]: Installing RQSYS data ........ Pass Installing RQSYS code ........ Pass Installing ORE packages ...... Pass Creating ORE script .......... Pass Installing ORE migration scripts ...... Pass NOTE: ORE has been enabled for all database users. Next, install the supporting packages. You may create an ORE user with the demo_user.sh script, which automatically grants the required privileges. A complete list of privileges is available in the script rquser.sql. To use ORE Embedded R Execution functionality, grant the user the RQADMIN role. Please, consult the documentation for more information. Done [oracle@oel server]$
Step 3 - Install packages
Download the Download the "supporting" file from OTN. Unzip the file and install the packages.
[oracle@oel ~]# R Oracle Distribution of R version 3.0.1 (--) -- "Good Sport" 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. > install.packages("/home/oracle/supporting/ROracle_1.1-11_R_x86_64-unknown-linux-gnu.tar.gz", repos=NULL); Installing package into ‘/usr/lib64/R/library’ (as ‘lib’ is unspecified) * installing *binary* package ‘ROracle’ ... * DONE (ROracle) Making 'packages.html' ... done > install.packages("/home/oracle/supporting/DBI_0.2-7_R_x86_64-unknown-linux-gnu.tar.gz", repos=NULL); Installing package into ‘/usr/lib64/R/library’ (as ‘lib’ is unspecified) * installing *binary* package ‘DBI’ ... * DONE (DBI) Making 'packages.html' ... done > install.packages("/home/oracle/supporting/png_0.1-7_R_x86_64-unknown-linux-gnu.tar.gz", repos=NULL); Installing package into ‘/usr/lib64/R/library’ (as ‘lib’ is unspecified) * installing *binary* package ‘png’ ... * DONE (png) Making 'packages.html' ... done > install.packages("/home/oracle/supporting/Cairo_1.5-5_R_x86_64-unknown-linux-gnu.tar.gz", repos=NULL); Installing package into ‘/usr/lib64/R/library’ (as ‘lib’ is unspecified) * installing *binary* package ‘Cairo’ ... * DONE (Cairo) Making 'packages.html' ... done >
Step 4 - create a Database User
In this case, I used the demo_user.sh script from the server folder.
[oracle@oel server]$ ./demo_user.sh Oracle R Enterprise 1.4 Server User Creation. Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. Checking ORACLE_HOME ......... Pass Checking ORACLE_SID .......... Pass Checking sqlplus ............. Pass Checking ORACLE instance ..... Pass Checking ORE ................. Pass Current configuration ORACLE_HOME = /u01/app/oracle/product/11.2.0.4/dbhome_1 ORACLE_SID = orcl Do you wish to create an ORE user? [yes] Choosing user ORE user to use [rquser]: ./demo_user.sh: line 215: nawk: command not found Password to use for user rquser: Choosing tablespaces PERMANENT tablespace to use [USERS]: TEMPORARY tablespace to use [TEMP]: Tablespaces and user summary PERMANENT tablespace = USERS TEMPORARY tablespace = TEMP ORE user = rquser Creating ORE user ............ Pass Done [oracle@oel server]$
Just in case, provide the RQADMIN grant.
[oracle@oel Desktop]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Wed Dec 9 11:17:54 2015 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> GRANT RQADMIN to RQUSER; Grant succeeded. SQL>
Step 5 - Test
Setting up the correct library paths and run demo.
[oracle@oel ~]# R > .libPaths('/u01/app/oracle/product/11.2.0.4/dbhome_1/R/library'); > .libPaths( c(.libPaths(),'/u01/app/oracle/product/11.2.0.4/dbhome_1/lib') > library(ORE) Loading required package: OREbase 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 > > ore.connect(user="rquser", sid="orcl", host="localhost", password="oracle", port=1521, all=TRUE); > ore.is.connected() [1] TRUE > ore.ls() character(0) > > demo("aggregate", package = "ORE") demo(aggregate) ---- ~~~~~~~~~ TypeGreat. Everything works fine. Enjoy.to start : return > # > # O R A C L E R E N T E R P R I S E S A M P L E L I B R A R Y > # > # Name: aggregate.R > # Description: Demonstrates aggregations > # See also summary.R > # > # > # >