3.4.2 Install OML4Py Server for Linux for On-Premises Oracle Database 21c

Instructions for installing the OML4Py server for Linux for an on-premises Oracle Database 21c.

You can install OML4Py by using a Python script included in your 21c database or by using the Database Configuration Assistant (DBCA).

Install OML4Py By Using a Python Script

To install the on-premises OML4Py server, the following are required:
  • A connection to the internet.
  • Python 3.9.5. For instructions on installing Python 3.9.5 see Build and Install Python for Linux for On-Premises Databases.
  • OML4Py supporting packages. For instructions on installing the required supporting packages see Install the Required Supporting Packages for Linux for On-Premises Databases.
  • Perl 5.8 or higher installed on your system.

    Note:

    Perl requires the perl-Env package. You can install the package as root with the command yum install perl-Env .

    To check for the existence of perl-Env, run the following command. The version will vary depending on your Operating System and version:

    rpm -qa perl-Env
    perl-Env-1.04-395.el8.noarch
  • Write permission on the directories to which you download and install the server components.

Note:

The following environment variables must be set up.
  • Set environment variables: Set PYTHONHOME and add it to your PATH
  • Set ORACLE_HOME and add it to your PATH
  • Set LD_LIBRARY_PATH
export PYTHONHOME=PREFIX
export PATH=$PYTHONHOME/bin:$ORACLE_HOME/bin:$PATH
export ORACLE_HOME=ORACLE_HOME_HERE
export LD_LIBRARY_PATH=$PYTHONHOME/lib:$ORACLE_HOME/lib:$LD_LIBRARY_PATH

To install the OML4Py server for Linux for an on-premises Oracle Database 21c, run the server installation Python script pyqcfg.sql.

  1. At your operating system prompt, start SQL*Plus and log in to your Oracle pluggable database (PDB) directly.

  2. Run the pyqcfg.sql script. The script is under $ORACLE_HOME/oml4py/server.

    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> ALTER PROFILE DEFAULT LIMIT PASSWORD_VERIFY_FUNCTION NULL;
    SQL> @$ORACLE_HOME/oml4py/server/pyqcfg.sql
    
    define permtbl_value = SYSAUX --> Specify a permanent tablespace for the PYQSYS schema
    define temptbl_value = TEMP --> Specify a temporary tablespace
    define orahome_value = /u01/app/oracle/product/21.3.0.0/dbhome_1 --> Specify the ORACLE_HOME directory
    define pythonhome = /opt/Python-3.9.5 --> Specify the PYTHON_HOME directory
  3. Open the install.txt file to see if any errors occurred.

Install OML4Py With the Database Configuration Assistant (DBCA)

You can install OML4Py by using DBCA. For complete instruction on using DBCA, see Database Configuration Assistant Command Reference for Silent Mode.

The basic syntax to install OML4Py is:

dbca -configureOML4PY
You can include the following parameters:
  • -oml4pyConfigTablespace to configure the tablespace of the PYQSYS schema for OML4Py. The default tablespace is SYSAUX.
  • -enableOml4pyEmbeddedExecution to enable the embedded Python component of Oracle Machine Learning for Python. The default value is TRUE.