Skip Headers
Oracle® R Enterprise Installation and Administration Guide
Release 1.3 for Linux and Windows

Part Number E36763-04
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

6 Administrative Tasks

If the installation is not successful, you can Troubleshoot the Installation.

After you have installed a server and at least one client, create at least one user:

After you create a user, perform these tasks:

As system administrator, you can Control Memory Used by Embedded R.

If you installed any previous version of Oracle R Enterprise, you can Upgrade Oracle R Enterprise.; upgrade happens as part of install.

If necessary, you can Uninstall Oracle R Enterprise.

Troubleshoot the Installation

The installation script creates a log file on the server. Examine the log file even if the installation reports success. Search the log file for ERROR.

If you cannot resolve the problems, request help from Oracle Support or from the Oracle R Enterprise discussion forum.

Oracle R Enterprise Users

You must create at least one user for Oracle R Enterprise. Follow these steps to create a user for Oracle R Enterprise:

  1. Create a User

  2. Add any Required GRANTs

Create a User

To create an Oracle R Enterprise user, use

  • demo_user.sh (for Linux)

  • demo_user.bat (for Windows)

To run these scripts, start SQL*Plus / as sysdba.

Either of these scripts asks you if you want to create an ORE (Oracle R Enterprise) user. The script checks that Oracle Database and Oracle R Enterprise are installed and then creates a user.

After you create the user RQUSER, you can edit the user as necessary; for example, you can and should change the password.

Required GRANTs

Several additional GRANTs may be required depending on how you plan to use Oracle R Enterprise:

  • RQADMIN role Oracle R Enterprise installation creates the administrative role RQADMIN.

    RQADMIN allows Oracle R Enterprise users to create and drop R scripts that use the database embedded R engine.

    All users can execute such scripts; no special grant is required.

    Note:

    You should grant RQADMIN only to those users who need to have it, that is, to users who must create and drop R scripts that use the database embedded R engine.

    To grant RQADMIN to RQUSER, start SQL*Plus as sysdba and type

    GRANT RQADMIN to RQUSER
    
  • CREATE TABLE is needed by some functions that create temporary tables, such as ore.create() with a table argument.

    To grant CREATE TABLE to RQUSER, start SQL*Plus as sysdba and type

    GRANT CREATE TABLE TO RQUSER;
    
  • CREATE PROCEDURE is required by ore.groupApply()

    To grant CREATE PROCEDURE to RQUSER, start SQL*Plus as sysdba and type

    GRANT CREATE PROCEDURE TO RQUSER;
    
  • CREATE VIEW is required by ore.create() with a view argument and by the OREdm package.

    To grant CREATE VIEW to RQUSER, start SQL*Plus as sysdba and type

    GRANT CREATE VIEW TO RQUSER;
    
  • CREATE MINING MODEL is required by the OREdm package.

    To grant CREATE MINING MODEL to RQUSER, start SQL*Plus as sysdba and type

    GRANT CREATE MINING MODEL TO RQUSER;
    

Two GRANTs that were required for Oracle R Enterprise 1.1 are no longer required; see Deprecated Grants for details.

Deprecated Grants

The RQROLE role was granted to all users for Oracle R Enterprise 1.1. RQROLE is deprecated for Oracle R Enterprise 1.3.

This GRANT EXECUTE:

grant EXECUTE on rqsys.rqGroupEvalImpl to rquser;

is deprecated for Oracle R Enterprise 1.3 but was required for Oracle R Enterprise 1.1.

Configure Oracle Wallet (Optional)

The Oracle Wallet provides secure storage of user passwords and client certificates. An Oracle Wallet provides a secure way for embedded R scripts to avoid storing passwords in the script.

Follow these steps to configure Oracle Wallet with Oracle R Enterprise:

  1. Configure Oracle Wallet and store the username and password. For information, see the discussions of Oracle Wallet in Oracle Database Security Guide.

  2. Add the connection string used to create the wallet entry (for example, "mydb112_test") to map to the DB instance connection string in tnsnames.ora (Change the host name to be your database machine name and SID to be the SID of your database.):

    mydb112_test =
          (DESCRIPTION =
             (ADDRESS =
                (PROTOCOL = TCP)
                (HOST = <host_name>)
                (PORT = 1521)
             )
             (CONNECT_DATA = (sid=<SID>))
          )
    

    After you complete the steps, you can just use the connect string to connect to the database:

    ore.connect(conn_string = "mydb112_test", all = TRUE)
    

    For more information about connecting using Oracle Wallet, see the R help for ore.connect().

Start Oracle R Enterprise Client

After you have installed a server and a client, follow these directions to start the client:

Start the Oracle R Enterprise Client on Microsoft Windows

After the server is installed, you can launch the client.

To launch the Oracle R Enterprise client in a running session of R 2.15.1 (or R 2.13.2 for earlier releases), execute the following R code from the R Console. Before you execute the code, modify the connection information (user, sid, host, password, and port) for the database where the R Sever is installed:

# Load ORE packages and dependencies
# DBI, ROracle, OREbase, MASS, OREstats,
# OREgraphics, OREeda, ORExml, ORE
library(ORE)
 
# Connect to Oracle RDBMS
# Change the connection information below
ore.connect(user = "<USERNAME>",
            sid = "<SID>",
            host = "<HOST>",
            password = "<PASSWORD>",
            port = PORTNUMBER, 
            all = TRUE)

For more information, see Connect to an Oracle Database.

To test that you can connect to the specified Oracle Database, type

ore.is.connected()

ore.is.connected returns TRUE if you are connected to the database, or FLASE if you are not connected.

After you set up Oracle Wallet, as described in Configure Oracle Wallet (Optional), you can connect as follows:

ore.connect(conn_string = "ore_wallet", all = TRUE)

ore_wallet is a connect string that has been registered with the Wallet.

As with all R commands, this code can be used during the initialization of an R session.

For more information on the initialization sequence of R on startup, type help(Startup) in the R Console.

Specify ore.connect in an embedded R function, otherwise all embedded R scripts automatically go to the same schema.

Start the Oracle R Enterprise Client on Linux

After the server is installed, you can launch the client.

Before you launch Oracle R Enterprise client, add these paths to the LD_LIBRARY_PATH environment variable:

  1. The path where Oracle Instant Client libraries are installed. Otherwise loading of ROracle package will fail.

  2. The path for the shared libraries libR.so, libRblas.so, and libRlapack.so from the installation of R 2.15.1 (or R 2.13.2 for earlier releases)

Start R 2.15.1 (or R 2.13.2 for earlier releases) from your favorite Linux shell. Next use ore.connect to connect to the Oracle Database where the server resides.

Launch the Oracle R Enterprise client by executing, after modifying the connection information (user, sid, host, password, and port), the following R code from the R Console:

# Load ORE packages and dependencies
# DBI, ROracle, OREbase, MASS, OREstats,
# OREgraphics, OREeda, ORExml, ORE
library(ORE)
 
# Connect to Oracle RDBMS
# Change the connection information below
ore.connect(user = "<USERNAME>",
            sid = "<SID>",
            host = "<HOST>",
            password = "<PASSWORD>",
            port = PORTNUMBER
            all = TRUE)
 

Your Oracle Database Administrator can provide you with suitable values for USERNAME, SID, HOST, PASSWORD, and PORT. These values provide connection information for the database.

For more information, see Connect to an Oracle Database.

After you set up Oracle Wallet, as described in Configure Oracle Wallet (Optional), you can connect as follows:

ore.connect(conn_string = "ore_wallet", all = TRUE)

ore_wallet is a connect string that has been registered with the Wallet.

As with all R commands, this code can be used during the initialization of an R session.

For information on the initialization sequence of R on startup, type help(Startup) in the R Console.

Connect to an Oracle Database

Oracle R Enterprise includes the following R functions that enable transparent access to Oracle Database tables and views:

Objects created by Oracle R Enterprise are identified with the ore prefix. Pick any object returned by ore.ls() and type either class(OBJECTNAME) or class(OBJECTNAME$COLUMN_NAME).

For example,

R> class(NARROW)
[1] "ore.frame"
attr(,"package")
[1] "OREbase"

The prefix ore is applied to the class names. This indicates that the object is an Oracle R Enterprise created object that holds metadata (instead of contents) of the corresponding object in Oracle Database.

Validate Oracle R Enterprise Installation

The purpose of validation is to ensure that you can connect to the database that has now been enabled with Oracle R Enterprise from R and successfully useOracle R Enterprise.

The exact same steps validate a server installation or a client installation.

After you complete the installation, follow these steps to validate it:

  1. Start R on a client. Load the Oracle R Enterprise Packages:

    R> library(ORE)
    
  2. Connect to the Oracle Database on the server. The exact command depends the details for the database to which you connect:

    R> ore.connect(user = "rquser", sid = "orcl", host = "localhost", password = "rquser", port = 1521, all = TRUE)
    

    In this command provide the values for user, sid, host, password, and port that are correct for your database. If you did not install the database, you may have to ask the DBA for these values.

    Alternatively if the database is on the same machine, use ore.connect in this way.

    ore.connect(“scott”, password=”tiger”, conn_string=””, all=TRUE)
    
  3. Run several Oracle R Enterprise demos. This command provides a list of available demos:

    R> demo(package = "ORE")
    

    These commands illustrate how to run specific demos:

    # Test the transparency layer
    R> demo("aggregate", package = "ORE")
    
    # Test embedded R:
    R> demo("row_apply", package = "ORE")
    

Control Memory Used by Embedded R

As system administrator, you can control the memory resources between R and other processes running on system. For example, a properly-set minimum memory bound allows R to have enough memory to run in a reasonable amount of time while a properly-set maximum number prevents R from holding too much memory unnecessarily or starving other processes.

This feature limits the amount of R heap memory (vector and cons in R's terminology) that is automatically managed by R's gc mechanism. The C-type memory that may be allocated via call Calloc, Realloc, calloc, and malloc is not controlled by this feature. Such C-type memory is mainly created to hold intermediate or temporary values for completing computation in an R function implemented in C. The C-type memory that may be allocated and released explicitly by function is not controlled by this feature. Under normal circumstances, the amount of such memory is usually of limited size and does not affect memory usage of R significantly.

Oracle R Enterprise 1.3 allows a DBA to control R memory usage by specifying minimum vector heap, maximum vector heap, minimum cons cells, and maximum cons cells using the sys.rqconfigset SQL procedure.

Use these commands to set minimum vector heap, maximum vector heap, minimum cons cells, and maximum cons cells

To set maximum vector heap memory and maximum cons cells to no limits,

exec sys.rqconfigset('MAX_VSIZE', NULL); exec sys.rqconfigset('MAX_NSIZE', NULL)

Upgrade Oracle R Enterprise

You can upgrade from any version of Oracle R Enterprise to the current version by reinstalling the product.

If you installed an earlier version of Oracle R Enterprise, you can upgrade to this release as follows:

Uninstall Oracle R Enterprise

You uninstall Uninstall Oracle R Enterprise by removing the packages and by running a script.

Uninstall Oracle R Enterprise Client

Follow these steps to uninstall Oracle R Enterprise client:

To remove the Oracle R Enterprise packages, start R and type these commands:

remove.packages("ORE")
remove.packages("ORExml")
remove.packages("OREeda")
remove.packages("OREgraphics")
remove.packages("OREstats")
remove.packages("OREbase")
remove.packages("ROracle")
remove.packages("DBI")
remove.packages("png")
remove.packages("OREdm")
remove.packages("OREpredict")

Uninstall Oracle R Enterprise Server

To uninstall Oracle R Enterprise server, execute

  • uninstall.sh (for Linux)

  • uninstall.bat (Windows)

Either script removes libraries installed in $ORACLE_HOME/lib and removes all installed SQL objects.