Create a Database User for Oracle Machine Learning for R

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. Execute 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

About the RQADMIN Role

The server script installation process creates a database role called RQADMIN.

When the RQADMIN role is granted to an OML4R user, the user can create and drop R scripts for embedded R execution. By default, the server script does not grant the RQADMIN role to the OML4R user.

Note:

Any OML4R user can execute embedded R, but only OML4R users with the RQADMIN role can create and drop the R scripts.

If you choose to grant the RQADMIN role in SQL*Plus, then log in with system privileges and execute a statement like the following:

SQLPLUS / AS SYSDBA
GRANT RQADMIN TO oml_username;

Caution:

Use caution when granting the RQADMIN role. Only users that require OML4R administrative privileges should have this role.