LoginSignup
3
4

More than 5 years have passed since last update.

Oracle R Enterprise インストール手順

Last updated at Posted at 2015-09-25

以下の環境に ORE をインストールします。

  • サーバ:Oracle Linux 6.6 / Oracle Database 11gR2 (11.2.0.4)

  • クライアント:Windows 10 / Oracle Database Client 11gR2

サーバ編

rpm パッケージインストール

http://public-yum.oracle.com/repo/OracleLinux/OL6/addons/x86_64 から必要なパッケージをダウンロードしてインストールします。

# ls -ltr *.rpm
-rwxrwx---. 1 root vboxsf    15988  9月  6 02:51 2015 R-3.1.1-2.el6.x86_64.rpm
-rwxrwx---. 1 root vboxsf 50258308  9月  6 02:51 2015 R-core-3.1.1-2.el6.x86_64.rpm
-rwxrwx---. 1 root vboxsf    90800  9月  6 02:51 2015 R-devel-3.1.1-2.el6.x86_64.rpm
-rwxrwx---. 1 root vboxsf   115952  9月  6 02:51 2015 libRmath-3.1.1-2.el6.x86_64.rpm
-rwxrwx---. 1 root vboxsf    21080  9月  6 02:51 2015 libRmath-devel-3.1.1-2.el6.x86_64.rpm
-rwxrwx---. 1 root vboxsf   131768  9月  6 02:52 2015 libRmath-static-3.1.1-2.el6.x86_64.rpm

R-core-3.1.1-2.el6.x86_64.rpm をインストールするために、Tex を事前にインストールしておく必要があります。
手動でもインストールできますが、「ソフトウェアの追加/削除」から追加しました。
他にも bzip2-devel-1.0.5-7.el6_0.x86_64.rpm やら texinfo-tex-4.13a-8.el6.x86_64.rpm が不足していたので追加インストールしています。

# rpm -ivh libRmath-3.1.1-2.el6.x86_64.rpm
準備中...                ########################################### [100%]
   1:libRmath               ########################################### [100%]
# rpm -ivh libRmath-devel-3.1.1-2.el6.x86_64.rpm
準備中...                ########################################### [100%]
   1:libRmath-devel         ########################################### [100%]
# rpm -ivh libRmath-static-3.1.1-2.el6.x86_64.rpm
準備中...                ########################################### [100%]
   1:libRmath-static        ########################################### [100%]
#
# rpm -Uvh R-core-3.1.1-2.el6.x86_64.rpm
準備中...                ########################################### [100%]
   1:R-core                 ########################################### [100%]
# rpm -Uvh R-devel-3.1.1-2.el6.x86_64.rpm R-3.1.1-2.el6.x86_64.rpm bzip2-devel-1.0.5-7.el6_0.x86_64.rpm texinfo-tex-4.13a-8.el6.x86_64.rpm
警告: texinfo-tex-4.13a-8.el6.x86_64.rpm: ヘッダ V4 DSA/SHA1 Signature, key ID 192a7d7d: NOKEY
準備中...                ########################################### [100%]
   1:texinfo-tex            ########################################### [ 25%]
   2:bzip2-devel            ########################################### [ 50%]
   3:R-devel                ########################################### [ 75%]
   4:R                      ########################################### [100%]
#

Oracle ユーザ作成

ORE 用のユーザ(ore/ore)を作成しておきます。
併せて専用の表領域を作成。

SQL> grant dba to ore identified by ore;
SQL> create tablespace ORETBS database 'oretbs01.dbf' size 100M autoextend off;
SQL> alter user ore default tablespace ORETBS;

スクリプト実行

http://www.oracle.com/technetwork/database/database-technologies/r/r-enterprise/downloads/index.html から
該当 OS の ORE Server とSupporting をダウンロード後、解凍します。

$ pwd
/home/ora11204/ORE
$ unzip ore-server-linux-x86-64-1.4.1.zip
$ unzip ore-supporting-linux-x86-64-1.4.1.zip
$ ls -ltr
-rwxrwxr-x. 1 ora11204 oinstall 106023278  4月 15 01:10 ore-server-linux-x86-64-1.4.1.zip
-rwxrwxr-x. 1 ora11204 oinstall   3700388  4月 15 01:04 ore-supporting-linux-x86-64-1.4.1.zip
-r-xr-xr-x. 1 ora11204 oinstall     54272  7月 29 13:48 2014 server.sh
drwxr-xr-x. 3 ora11204 oinstall      4096  9月  6 17:55 2015 server
drwxr-xr-x. 2 ora11204 oinstall      4096  9月  6 17:55 2015 supporting

展開された server.sh を実行します。

$ ./server.sh

Oracle R Enterprise 1.4.1 Server.

Copyright (c) 2012, 2014 Oracle and/or its affiliates. All rights reserved.

Checking platform .................. Pass
Checking R ......................... Pass
Checking R libraries ............... Pass
Checking ORACLE_HOME ............... Pass
Checking ORACLE_SID ................ Pass
Checking sqlplus ................... Pass
Checking ORACLE instance ........... Pass
Checking CDB/PDB ................... Pass
Checking ORE ....................... Pass

Choosing RQSYS tablespaces
  PERMANENT tablespace to use for RQSYS [list]: SYSAUX
  TEMPORARY tablespace to use for RQSYS [list]: TEMP
Choosing RQSYS password
  Password to use for RQSYS: <--★パスワード入力

Choosing ORE user
  ORE user to use [list]: ORE <--★ユーザ名(ORE)を指定

Current configuration
  R Version ........................ Oracle Distribution of R version 3.1.1  (--)
  R_HOME ........................... /usr/lib64/R
  R_LIBS_USER ...................... /u01/app/oracle/product/o11204/R/library
  ORACLE_HOME ...................... /u01/app/oracle/product/o11204
  ORACLE_SID ....................... orcl

  Existing R Version ............... None
  Existing R_HOME .................. None
  Existing ORE data ................ None
  Existing ORE code ................ None
  Existing ORE libraries ........... None

  RQSYS PERMANENT tablespace ....... SYSAUX
  RQSYS TEMPORARY tablespace ....... TEMP

  ORE user type .................... Existing
  ORE user name .................... ORE
  ORE user PERMANENT tablespace .... ORETBS
  ORE user TEMPORARY tablespace .... TEMP
  Grant RQADMIN role ............... No

  Operation ........................ Install/Upgrade/Setup

Proceed? [yes] yes

Removing R libraries ............... Pass
Installing R libraries ............. Pass
Installing ORE libraries ........... Pass
Installing RQSYS data .............. Pass
Configuring ORE .................... Pass
Installing RQSYS code .............. Pass
Installing ORE packages ............ Pass
Creating ORE script ................ Pass
Installing migration scripts ....... Pass
Installing supporting packages ..... Pass
Granting ORE privileges ............ Pass

Done
$

動作確認

https://community.oracle.com/thread/3719842 の事象に遭遇したので、Sys.setenv(TZ = "JST") を追加して実行しました。

$ ORE

Oracle Distribution of R version 3.1.1  (--) -- "Sock it to Me"
Copyright (C)  The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)

R は、自由なソフトウェアであり、「完全に無保証」です。
 一定の条件に従えば、自由にこれを再配布することができます。
 配布条件の詳細に関しては、'license()' あるいは 'licence()' と入力してください。

R は多くの貢献者による共同プロジェクトです。
 詳しくは 'contributors()' と入力してください。
 また、R や R のパッケージを出版物で引用する際の形式については
 'citation()' と入力してください。

 'demo()' と入力すればデモをみることができます。
 'help()' とすればオンラインヘルプが出ます。
 'help.start()' で HTML ブラウザによるヘルプがみられます。
 'q()' と入力すれば R を終了します。

You are using Oracle's distribution of R. Please contact
Oracle Support for any problems you encounter with this
distribution.

> library(ORE)
 要求されたパッケージ OREbase をロード中です

 次のパッケージを付け加えます: ‘OREbase’

The following objects are masked from ‘package:base’:

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

 要求されたパッケージ OREembed をロード中です
 要求されたパッケージ OREstats をロード中です
 要求されたパッケージ MASS をロード中です
 要求されたパッケージ OREgraphics をロード中です
 要求されたパッケージ OREeda をロード中です
 要求されたパッケージ OREmodels をロード中です
 要求されたパッケージ OREdm をロード中です
 要求されたパッケージ lattice をロード中です
 要求されたパッケージ OREpredict をロード中です
 要求されたパッケージ ORExml をロード中です
>
> Sys.setenv(TZ = "JST")
>
> ore.connect("ORE", password="ore", conn_str="", all=TRUE)
Loading required package: ROracle
Loading required package: DBI
>
> ore.is.connected()
[1] TRUE
>
> ore.ls()
character(0)
>
> CARS <- ore.push(cars)
> head(CARS)
  speed dist
1     4    2
2     4   10
3     7    4
4     7   22
5     8   16
6     9   10
>

クライアント編

Oracle Database Client インストール

http://www.oracle.com/technetwork/database/features/instant-client/index.html から Instant Client Package の「Basic」をダウンロードして、任意のフォルダに解凍します。(ここでは C:\oracle\instantclient_11_2 をインストールフォルダとしています)
さらに、Instant Client Package の「SDK」をダウンロードして、上記と同じフォルダに解凍します。
環境変数 OCI_LIB64 および PATH にも上記フォルダのフルパスを追加設定しておきます。

Oracle R Distribution インストール

https://oss.oracle.com/ORD/ から ORD-3.1.1-win.zip をダウンロード後、解凍します。
R-3.1.1-win.exe を実行して、R のインストールが完了すると、スタートメニューに「R」が登録されます。

ORE 関連パッケージインストール

http://www.oracle.com/technetwork/database/database-technologies/r/r-enterprise/downloads/index.html から、ore-client-win-x86_64-1.4.1.zip および ore-supporting-win-x86_64-1.4.1.zip をダウンロードして、C:\oracle\instantclient_11_2 に解凍します。

スタートメニューから「R」->「R x64 3.1.1」を実行します。
R のコンソール画面が起動するので、以下を実行して ORE パッケージをインストールします。

> install.packages("C:/oracle/instantclient_11_2/client/ORE_1.4.1.zip",repos=NULL)
> install.packages("C:/oracle/instantclient_11_2/client/OREbase_1.4.1.zip",repos=NULL)
> install.packages("C:/oracle/instantclient_11_2/client/OREcommon_1.4.1.zip",repos=NULL)
> install.packages("C:/oracle/instantclient_11_2/client/OREdm_1.4.1.zip",repos=NULL)
> install.packages("C:/oracle/instantclient_11_2/client/OREeda_1.4.1.zip",repos=NULL)
> install.packages("C:/oracle/instantclient_11_2/client/OREembed_1.4.1.zip",repos=NULL)
> install.packages("C:/oracle/instantclient_11_2/client/OREgraphics_1.4.1.zip",repos=NULL)
> install.packages("C:/oracle/instantclient_11_2/client/OREmodels_1.4.1.zip",repos=NULL)
> install.packages("C:/oracle/instantclient_11_2/client/OREpredict_1.4.1.zip",repos=NULL)
> install.packages("C:/oracle/instantclient_11_2/client/OREstats_1.4.1.zip",repos=NULL)
> install.packages("C:/oracle/instantclient_11_2/client/ORExml_1.4.1.zip",repos=NULL)
> install.packages("C:/oracle/instantclient_11_2/supporting/arules_1.1-3.zip",repos=NULL)
> install.packages("C:/oracle/instantclient_11_2/supporting/Cairo_1.5-5.zip",repos=NULL)
> install.packages("C:/oracle/instantclient_11_2/supporting/DBI_0.2-7.zip",repos=NULL)
> install.packages("C:/oracle/instantclient_11_2/supporting/png_0.1-7.zip",repos=NULL)
> install.packages("C:/oracle/instantclient_11_2/supporting/ROracle_1.1-12.zip",repos=NULL)
> install.packages("C:/oracle/instantclient_11_2/supporting/statmod_1.4.20.zip",repos=NULL)
example
> install.packages("C:/oracle/instantclient_11_2/client/ORE_1.4.1.zip",repos=NULL)
Warning in install.packages("C:/oracle/instantclient_11_2/client/ORE_1.4.1.zip",  :
  'lib = "C:/Program Files/R/R-3.1.1/library"' is not writable
package ‘ORE’ successfully unpacked and MD5 sums checked

動作確認

インストールした ORE を使用して、サーバに接続してみます。
「R x64 3.1.1」を実行します。ホスト名やポート、サービス名は各環境に合わせて設定してください。

> library(ORE)
> Sys.setenv(TZ = "JST")
> ore.connect(user="ORE", service_name="orcl", host="192.168.56.101", password="ore", port=1521, all=TRUE)
> ore.is.connected()
[1] TRUE
>
3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4