4.4.1 Install OML4Py Server for Linux for On-Premises Oracle Database 23ai
Instructions for installing the OML4Py server for Linux for an on-premises Oracle Database 23ai.
You can install OML4Py by using a Python script included in your 23ai database or by using the Database Configuration Assistant (DBCA).
Install OML4Py Using a SQL Script
- A connection to the internet.
- 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 theperl-Env
package. You can install the package as root with the commandyum 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 yourPATH
- Set
ORACLE_HOME
and add it to yourPATH
- Set
LD_LIBRARY_PATH
export PYTHONHOME=$ORACLE_HOME/python
export PATH=$PYTHONHOME/bin:$ORACLE_HOME/bin:$PATH
export ORACLE_HOME=<ORACLE_HOME PATH>
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 23ai, run the server installation SQL script
pyqcfg.sql
.
Note:
The OML4Py server needs to be installed onCDB$ROOT
first,
followed by installation on a PDB for Oracle Database 23ai.
-
The
pyqcfg.sql
script is under$ORACLE_HOME/oml4py/server
. Change directory to$ORACLE_HOME/oml4py/server
.cd $ORACLE_HOME/oml4py/server
-
At your operating system prompt, start SQL*Plus, connect to the
CDB$ROOT
and run thepyqcfg.sql
script.sqlplus / as sysdba
SQL*Plus: Release 23.0.0.0.0 - Production on Tue Apr 30 12:40:18 2024 Version 23.4.0.24.05 Copyright (c) 1982, 2024, Oracle. All rights reserved. Connected to: Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - Production Version 23.4.0.24.05
To capture the log, spool the installation steps to an external file
install_root.txt
.SQL> spool install_root.txt
Verify that you are currently connected to the
CDB$ROOT
container.SQL> show con_name
CON_NAME ------------------------------ CDB$ROOT
Run the
pyqcfg.sql
script to install OML4Py server in theCDB$ROOT
first.
whereSQL> @pyqcfg.sql SYSAUX TEMP SQL> spool off;
SYSAUX
is the permanent tablespace for the PYQSYS schema.TEMP
is the temporary tablespace for the PYQSYS schema.
Open the
install_root.txt
file to see if any errors occurred. -
At your operating system prompt, start SQL*Plus, connect to your PDB and run the
pyqcfg.sql script
. To capture the log, spool the installation steps to an external fileinstall_pdb.txt
. The following example uses the PDBORCLPDB
and gives example values for the script arguments.sqlplus / as sysdba SQL> spool install_pdb.txt
Log into a PDB where you want to install OML4Py server.
SQL> alter session set container=ORCLPDB;
Run thepyqcfg.sql
script to install OML4Py server in the PDB.
whereSQL> @pyqcfg.sql SYSAUX TEMP SQL> spool off;
SYSAUX
is the permanent tablespace for the PYQSYS schema.TEMP
is the temporary tablespace for the PYQSYS schema.
Open the
install_pdb.txt
file to see if any errors occurred
Verify the Server Installation
- On the OML4Py server database instance, start SQL*Plus as the
OML user logging into the PDB, in this example,
PDB1.
sqlplus oml_user/oml_user_password$ORCLPDB
- Run the following
command:
SELECT * FROM sys.pyq_config;
The expected output is as follows:$ sqlplus / as sysdba; SQL*Plus: Release 23.0.0.0.0 - Production on Tue Apr 30 16:23:35 2024 Copyright (c) 1982, 2024, Oracle. All rights reserved. Connected to: Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - Production Version 23.4.0.24.05 SQL> alter session set container=ORCLPDB; Session altered. SQL> select * from sys.pyq_config; NAME -------------------------------------------------------------------------------- VALUE -------------------------------------------------------------------------------- PYTHONHOME /u01/app/oracle/product/23.4.0.0/dbhome_1/python PYTHONPATH /u01/app/oracle/product/23.4.0.0/dbhome_1/oml4y/modules VERSION 2.0 NAME -------------------------------------------------------------------------------- VALUE -------------------------------------------------------------------------------- PLATFORM ODB DSWLIST oml.*;pandas.*;numpy.*;matplotlib.*;sklearn.*
- To verify the installation of the OML4Py server for an on-premises database see Verify OML4Py Installation for On-Premises Database.
- Commands Summary for Installing OML4Py Server for On-Premises Oracle Databases
The commands for installing OML4Py server for On-Premises oracle databases are listed in the following example.
Parent topic: Install OML4Py Server for On-Premises Oracle Database