A.2 Install the OML4SQL Examples

Learn how to install OML4SQL examples.

The OML4SQL examples require:

  • Oracle Database (on-premises, Oracle Database Cloud Service, or Oracle Autonomous Database)

  • Oracle Database sample schemas

  • A user account with the privileges described in Grant Privileges for Oracle Machine Learning for SQL.

  • Execution of dmshgrants.sql by a system administrator

  • Execution of dmsh.sql by the OML4SQL user

Follow these steps to install the OML4SQL examples:

  1. Install or obtain access to an Oracle Database 21c instance. To install the database, see the installation instructions for your platform at Oracle Database 21c.

  2. Ensure that the sample schemas are installed in the database. See Oracle Database Sample Schemas for details about the sample schemas.

  3. Download the example code files from GitHub at https://github.com/oracle/oracle-db-examples/tree/master/machine-learning/sql/21c. Place the files in a directory to which you have access on the Oracle Database server.

  4. Verify that your user account has the required privileges described in Grant Privileges for Oracle Machine Learning for SQL.

  5. Ask your system administrator to run the dmshgrants.sql script, or run it yourself if you have administrative privileges. The script grants the privileges that are required for running the examples. These include SELECT access to tables in the SH schema as described in OML4SQL Sample Data and the system privileges listed in the following table.

    Pass the name of the OML4SQL user to dmshgrants.

    SQL> CONNECT sys / as sysdba
    Enter password: sys_password
    Connected.
    SQL> @<location_of_examples>/dmshgrants oml_user
  6. Connect to the database and run the dmsh.sql script. This script creates views of the sample data in the schema of the OML4SQL user.

    SQL> CONNECT oml_user
    Enter password: oml_user_password
    Connected.
    SQL> @<location_of_examples>/dmsh