Monday, July 08, 2013

Installed Oracle R Enterprise 1.3 with Multitenant Database

I read something Oracle R Enterprise. I thought it was interesting. I wanted to install it for testing. Unfortunately, I had Oracle 12c Pluggable database. I wanted to install  R Enterprise in CDB$ROOT, but it couldn't because creating new common user must use C##xxx (I must modify scripts).
So, I changed my mind to install it in Pluggable Database.
First, installed R before.
[root@test12c ~]# yum install R.x86_64
Loaded plugins: security
ol6_MySQL                                                                                                                | 1.2 kB     00:00
ol6_MySQL/primary                                                                                                        |  11 kB     00:00
ol6_MySQL                                                                                                                                 36/36
ol6_UEK_base                                                                                                             | 1.2 kB     00:00
ol6_UEK_latest                                                                                                           | 1.2 kB     00:00
ol6_addons                                                                                                               | 1.2 kB     00:00
ol6_addons/primary                                                                                                       |  27 kB     00:00
ol6_addons                                                                                                                              117/117
ol6_latest                                                                                                               | 1.4 kB     00:00
Setting up Install Process
Resolving Dependencies
.
.
.
Installed:
  R.x86_64 0:2.15.3-1.el6

Dependency Installed:
  R-core.x86_64 0:2.15.3-1.el6                                           R-devel.x86_64 0:2.15.3-1.el6
  bzip2-devel.x86_64 0:1.0.5-7.el6_0                                     fontconfig-devel.x86_64 0:2.8.0-3.el6
  freetype-devel.x86_64 0:2.3.11-14.el6_3.1                              gcc-gfortran.x86_64 0:4.4.7-3.el6
  kpathsea.x86_64 0:2007-57.el6_2                                        libRmath.x86_64 0:2.15.3-1.el6
  libRmath-devel.x86_64 0:2.15.3-1.el6                                   libX11-devel.x86_64 0:1.5.0-4.el6
  libXau-devel.x86_64 0:1.0.6-4.el6                                      libXft-devel.x86_64 0:2.3.1-2.el6
  libXrender-devel.x86_64 0:0.9.7-2.el6                                  libxcb-devel.x86_64 0:1.8.1-1.el6
  netpbm.x86_64 0:10.47.05-11.el6                                        netpbm-progs.x86_64 0:10.47.05-11.el6
  pcre-devel.x86_64 0:7.8-6.el6                                          psutils.x86_64 0:1.17-34.el6
  tcl.x86_64 1:8.5.7-6.el6                                               tcl-devel.x86_64 1:8.5.7-6.el6
  tex-preview.noarch 0:11.85-10.el6                                      texinfo.x86_64 0:4.13a-8.el6
  texinfo-tex.x86_64 0:4.13a-8.el6                                       texlive.x86_64 0:2007-57.el6_2
  texlive-dvips.x86_64 0:2007-57.el6_2                                   texlive-latex.x86_64 0:2007-57.el6_2
  texlive-texmf.noarch 0:2007-38.el6                                     texlive-texmf-dvips.noarch 0:2007-38.el6
  texlive-texmf-errata.noarch 0:2007-7.1.el6                             texlive-texmf-errata-dvips.noarch 0:2007-7.1.el6
  texlive-texmf-errata-fonts.noarch 0:2007-7.1.el6                       texlive-texmf-errata-latex.noarch 0:2007-7.1.el6
  texlive-texmf-fonts.noarch 0:2007-38.el6                               texlive-texmf-latex.noarch 0:2007-38.el6
  texlive-utils.x86_64 0:2007-57.el6_2                                   tk.x86_64 1:8.5.7-5.el6
  tk-devel.x86_64 1:8.5.7-5.el6                                          xorg-x11-proto-devel.noarch 0:7.6-25.el6
  zlib-devel.x86_64 0:1.2.3-29.el6

Complete!
Then, installed Oracle  R Enterprise (ore-server-linux-x86-64-1.3.1.zip).
Note: On 12c, There has Oracle  R Enterprise 1.2 (/u01/app/oracle/product/12.1.0/dbhome_1/R/ORE_1_2).
[oracle@test12c ~]$ ls ore-server-linux-x86-64-1.3.1.zip
ore-server-linux-x86-64-1.3.1.zip
[oracle@test12c ~]$ unzip ore-server-linux-x86-64-1.3.1.zip
Archive:  ore-server-linux-x86-64-1.3.1.zip
  inflating: server/ORE_1.3.1_R_x86_64-unknown-linux-gnu.tar.gz
  inflating: server/OREbase_1.3.1_R_x86_64-unknown-linux-gnu.tar.gz
  inflating: server/OREdm_1.3.1_R_x86_64-unknown-linux-gnu.tar.gz
  inflating: server/OREeda_1.3.1_R_x86_64-unknown-linux-gnu.tar.gz
  inflating: server/OREgraphics_1.3.1_R_x86_64-unknown-linux-gnu.tar.gz
  inflating: server/OREpredict_1.3.1_R_x86_64-unknown-linux-gnu.tar.gz
  inflating: server/OREstats_1.3.1_R_x86_64-unknown-linux-gnu.tar.gz
 extracting: server/ORExml_1.3.1_R_x86_64-unknown-linux-gnu.tar.gz
  inflating: server/demo_user.sh
  inflating: server/install.sh
  inflating: server/libimf.so
 extracting: server/libintlc.so
  inflating: server/libiomp5.so
  inflating: server/libiompprof5.so
  inflating: server/libiompstubs5.so
  inflating: server/libirc.so
  inflating: server/libmkl_avx.so
  inflating: server/libmkl_cdft_core.so
  inflating: server/libmkl_core.so
  inflating: server/libmkl_def.so
  inflating: server/libmkl_gf_ilp64.so
  inflating: server/libmkl_gf_lp64.so
  inflating: server/libmkl_gnu_thread.so
  inflating: server/libmkl_intel_ilp64.so
  inflating: server/libmkl_intel_lp64.so
  inflating: server/libmkl_intel_sp2dp.so
  inflating: server/libmkl_intel_thread.so
  inflating: server/libmkl_mc.so
  inflating: server/libmkl_mc3.so
  inflating: server/libmkl_p4n.so
  inflating: server/libmkl_pgi_thread.so
  inflating: server/libmkl_rt.so
  inflating: server/libmkl_sequential.so
  inflating: server/libmkl_vml_avx.so
  inflating: server/libmkl_vml_def.so
  inflating: server/libmkl_vml_mc.so
  inflating: server/libmkl_vml_mc2.so
  inflating: server/libmkl_vml_mc3.so
  inflating: server/libmkl_vml_p4n.so
  inflating: server/libomp_db.so
  inflating: server/librqe.so
  inflating: server/libsvml.so
  inflating: server/ore.so
  inflating: server/rqadmin.sql
  inflating: server/rqcrt.sql
  inflating: server/rqd0100000.sql
  inflating: server/rqd0201000.sql
  inflating: server/rqd0302000.sql
  inflating: server/rqd0403000.sql
  inflating: server/rqdrp.sql
  inflating: server/rqinst.sql
  inflating: server/rqpcrt.sql
  inflating: server/rqpdrp00.sql
  inflating: server/rqpdrp01.sql
  inflating: server/rqpdrp02.sql
  inflating: server/rqpdrp03.sql
  inflating: server/rqpdrp04.sql
  inflating: server/rqproc.sql
  inflating: server/rqsys.sql
  inflating: server/rqu0001000.sql
  inflating: server/rqu0102000.sql
  inflating: server/rqu0203000.sql
  inflating: server/rqu0304000.sql
  inflating: server/rquser.sql
  inflating: server/uninstall.sh
[oracle@test12c ~]$ cd server/
[oracle@test12c server]$
[oracle@test12c server]$ tnsping pdb_opun
TNS Ping Utility for Linux: Version 12.1.0.1.0 - Production on 08-JUL-2013 19:28:55

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = test12c)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = pdb_opun)))
OK (30 msec)
[oracle@test12c server]$ sqlplus system@pdb_opun

SQL*Plus: Release 12.1.0.1.0 Production on Mon Jul 8 19:29:00 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Enter password:
Last Successful login time: Thu Jul 04 2013 23:18:09 +07:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> show con_name

CON_NAME
------------------------------
PDB_OPUN
SQL> show con_id

CON_ID
------------------------------
4
SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@test12c server]$ vi install.sh
[oracle@test12c server]$  diff install.sh.orig install.sh
131,132c131,132
< SQLPLUS="$ORACLE_HOME/bin/sqlplus / as sysdba"
< SQLPLUS_LS="$ORACLE_HOME/bin/sqlplus -L -S / as sysdba"
---
> SQLPLUS="$ORACLE_HOME/bin/sqlplus sys/***@PDB_OPUN as sysdba"
> SQLPLUS_LS="$ORACLE_HOME/bin/sqlplus -L -S sys/***@PDB_OPUN as sysdba"
147,148c147,148
<       SQLPLUS="$ORACLE_HOME/bin/sqlplus sys/$SYS_PASSW as sysdba"
<       SQLPLUS_LS="$ORACLE_HOME/bin/sqlplus -L -S sys/$SYS_PASSW as sysdba"
---
>       SQLPLUS="$ORACLE_HOME/bin/sqlplus sys/***@PDB_OPUN as sysdba"
>       SQLPLUS_LS="$ORACLE_HOME/bin/sqlplus -L -S sys/***@PDB_OPUN as sysdba"
Note: Changed "install.sh" script to connect through net service name (tnsnames.ora)
[oracle@test12c server]$
[oracle@test12c server]$ ./install.sh

Oracle R Enterprise 1.3.1 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 --It didn't use, because I used net service name--
Checking sqlplus ............. Pass
Checking ORACLE instance ..... Pass
Checking ORE ................. Pass

Current configuration
  R_HOME               = /usr/lib64/R
  R_LIBS_USER          = /u01/app/oracle/product/12.1.0/dbhome_1/R/library:/home/oracle/.R/library
  ORACLE_HOME          = /u01/app/oracle/product/12.1.0/dbhome_1
  ORACLE_SID           = orcl --It didn't use, because I used net service name--

Do you wish to install ORE? [yes]

Choosing RQSYS tablespaces
  PERMANENT tablespace to use for RQSYS [SYSAUX]:
  TEMPORARY tablespace to use for RQSYS [TEMP]:

Tablespaces summary
  PERMANENT tablespace = SYSAUX
  TEMPORARY tablespace = TEMP

Installing libraries ......... Pass
Installing RQSYS data ........ Pass
Installing RQSYS code ........ Pass
Installing ORE packages ...... Pass
Creating ORE script .......... 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@test12c server]$
After that, installed demo user.
[oracle@test12c server]$ vi demo_user.sh
[oracle@test12c server]$ diff demo_user.sh.orig  demo_user.sh
71,72c71,72
< SQLPLUS="$ORACLE_HOME/bin/sqlplus / as sysdba"
< SQLPLUS_LS="$ORACLE_HOME/bin/sqlplus -L -S / as sysdba"
---
> SQLPLUS="$ORACLE_HOME/bin/sqlplus sys/***@PDB_OPUN as sysdba"
> SQLPLUS_LS="$ORACLE_HOME/bin/sqlplus -L -S sys/***@PDB_OPUN as sysdba"
87,88c87,88
<       SQLPLUS="$ORACLE_HOME/bin/sqlplus sys/$SYS_PASSW as sysdba"
<       SQLPLUS_LS="$ORACLE_HOME/bin/sqlplus -L -S sys/$SYS_PASSW as sysdba"
---
>       SQLPLUS="$ORACLE_HOME/bin/sqlplus sys/***@PDB_OPUN as sysdba"
>       SQLPLUS_LS="$ORACLE_HOME/bin/sqlplus -L -S sys/***@PDB_OPUN as sysdba"
[oracle@test12c server]$ ./demo_user.sh
Oracle R Enterprise 1.3.1 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/12.1.0/dbhome_1
  ORACLE_SID           = orcl --It didn't use, because I used net service name--

Do you wish to create an ORE user? [yes]

Choosing tablespaces
  PERMANENT tablespace to use [USERS]:
  TEMPORARY tablespace to use [TEMP]:

Choosing user
  ORE user to use [rquser]:
  Password to use for user rquser:
  Password to use for user rquser:

Tablespaces and user summary
  PERMANENT tablespace = USERS
  TEMPORARY tablespace = TEMP
  ORE user             = rquser

Creating ORE user ............ Pass

Done
[oracle@test12c server]$

About Client installed

Then, installed ore-client-linux-x86-64-1.3.1.zip and ore-supporting-linux-x86-64-1.3.1.zip
[oracle@test12c ~]$ echo $R_LIBS_USER
/home/oracle/.R/library
[oracle@test12c ~]$ ls ore-client-linux-x86-64-1.3.1.zip ore-supporting-linux-x86-64-1.3.1.zip
ore-client-linux-x86-64-1.3.1.zip  ore-supporting-linux-x86-64-1.3.1.zip
[oracle@test12c ~]$ unzip ore-supporting-linux-x86-64-1.3.1.zip
Archive:  ore-supporting-linux-x86-64-1.3.1.zip
  inflating: supporting/DBI_0.2-5_R_x86_64-unknown-linux-gnu.tar.gz
  inflating: supporting/ROracle_1.1-9_R_x86_64-unknown-linux-gnu.tar.gz
  inflating: supporting/png_0.1-4_R_x86_64-unknown-linux-gnu.tar.gz
[oracle@test12c ~]$ cd supporting/
[oracle@test12c supporting]$ for x in `ls`; do R CMD INSTALL $x ; done
* installing to library ?€?/home/oracle/.R/library?€?
* installing *binary* package ?€?DBI?€? ...

* DONE (DBI)
* installing to library ?€?/home/oracle/.R/library?€?
* installing *binary* package ?€?png?€? ...

* DONE (png)
* installing to library ?€?/home/oracle/.R/library?€?
* installing *binary* package ?€?ROracle?€? ...

* DONE (ROracle)
[oracle@test12c supporting]$
[oracle@test12c supporting]$ cd ..
[oracle@test12c ~]$ unzip ore-client-linux-x86-64-1.3.1.zip
Archive:  ore-client-linux-x86-64-1.3.1.zip
  inflating: client/ORE_1.3.1_R_x86_64-unknown-linux-gnu.tar.gz
  inflating: client/OREbase_1.3.1_R_x86_64-unknown-linux-gnu.tar.gz
  inflating: client/OREdm_1.3.1_R_x86_64-unknown-linux-gnu.tar.gz
  inflating: client/OREeda_1.3.1_R_x86_64-unknown-linux-gnu.tar.gz
  inflating: client/OREgraphics_1.3.1_R_x86_64-unknown-linux-gnu.tar.gz
  inflating: client/OREpredict_1.3.1_R_x86_64-unknown-linux-gnu.tar.gz
  inflating: client/OREstats_1.3.1_R_x86_64-unknown-linux-gnu.tar.gz
 extracting: client/ORExml_1.3.1_R_x86_64-unknown-linux-gnu.tar.gz
[oracle@test12c ~]$ cd client
[oracle@test12c client]$ for x in `ls`; do R CMD INSTALL $x ; done
* installing to library ?€?/home/oracle/.R/library?€?
* installing *binary* package ?€?ORE?€? ...

* DONE (ORE)
* installing to library ?€?/home/oracle/.R/library?€?
* installing *binary* package ?€?OREbase?€? ...

* DONE (OREbase)
* installing to library ?€?/home/oracle/.R/library?€?
* installing *binary* package ?€?OREdm?€? ...

* DONE (OREdm)
* installing to library ?€?/home/oracle/.R/library?€?
* installing *binary* package ?€?OREeda?€? ...

* DONE (OREeda)
* installing to library ?€?/home/oracle/.R/library?€?
* installing *binary* package ?€?OREgraphics?€? ...

* DONE (OREgraphics)
* installing to library ?€?/home/oracle/.R/library?€?
* installing *binary* package ?€?OREpredict?€? ...

* DONE (OREpredict)
* installing to library ?€?/home/oracle/.R/library?€?
* installing *binary* package ?€?OREstats?€? ...

* DONE (OREstats)
* installing to library ?€?/home/oracle/.R/library?€?
* installing *binary* package ?€?ORExml?€? ...

* DONE (ORExml)
[oracle@test12c client]$
Finally, tested connection.
oracle@test12c ~]$ R

Oracle Distribution of R version 2.15.3  (--) -- "Security Blanket"
Copyright (C)  The R Foundation for Statistical Computing
ISBN 3-900051-07-0
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.

>
> library(ORE)
Loading required package: OREbase

Attaching package: ?€?OREbase?€?

The following object(s) are masked from ?€?package:base?€?:

    cbind, data.frame, eval, interaction, order, paste, pmax, pmin,
    rbind, table

Loading required package: OREstats
Loading required package: MASS
Loading required package: OREgraphics
Loading required package: OREeda
Loading required package: OREdm
Loading required package: lattice
Loading required package: OREpredict
Loading required package: ORExml
> ore.is.connected()
[1] FALSE
> ore.connect(user = "rquser", service_name = "pdb_opun",password = "***",all = TRUE)
Loading required package: ROracle
Loading required package: DBI
> ore.is.connected()
[1] TRUE
I could use it and it was able to connect Pluggable Database. However, read more Oracle R Enterprise 1.3 Reference Manual.

No comments: