7.8 Create a Database User for Oracle Machine Learning for R

In Database 18c or later, the rquser.sql script ships with Oracle Database 18c and later and resides in the $ORACLE_HOME/R/server directory. The script installs creates a new OML4R user, and the script rqgrant.sql in the same directory applies the required grants to the new user. With Oracle Database 12c and earlier, the server script installation process automatically creates or configures a user for OML4R if one does not already exist.

Example 7-2 Creating an OML4R User

./server.sh
.
.

Choosing ORE user
  ORE user to use [list]:

Press Enter to display a list of available users.

BI
HR
IX
OE
SCOTT
SH
  ORE user to use [list]: ruser2
.
.

If you choose a user that exists, the script configures the user to support OML4R. If you specify a user that does not already exist, the script creates the user.

Example 7-3 Creating an OML4R User in SQL*Plus

You can create an OML4R user in SQL*Plus by following these steps:

  1. Log in with system privileges:

    SQLPLUS / AS SYSDBA
    
  2. Run a statement like the following to create the user:

    CREATE USER oml_username IDENTIFIED BY password
    DEFAULT TABLESPACE default_tablepace_name
    TEMPORARY TABLESPACE temp_tablespace_name 
    QUOTA UNLIMITED ON default_tablespace_name;

    See Also:

    Oracle Database SQL Language Reference for details about creating a user

  3. Grant the required privileges:

    GRANT CREATE SESSION,
          CREATE TABLE,
          CREATE VIEW,
          CREATE PROCEDURE,
          CREATE MINING MODEL
    TO oml_username; 

    See Also:

    Oracle Database SQL Language Reference for details about granting privileges to a user