4.3.2 R-4.4.1でOML4Rサーバーを使用するための準備
R-4.4.1でビルドされたOML4Rサーバー・パッケージをダウンロードしてインストールするための手順。
- Oracle Machine Learning for Rダウンロード・ページに移動し、ライセンス契約に同意して、R-4.4.1でビルドされたOML4R ServerおよびSupporting Packagesをダウンロードします。
ノート:
すべてのOML4Rサーバーおよびサポート・コンポーネントで、同じインストール・ディレクトリを使用します。 - インストール・ディレクトリに移動し、ダウンロードしたファイルを解凍します。
$ unzip oml4r-server-r4.4.1-linux8-x86-64-2.0.zip $ unzip oml4r-supporting-r4.4.1-linux8-x86-64-2.0.zipファイルを解凍すると、
server.shディレクトリが/serverおよび/supportingディレクトリとともに抽出されます。サーバー・ファイルのコンテンツは次のように表示されます:
$ ls server server.sh supporting $ ls server librqe.so rqd0706000.sql migration rqd0807000.sql omlrdbmig.sql rqd0908000.sql omlrdwgrd.sql rqdrp.sql omlre21.sql rqgrant.sql omlrrelod.sql rqpdrp00.sql omlru21.sql rqpdrp01.sql ORE_2.0_R_x86_64-unknown-linux-gnu.tar.gz rqpdrp02.sql OREbase_2.0_R_x86_64-unknown-linux-gnu.tar.gz rqpdrp03.sql OREcommon_2.0_R_x86_64-unknown-linux-gnu.tar.gz rqpdrp04.sql OREdm_2.0_R_x86_64-unknown-linux-gnu.tar.gz rqpdrp05.sql OREdplyr_2.0_R_x86_64-unknown-linux-gnu.tar.gz rqpdrp06.sql OREeda_2.0_R_x86_64-unknown-linux-gnu.tar.gz rqpdrp07.sql OREembed_2.0_R_x86_64-unknown-linux-gnu.tar.gz rqpdrp08.sql OREgraphics_2.0_R_x86_64-unknown-linux-gnu.tar.gz rqpdrp09.sql OREmodels_2.0_R_x86_64-unknown-linux-gnu.tar.gz rqproc.sql OREpredict_2.0_R_x86_64-unknown-linux-gnu.tar.gz rqsys.sql OREserver_2.0_R_x86_64-unknown-linux-gnu.tar.gz rqu0001000.sql ore.so rqu0102000.sql OREstats_2.0_R_x86_64-unknown-linux-gnu.tar.gz rqu0203000.sql ORExml_2.0_R_x86_64-unknown-linux-gnu.tar.gz rqu0304000.sql rqadmin.sql rqu0405000.sql rqcfg.sql rqu0506000.sql rqcrt.sql rqu0607000.sql rqd0100000.sql rqu0708000.sql rqd0201000.sql rqu0809000.sql rqd0302000.sql rquncfg.sql rqd0403000.sql rquser.sql rqd0504000.sql rqviw.sql rqd0605000.sqlサポート・ディレクトリ・ファイルのコンテンツは、次のように表示されます:
$ ls supporting/ arules_1.7-3_R_x86_64-unknown-linux-gnu.tar.gz assertthat_0.2.1_R_x86_64-unknown-linux-gnu.tar.gz Cairo_1.6-2_R_x86_64-unknown-linux-gnu.tar.gz cli_3.3.0_R_x86_64-unknown-linux-gnu.tar.gz crayon_1.5.1_R_x86_64-unknown-linux-gnu.tar.gz DBI_1.1.2_R_x86_64-unknown-linux-gnu.tar.gz dplyr_1.0.9_R_x86_64-unknown-linux-gnu.tar.gz ellipsis_0.3.2_R_x86_64-unknown-linux-gnu.tar.gz fansi_1.0.3_R_x86_64-unknown-linux-gnu.tar.gz generics_0.1.2_R_x86_64-unknown-linux-gnu.tar.gz glue_1.6.2_R_x86_64-unknown-linux-gnu.tar.gz lazyeval_0.2.2_R_x86_64-unknown-linux-gnu.tar.gz lifecycle_1.0.1_R_x86_64-unknown-linux-gnu.tar.gz magrittr_2.0.3_R_x86_64-unknown-linux-gnu.tar.gz pillar_1.8.1_R_x86_64-unknown-linux-gnu.tar.gz pkgconfig_2.0.3_R_x86_64-unknown-linux-gnu.tar.gz png_0.1-8_R_x86_64-unknown-linux-gnu.tar.gz purrr_0.3.4_R_x86_64-unknown-linux-gnu.tar.gz R6_2.5.1_R_x86_64-unknown-linux-gnu.tar.gz rlang_1.0.2_R_x86_64-unknown-linux-gnu.tar.gz ROracle_1.5-0_R_x86_64-unknown-linux-gnu.tar.gz statmod_1.4.36_R_x86_64-unknown-linux-gnu.tar.gz tibble_3.2.1_R_x86_64-unknown-linux-gnu.tar.gz tidyselect_1.1.2_R_x86_64-unknown-linux-gnu.tar.gz utf8_1.2.2_R_x86_64-unknown-linux-gnu.tar.gz vctrs_0.4.2_R_x86_64-unknown-linux-gnu.tar.gz - 次のコマンドを実行して、OML4RサーバーおよびSupporting PackagesをCDB$ROOTにインストールします:
$ ./server.sh Oracle R Enterprise 2.0 Server. Copyright (c) 2012, 2022 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 ................... Perform operation in a root container? [yes or no]yes Pass Checking ORE ....................... Pass Choosing RQSYS tablespaces PERMANENT tablespace to use for RQSYS [list]: SYSAUX SYSTEM USERS PERMANENT tablespace to use for RQSYS [list]: SYSAUX TEMPORARY tablespace to use for RQSYS [list]: TEMP TEMPORARY tablespace to use for RQSYS [list]: TEMP Current configuration R Version ........................ R version 4.4.1 (2024-06-14) R_HOME ........................... /usr/lib64/R R_LIBS_USER ...................... <ORACLE HOME PATH>/R/library ORACLE_HOME ...................... <ORACLE HOME PATH> ORACLE_SID ....................... orcl CDB .............................. CDB$ROOT Existing R Version ............... Existing R_HOME .................. Existing ORE data ................ None Existing ORE code ................ None Existing ORE libraries ........... 1.5.1 RQSYS PERMANENT tablespace ....... SYSAUX RQSYS TEMPORARY tablespace ....... TEMP Operation ........................ Install/Upgrade Proceed? [yes] yes Removing R libraries ............... Pass Removing ORE libraries ............. Pass Installing R libraries ............. Pass Installing ORE libraries ........... Pass Configuring the database ............ Pass Removing ORE packages .............. Pass Installing ORE packages ............ Pass Removing ORE script ................ Pass Creating ORE script ................ Pass Removing migration scripts ......... Pass Installing migration scripts ....... Pass Installing supporting packages ..... Pass Done - 次のコマンドを実行して、OML4RサーバーおよびSupporting PackagesをPDBにインストールします:
$ ./server.sh Oracle R Enterprise 2.0 Server. Copyright (c) 2012, 2022 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 ................... Perform operation in a root container? [yes or no]no PDB to use for ORE installation [list]: ORCLPDB PDB to use for ORE installation [list]: ORCLPDB Checking CDB/PDB ................... Pass Checking ORE ....................... Pass Choosing RQSYS tablespaces PERMANENT tablespace to use for RQSYS [list]: EXAMPLE SYSAUX SYSTEM USERS PERMANENT tablespace to use for RQSYS [list]: SYSAUX TEMPORARY tablespace to use for RQSYS [list]: TEMP TEMPORARY tablespace to use for RQSYS [list]: TEMP Current configuration R Version ........................ R version 4.4.1 (2024-06-14) R_HOME ........................... /usr/lib64/R R_LIBS_USER ...................... <ORACLE HOME PATH>/R/library ORACLE_HOME ...................... <ORACLE HOME PATH> ORACLE_SID ....................... orcl PDB .............................. ORCLPDB Existing R Version ............... R version 4.4.1 (2024-06-14) Existing R_HOME .................. /usr/lib64/R Existing ORE data ................ None Existing ORE code ................ None Existing ORE libraries ........... 2.0 RQSYS PERMANENT tablespace ....... SYSAUX RQSYS TEMPORARY tablespace ....... TEMP Operation ........................ Install/Upgrade Proceed? [yes] yes Removing R libraries ............... Pass Installing R libraries ............. Pass Configuring the database ............ Pass Removing ORE script ................ Pass Creating ORE script ................ Pass Installing supporting packages ..... Pass Done - ユーザーを設定します。
serverフォルダに含まれているrquser.sqlスクリプトを使用して、OML4Rのユーザーを作成できます。次の例では、パスワードrquserでrquserというユーザーを作成し、USERS表領域に無制限の割当てを付与します。SQL> alter session set container=<PDB name>; Session altered. SQL> @<path to unzipped server folder>/server/rquser.sql rquser USERS TEMP unlimited Session altered. Enter value for password: rquser old 1: create user &&1 identified by &password new 1: create user rquser identified by rquser old 2: default tablespace &&2 new 2: default tablespace USERS old 3: temporary tablespace &&3 new 3: temporary tablespace TEMP old 4: quota &&4 on &&2 new 4: quota unlimited on USERS User created. Session altered.必要な権限をユーザーに必ず付与します。
SQL> grant create session, create table, create view, create procedure, create mining model to rquser; Grant succeeded.OML4Rスクリプトを作成または管理するには、RQADMINロールが必要です。
SQL> grant rqadmin to rquser; Grant succeeded.CTX PL/SQLパッケージのEXECUTE権限の付与
GRANT EXECUTE ON CTXSYS.CTX_DDL TO rquser;