Install Oracle Machine Learning for R Server for Oracle Database 18c and Later

Instructions for installing OML4R Server for Oracle Database 18c or later.

As of Oracle Database 18c, the rqcfg.sql installation script for OML4R Server is part of the database. The script is in the $ORACLE_HOME/R/server/ directory.

The rqcfg.sql script enables the OML4R Server components that are part of the database, configures some aspects of the server, and installs some OML4R database objects.

Before installing OML4R Server, install R, as described in Install R for Oracle Machine Learning for R.

The OML4R Server packages are in the $ORACLE_HOME/R/library/ directory. For Oracle Database 18c and 19c, the server packages in Oracle Database are built under R-3.3.0 and are compatible with R-3.3.0. If you are using R-3.3.0, you can install OML4R Server by running the rqcfg.sql installation script.

For use with R-3.6.1 or later, the OML4R Server packages are built under R-3.6.1. To use OML4R with R-3.6.1, you must download and install those OML4R Server packages before running the rqcfg.sql installation script.


Use the rqcfg.sql script only once, to enable and configure OML4R Server for the first time. Do not run the script on an existing OML4R installation for maintenance or upgrades. For example, if you are using R-3.3.0 with OML4R 1.5.1 but you want to upgrade to R-3.6.1, do not run the rqcfg.sql script again.

Prepare to Use OML4R Server with R-3.6.1 or Later

Instructions for downloading and installing the OML4R Server packages built under R-3.6.1.

In Oracle Database 18c and 19c, the OML4R Server packages are in the $ORACLE_HOME/R/library/ directory. For use with R-3.6.1, you can either rename the OML4R packages in that directory or you can delete them. You then download and install the OML4R Server packages that are compatible with R-3.6.1.

These instructions rename the original OML4R server packages and replace them with ones built under R-3.6.1.
  1. Rename the OML4R packages in the $ORACLE_HOME/R/library/ directory.
    $ cd $ORACLE_HOME/R/library
    $ mv ORE ORE.orig
    $ mv OREbase OREbase.orig
    $ mv OREcommon OREcommon.orig
    $ mv OREdm OREdm.orig
    $ mv OREdplyr OREdplyr.orig
    $ mv OREeda OREeda.orig
    $ mv OREembed OREembed.orig
    $ mv OREgraphics OREgraphics.orig
    $ mv OREmodels OREmodels.orig
    $ mv OREpredict OREpredict.orig
    $ mv OREserver OREserver.orig
    $ mv OREstats OREstats.orig
    $ mv ORExml ORExml.orig
  2. Go to the Oracle Machine Learning for R Downloads page, accept the license agreement, and download the R-3.6.1 compatible OML4R Server packages to an installation directory, such as /oml4rserver_install_dir/.


    Use the same installation directory for all OML4R components.
  3. Go to the installation directory and unzip the downloaded file.
    $ cd /oml4rserver_install_dir/
    $ unzip

    When you unzip the file, the /server directory is created and these files are extracted to it:

  4. Go to the /oml4rserver_install_dir/server directory and execute the following commands:
    $ cd /oml4rserver_install_dir/server
    $ ORE CMD INSTALL ORE_version_R_arch-unknown-platform-gnu.tar.gz
    $ ORE CMD INSTALL OREbase_version_R_arch-unknown-platform-gnu.tar.gz
    $ ORE CMD INSTALL OREcommon_version_R_arch-unknown-platform-gnu.tar.gz
    $ ORE CMD INSTALL OREdm_version_R_arch-unknown-platform-gnu.tar.gz
    $ ORE CMD INSTALL OREdplyr_version_R_arch-unknown-platform-gnu.tar.gz
    $ ORE CMD INSTALL OREeda_version_R_arch-unknown-platform-gnu.tar.gz
    $ ORE CMD INSTALL OREembed_version_R_arch-unknown-platform-gnu.tar.gz
    $ ORE CMD INSTALL OREgraphics_version_R_arch-unknown-platform-gnu.tar.gz
    $ ORE CMD INSTALL OREmodels_version_R_arch-unknown-platform-gnu.tar.gz
    $ ORE CMD INSTALL OREpredict_version_R_arch-unknown-platform-gnu.tar.gz
    $ ORE CMD INSTALL OREstats_version_R_arch-unknown-platform-gnu.tar.gz
    $ ORE CMD INSTALL OREserver_version_R_arch-unknown-platform-gnu.tar.gz
    $ ORE CMD INSTALL ORExml_version_R_arch-unknown-platform-gnu.tar.gz
If you are installing OML4R Server for the first time, then run the rqcfg.sql script. If you already have installed OML4R Server and are upgrading R from R-3.3.0 to R-3.6.1, then you do not need to, and should not, run the rqcfg.sql script.

Install OML4R Server Using rqcfg.sql

Instructions for installing OML4R Server for Oracle Database 18c and later.

After installing R, install OML4R Server by running the rqcfg.sql script and providing values for the arguments in the following table.

Table 4-3 Arguments to the rqcfg.sql Installation Script

Argument Description

define permtbl

Specify a permanent tablespace for the RQSYS schema.

define temptbl

Specify a temporary tablespace.

define orahome

Specify the ORACLE_HOME directory.

define rhome

Specify the R_HOME directory.

  1. At your operating system prompt, start SQL*Plus, log in to your PDB directly and run the rqcfg.sql script. To capture the log, spool the installation steps to an external file. The following example uses the PDB PDB1 and gives example values for the script arguments.
    $ sqlplus / as sysdba 
    SQL> spool install.txt 
    SQL> alter session set container=PDB1; 
    SQL> @$ORACLE_HOME/R/server/rqcfg.sql
    define permtbl = SYSAUX 
    define temptbl = TEMP 
    define orahome = /u01/app/oracle/product/ 
    define rhome = /usr/lib64/R

    Open the install.txt file to see if any errors occurred.

  2. At your operating system prompt, go to the ORACLE_HOME/bin directory and grant read and execute permission to all users to the ORE directory.
    cd  $ORACLE_HOME/bin
    chmod 755 ORE
  3. Download and install the OML4R 1.5.1 supporting packages for your system as described in Install the OML4R Supporting Packages