4.4.1 Upgrade OML4Py from 1.0 to 2.0 in DB 19c standalone

If you already have the OML4Py server 1.0 installed in the on-premises Oracle Database 19c or 21c, you can run the OML4Py 2.0 server Perl script to upgrade OML4Py server to 2.0.

The following instructions tell you how to upgrade to OML4Py server 2.0:

  1. Check if a directory named oml4py exists in the $ORACLE_HOME directory.
    • If the directory oml4py does not exist in the $ORACLE_HOME directory, create it.
      mkdir $ORACLE_HOME/oml4py
    • If the oml4py directory already exists, clean up the server folder.
      rm -rf $ORACLE_HOME/oml4py/server
  2. Download the installation file for your system.
    1. Go to the Oracle Machine Learning for Python Downloadspage on the Oracle Technology Network.
    2. Accept the license agreement and select Oracle Machine Learning for Python Downloads (v2.0).
    3. Select Oracle Machine Learning for Python Server Install for Oracle Database on Linux 64 bit.
    4. Save the file to the $ORACLE_HOME/oml4py directory.
  3. To extract the installation file to $ORACLE_HOME/oml4py directory, use the command:
     unzip oml4py-server-linux-x86_64-2.0.zip -d $ORACLE_HOME/oml4py
  4. Set the PYTHONPATH environment variable prior to running the server installation script so that Python can find the installed oml modules:
    export PYTHONPATH=$ORACLE_HOME/oml4py/modules
  5. From the $ORACLE_HOME/oml4py directory, run the server installation perl script to upgrade. The following command runs the script in interactive mode:
    perl -Iserver server/server.pl
  6. The Perl script will detect the existing version 1.0 and ask whether to proceed to upgrade to 2.0. Enter y or yes. The output of a successful upgrade is as follows:
    Oracle Machine Learning for Python 2.0 Server.
    
    Copyright (c) 2018, 2023 Oracle and/or its affiliates. All rights
    reserved.
    
    Checking platform .................. Pass
    Checking ORACLE_HOME ............... Pass
    Checking ORACLE_SID ................ Pass
    Checking sqlplus ................... Pass
    Checking ORACLE instance ........... Pass
    Checking CDB/PDB ................... Pass
    Checking OML4Py Server ............. Pass
    Checking Python .................... Pass
    Checking module dependencies ....... Pass
    Checking Python libraries .......... Pass
    Checking OML4Py version ............ Pass
    
    Current configuration
      ORACLE_HOME ...................... /u01/app/oracle/product/19.3/dbhome_1
      ORACLE_SID ....................... orcl
      Python Version ................... 3.12.0
      PYTHONHOME ....................... /u01/app/oracle/product/19.3/dbhome_1/python
      Existing OML4Py data and code .... 1.0
      Existing OML4Py embed component .. 1.0
      Existing OML4Py module version ... 1.0
      Upgrading to OML4Py .............. 2.0
        
      Operation ........................ Upgrade
        
    Proceed? [yes]y
    
    Found existing installation: oml 1.0
    Uninstalling oml-1.0:
      Successfully uninstalled oml-1.0
    Removing embedded python libraries .. Pass
    Copying embedded python libraries ... Pass
    Processing ./server/oml-2.0-cp312-cp312-linux_x86_64.whl
    Installing collected packages: oml
    Successfully installed oml-2.0
    
    Upgrading PYQSYS 1.0 to 2.0 ......... Pass
    
    Done