4.3 Install Oracle Machine Learning for R Server for Oracle Database 23ai

Instructions for installing the OML4R Server on both the Container Database Root (CDB$ROOT) and Pluggable Databases (PDBs) within your Oracle Database 23ai environment.

Note:

The OML4R server must be installed on CDB$ROOT followed by the PDB.

The OML4R 2.0 binaries are shipped with Oracle Database 23ai. To install the OML4R 2.0 server components, use $ORACLE_HOME/R/server/rqcfg.sql script. You need to download and install the OML4R 2.0 supporting libraries separately.

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 on On-Premises Oracle Database.

To install OML4R 2.0 server components for Oracle Database 23ai, do the following:

  1. Install OML4R Server on CDB$ROOT:
    1. Start SQL*Plus and connect as SYSDBA.
      cd $ORACLE_HOME/R/server
      sqlplus / as sysdba
    2. Create a file and capture installation output in the file.
      SQL> spool install_root.txt
    3. Verify your current connection with show con_name. This should confirm you are connected to CDB$ROOT.
      SQL> show con_name
      CON_NAME
      ------------------------------
      CDB$ROOT
      
    4. Run the rqcfg.sql script.

      Note:

      The first parameter is the tablespace for the RQSYS schema, the second parameter is the temporary tablespace for the RQSYS schema, the third parameter is the hard-coded value for ORACLE_HOME, and the fourth parameter is the hard-coded value for R_HOME.
      SQL> @rqcfg.sql
      The output appears as follows:
      Enter value for 1: SYSAUX
      Enter value for 2: TEMP
      Enter value for 3: /u01/app/oracle/product/23.4/dbhome_1
      Enter value for 4: /usr/lib64/R
      
    5. Review the install_root.txt log file for any errors that may have occurred during installation.
  2. Install OML4R Server on PDBs

    To install the OML4R Server on PDBs, run the below commands:

    1. Exit and restart SQLPlus. Then navigate to the pluggable database and run the following command.
      $ sqlplus / as sysdba
      SQL> alter session set container=ORCLPDB;
      
    2. Verify your current connection with SHOW CON_NAME. This should confirm you are connected to ORCLPDB.
      SQL> show con_name

      The output appears as follows:

      CON_NAME
      ------------------------------
      ORCLPDB
      
    3. Create a file and capture installation output in the file.
      SQL> spool install_pdb.txt
    4. Run the rqcfg.sql script in the PDB.

      Note:

      The first parameter is the tablespace for the RQSYS schema, the second parameter is the temporary tablespace for the RQSYS schema, the third parameter is the hard-coded value for ORACLE_HOME, and the fourth parameter is the hard-coded value for R_HOME.
      SQL> @rqcfg.sql
      The output appears as follows:
      
      Enter value for 1: SYSTEM
      Enter value for 2: TEMP
      Enter value for 3: /u01/app/oracle/product/23.4/dbhome_1
      Enter value for 4: /usr/lib64/R
      
    5. Review the install_pdb.txt log file for any errors that may have occurred during installation.
    6. To ensure secure access to OML4R features within the PDB, either create a new user and grant the required privileges, or configure an existing user with the least necessary permissions. To create a database user, see Create a Database User for Oracle Machine Learning for R.
  3. To install OML4R supporting packages, see Install the OML4R Supporting Packages.