41.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.
-
Running of
dmshgrants.sql
by a system administrator -
Running of
dmsh.sql
by the OML4SQL user
Follow these steps to install the OML4SQL examples:
-
Install or obtain access to an Oracle Database 23ai instance. To install the database, see the installation instructions for your platform at Oracle Database 23ai.
-
Ensure that the sample schemas are installed in the database. See Oracle Database Sample Schemas for details about the sample schemas.
-
Download the example code files from GitHub at https://github.com/oracle/oracle-db-examples/tree/master/machine-learning/sql. Select the Database edition. Place the files in a directory to which you have access on the Oracle Database server. For example,
$ORACLE_HOME/demo/schema
.$ORACLE_HOME
is the home path where you have installed the database. Typically,/scratch/u01/app/oracle/product/23.0.0/dbhome_1
. -
Verify that your user account has the required privileges described in Grant Privileges for Oracle Machine Learning for SQL.
-
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 includeSELECT
access to tables in theSH
schema as described in OML4SQL Sample Data and the system privileges.Connect as
SYSDBA
:CONNECT sys / as sysdba Enter password: sys_password Connected.
Pass the name of the OML4SQL user to
dmshgrants
:@<location_of_examples>/dmshgrants oml_user
-
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.CONNECT oml_user Enter password: oml_user_password Connected.
Issue the following to run the script:
@<location_of_examples>/dmsh.sql
Related Topics