5.2.3 Install OML4R Server Across Exadata Compute Nodes Using DCLI for 18c and Later

How to use DCLI to install OML4R Server across multiple Exadata Linux compute nodes for Oracle Database 18c and later.

To install OML4R Server on Exadata using DCLI for Oracle Database 18c and later, follow these steps:
  1. Get a list of the compute nodes in the rack.

    In the following example, the cat nodes command lists the nodes for a two-node cluster.

    $ cat nodes
    exadb01
    exadb02
  2. In a text editor, create a file that contains the names of all of the compute nodes in the rack. Specify each node name on a separate line. For example, the nodes file for a two-node cluster would contain entries such as the following:
    exadb01
    exadb02
  3. Ensure that the ORACLE_HOME, ORACLE_SID, R_HOME, PATH, and LD_LIBRARY_PATH environment variables are properly set on each node, and are defined in the same shell in which you will run the DCLI script. For example, you could specify values like the following in a bashrc file:
    export ORACLE_HOME=/u01/app/oraclecle/product/release_number/dbhome_1
    export ORACLE_SID=ORCL
    export R_HOME=/usr/lib64/R
    export PATH=$PATH:$R_HOME/bin:$ORACLE_HOME/bin
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$RHOME_lib:$R_HOME/port/Linux-X64/lib
  4. Option 1: On the first database node only, execute as sysdba the rqcfg.sql script from your PDB.
    $ sqlplus / as sysdba;
    SQL> alter session set container=PDBNAME;
    SQL> @$ORACLE_HOME/R/server/rqcfg.sql

    Note:

    The rqcfg.sql script ships with Oracle Database 18c and later and resides in the $ORACLE_HOME/R/server directory. The script installs the OML4R Server components in the database and you only need to be execute it once.

    The rqcfg.sql script prompts you for the following input parameters:

    define permtbl = permanent tablespace name for RQSYS schema
    define temptbl = temporary tablespace name for RQSYS schema
    define orahome = ORACLE_HOME path
    define rhome = R_HOME path

    Option 2: Execute the rqcfg.sql script from the Linux command line.

    In the example, the user is system with the password apassword, the RQSYS schema is in SYSAUX and SYSAUX is assigned the temporary tablespace TEMP. The value for ORACLE_HOME is /u01/app/oracle/product/21.3.0.0/dbhome_1 and the value for R_HOME is the Linux default path, /usr/lib64/R:

    $ sqlplus -L -S system/apassword @$ORACLE_HOME/R/server/rqcfg.sql SYSAUX TEMP /u01/app/oracle/product/21.3.0.0/dbhome_1 /usr/lib64/R
  5. Download and install the OML4R supporting packages.

    To download ths supporting packages, go to the Oracle Machine Learning for R Downloads website. Select Supporting in the column for your version of the database and R, accept the license agreement, and download the ore-supporting-linux-x86-64-version.zip file.

    Log in as root and copy the installers for the supporting packages across the nodes. For example:

    $ dcli -g nodes -l oracle mkdir -p /home/oracle/OML4R
    
    $ dcli -g nodes -l oracle -f ore-supporting-linux-x86-64-version.zip -d
         /home/oracle/OML4R/ore-supporting-linux-x86-64-version.zip

    Unzip the supporting packages on each node:

    $ dcli -t -g nodes -l oracle unzip
         /home/oracle/OML4R/ore-supporting-linux-x86-64-version.zip -d
         /my_destination_directory/

    Install the OML4R supporting packages, as in the following example:

    $ dcli -t -g nodes -l oracle R CMD INSTALL /my_destination_directory/supporting/* -l $ORACLE_HOME/R/library/

    Note:

    The rqcfg.sql script creates an OML4R user. By default, the script does not grant the RQADMIN role to the user.

    Any OML4R user can use an embedded R execution function, but only those with the RQADMIN role can create and drop the R scripts in the OML4R script repository in the database. Use caution when granting the RQADMIN role.

  6. Start R with the ORE script, and verify that OML4R loads.
    $ ORE
    
    > 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