8 Administrative Tasks for Oracle R Enterprise

This chapter describes administrative tasks for maintaining and optimizing Oracle R Enterprise. This chapter contains these topics:

8.1 Creating an Oracle Wallet for an Oracle R Enterprise Connection

An Oracle wallet is a password-protected container for storing security credentials in Oracle Database. Wallets provide a secure mechanism for specifying connection details in embedded R scripts.

To create a wallet for an Oracle R Enterprise connection: 

  1. Start Oracle Wallet Manager:

    • (Linux and UNIX) At the command line, enter owm.

    • (Windows) Select Start, Programs, Oracle-HOME_NAME, Integrated Management Tools, Wallet Manager.

  2. Follow the instructions in your Oracle Database documentation to create the wallet:

  3. Locate the connection string for the Oracle R Enterprise database in tnsnames.ora. For example:

    mydb_test =
          (DESCRIPTION =
             (ADDRESS =
                (PROTOCOL = TCP)
                (HOST = server23)
                (PORT = 1521)
             )
             (CONNECT_DATA = (sid=ORCL))
          )
    
  4. Specify the connection information in the wallet. Follow the instructions in the Oracle Database security documentation referenced in step 2.

  5. After you configure the wallet, you can connect to the Oracle R Enterprise server database by simply specifying the connection identifier. For example:

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

    To learn more about ore.connect, use the R help command:

    help(ore.connect)
    

8.2 Controlling Memory Used by Embedded R

You can control the memory used by embedded R execution by limiting the heap memory (vector and cons in R terminology) that is automatically managed by the R gc mechanism. To limit the size of heap memory in the database, use the sys.rqconfigset utility. The keyword arguments for sys.rqconfigset are described in Table 8-1.

Table 8-1 SYS.RQCONFIGSET Keyword Arguments

Keyword Default Description

MIN_VSIZE

32MB

Minimum R vector heap memory

MAX_VSIZE

4GB

Maximum R vector heap memory

MIN_NSIZE

1M

Minimum number of R cons cells

MAX_NSIZE

20M

Maximum number of R cons cells


Example 8-1 SQL Commands for Controlling Memory Used by Embedded R

-- Set the minimum R vector heap memory to 20MB
EXEC sys.rqconfigset('MIN_VSIZE', '20MB');

-- Set the maximum R vector heap memory to 100MB
EXEC sys.rqconfigset('MAX_VSIZE', '100MB')

-- Set the minimum number of R cons cells to 500x1024
EXEC sys.rqconfigset('MIN_NSIZE', '500K');

-- Set the maximum number of R cons cells to 10x10x1024
EXEC sys.rqconfigset('MAX_NSIZE', '10MB');

-- Set maximum vector heap memory and maximum cons cells to unlimited
EXEC sys.rqconfigset('MAX_VSIZE', NULL); 
EXEC sys.rqconfigset('MAX_NSIZE', NULL);

Note:

The sys.rqconfigset procedure does not control the C type memory that may be allocated by Calloc, Realloc, calloc, or malloc. Such C type memory is mainly created to hold temporary values used by R functions that are implemented in C. Under normal circumstances, C type memory is limited in size and does not significantly affect the memory usage of R.

The sys.rqconfigset procedure edits settings in a configuration table called sys.rq_config. You can view the contents of this table to verify various environment settings for Oracle R Enterprise. Among the settings stored in sys.rq_config are the memory limits for embedded R. If necessary, you can modify these memory limits, however in most cases you should not modify the values in sys.rq_config.

The following query shows sample values stored in sys.rq_config.

SQL> SELECT * FROM sys.rq_config;
 
NAME                      VALUE
------------------------- -----------------------------------------------------
R_HOME                    /usr/lib64/R
R_LIBS_USER               /dbhome_1/R/library
VERSION                   1.4
MIN_VSIZE                 32M
MAX_VSIZE                 4G
MIN_NSIZE                 2M
MAX_NSIZE                 20M
SUPP_LIB_PATH             /opt/freeware/lib

8.3 Upgrading Oracle R Enterprise

You can upgrade Oracle R Enterprise to the current release from any previous release by reinstalling the product.

Note on IBM AIX:

Upgrade from Oracle R Enterprise 1.1 is not supported on IBM AIX. To upgrade Oracle R Enterprise 1.1 on IBM AIX, first uninstall Oracle R Enterprise 1.1 (including R) and then download and install the later version.

To upgrade Oracle R Enterprise: 

  1. Ensure that you have the version of R that is required for the new version of Oracle R Enterprise. See Oracle R Enterprise Release Notes for the latest requirements.

    To install R, follow the instructions in Chapter 3, "Installing R for Oracle R Enterprise".

  2. To upgrade Oracle R Enterprise Server, follow the installation procedures. When the installation script detects an earlier version of Oracle R Enterprise, it asks if you want to upgrade. Answering No aborts the process; answering Yes starts the upgrade.

    See Chapter 4 for the Oracle R Enterprise Server installation instructions.

  3. To upgrade Oracle R Enterprise Client, re-install the client packages and supporting packages. You do not have to uninstall the current packages before installing the new packages.

    See Chapter 6 for the Oracle R Enterprise Client installation instructions.

8.4 Migrating Oracle R Enterprise Data

Oracle R Enterprise Server includes migration scripts that you can run to migrate the rqsys schema and Oracle R Enterprise user data from a source database to a target database. The source and target must have the same version of the database and of Oracle R Enterprise Server.

You can run the migration scripts on all the operating systems listed in Table 1-1, "Oracle R Enterprise Platform Requirements" except Windows.

To locate the scripts, navigate to the server directory and change to the migration subdirectory.

/oreserver_install_dir/server/migration

The migration subdirectory contains a README and the following subdirectories:

  • exp — contains the script ore_srcexport.pl for exporting rqsys and all Oracle R Enterprise user data to a dump file.

  • imp — contains the script ore_destimport.pl for importing rqsys and all Oracle R Enterprise user data from the dump file created by ore_screxport.pl.

  • oreuser — contains scripts for exporting and importing data for a specific Oracle R Enterprise user.

Instructions for running the migration scripts are provided in the README.

8.5 Uninstalling Oracle R Enterprise

To uninstall Oracle R Enterprise, follow the instructions in the following topics:

8.5.1 Uninstalling Oracle R Enterprise Server

An uninstall script is included with the Oracle R Enterprise Server files in the server directory. The script removes the libraries that were installed in $ORACLE_HOME/lib and drops all the database objects that were created by the Oracle R Enterprise Server installation.

The user that runs the uninstall script must satisfy the requirements specified in Section 4.2.3, "User Requirements".

On a Linux system, you could uninstall Oracle R Enterprise Server as follows:

cd download_path/server/
./uninstall.sh

8.5.2 Uninstalling Oracle R Enterprise Client

To uninstall the Oracle R Enterprise Client Packages and Supporting Packages, start R and type the commands listed in Example 8-2.

Example 8-2 R Commands for Uninstalling Oracle R Enterprise Packages

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

8.6 Uninstalling R

To uninstall R, follow the instructions in the following topics:

8.6.1 Uninstalling Oracle R Distribution on Windows

Uninstall Oracle R Distribution just as you would uninstall any other Windows program, using Programs and Features in Windows Control Panel.

8.6.2 Uninstalling Oracle R Distribution on Linux

To uninstall Oracle R Distribution on Linux, log in as root and execute these commands in this order. To uninstall a different version of R, replace 3.0.1 with the version number.

Example 8-3 Linux Commands for Uninstalling Oracle R Distribution

Execute these commands as root:

rpm -e R-3.0.1
rpm -e R-devel
rpm -e R-core
rpm -e libRmath-devel
rpm -e libRmath

8.6.3 Uninstalling Oracle R Distribution on Oracle Solaris

To uninstall Oracle R Distribution on Oracle Solaris, follow the instructions in the readme on the Oracle R Distribution download page on the Oracle Technology Network:

https://oss.oracle.com/ORD/

The Oracle R Distribution installation directory on Oracle Solaris includes an uninstall script. Log in as root and run the script as follows:

Example 8-4 Solaris Script for Uninstalling Oracle R Distribution

Execute this script as root:

./uninstall.sh

8.6.4 Uninstalling Oracle R Distribution on IBM AIX

To uninstall Oracle R Distribution on IBM AIX, follow the instructions in the readme on the Oracle R Distribution download page on the Oracle Technology Network:

https://oss.oracle.com/ORD/

Example 8-5 AIX Scripts for Uninstalling Oracle R Distribution

To uninstall all filesets, execute this script as root:

./installp -u ORD
    

To uninstall individual filesets, specify their names:

installp -u ORD.devel
installp -u ORD.core