2 Install and Configure the Database for Oracle Machine Learning for R
This chapter explains how to install and configure Oracle Database to support OML4R Server.
This chapter contains these topics:
- Install Oracle Database for Oracle Machine Learning for R
Installation instructions for Oracle Database. - Using EXTPROC with Embedded R Execution
Oracle Database uses an external procedure agent namedextproc
to support external procedures.
2.1 Install Oracle Database for Oracle Machine Learning for R
Installation instructions for Oracle Database.
OML4R requires the 64-bit version of Oracle Database Enterprise Edition or Standard Edition 2. For the supported platforms, see Oracle Machine Learning for R System Requirements for On-Premises Database.
To install Oracle Database, follow the installation instructions for your supported platform:
- Go to the Oracle Database Documentation page in Oracle Help Center.
- Select the version of Oracle Database to install.
- In the Topics section, select Install and Upgrade.
- In the section for your operating system, select the appropriate installation guide.
Note:
You can install OML4R Server in a pluggable database (PDB) within a multitenant container database (CDB). The database may not be installed in the root database in the multitenant environment.
For information about managing a multitenant environment, see Oracle Database Administrator's Guide.
2.2 Using EXTPROC with Embedded R Execution
Oracle Database uses an external procedure agent named extproc
to support external procedures.
An external procedure is a procedure invoked from a program that is written in a different language. OML4R uses extproc
to support embedded R execution.
- About EXTPROC
When an application invokes an external procedure, Oracle Database starts anextproc
agent. - About EXTPROC Configuration for OML4R
OML4R uses the default configuration ofextproc
. - Troubleshooting EXTPROC
Calling an OML4R embedded R function may result in an error if a database configuration problem exists.
2.2.1 About EXTPROC
When an application invokes an external procedure, Oracle Database starts an extproc
agent.
The application uses the network connection established by Oracle Database to pass instructions to the agent for executing the procedure. The agent loads a DLL or shared library, runs the external procedure, and passes back to the application any values returned by the external procedure.
Parent topic: Using EXTPROC with Embedded R Execution
2.2.2 About EXTPROC Configuration for OML4R
OML4R uses the default configuration of extproc
.
Note:
When using OML4R with Oracle Database 12c or later, the default
extproc
configuration is required. It will not work with the
listener-based extproc
.
The extproc
agent is spawned directly by Oracle Database, and no configuration changes are required to either listener.ora
or tnsnames.ora
. If extproc
is configured on the database listener, it overrides the default settings.
For R-3.3.0 on Linux 6, by default, extproc
supports external procedure calls if the libraries used are in $ORACLE_HOME/bin or $ORACLE_HOME/lib.
To allow extproc
to service any external procedure, set EXTPROC_DLLS
to ANY
or simply leave it blank (the default).
Enable extproc
tracing by doing the following:
- To your
extproc.ora
file, add the following statement:SET TRACE_LEVEL=ON
- Restart the database.
Traces for all
extproc
operations are now recorded in the log files in the$ORACLE_HOME/hs/log
directory.
For R-3.3.0 on Linux 6 it is necessary to set LD_LIBRARY_PATH
in $ORACLE_HOME/hs/admin/extproc.ora
to the location of the R-core-extra RPM so that these libraries are found by the Oracle process running extproc
. For example, the default location of the R-core-extra RPM is /usr/lib64/R/port/Linux-X64/lib
. The extproc.ora
entry for that location should be:
SET LD_LIBRARY_PATH=/usr/lib64/R/port/Linux-X64/lib
In Linux 7 and later, setting LD_LIBRARY_PATH
is not necessary because the required versions of these libraries are native to newer systems.
Note:
A database reboot is needed for changes inextproc.ora
to take effect.
See Also:
"Default Configuration for External Procedures" in Oracle Database Net Services Administrator's Guide for details
Parent topic: Using EXTPROC with Embedded R Execution
2.2.3 Troubleshooting EXTPROC
Calling an OML4R embedded R function may result in an error if a database configuration problem exists.
If an attempt to call an OML4R embedded R function results in the following error, then the external procedure did not succeed:
ORA-28575: unable to open RPC connection to external procedure agent.
This error is often a database configuration problem. It may be caused by any of the following:
-
The OML4R user has not been granted RQADMIN role.
-
The Oracle listener configuration is incorrect, which may occur if the default external procedure configuration (which is recommended) is not being used.
-
Networking layer restrictions or issues exist.
-
Restrictions on external procedure calls are in force.
Parent topic: Using EXTPROC with Embedded R Execution