Oracle® R Enterprise Installation and Administration Guide Release 1.3.1 for Windows, Linux, Solaris, and AIX E36763-17 |
|
|
PDF · Mobi · ePub |
This chapter explains how to establish and verify a working environment for Oracle R Enterprise after the software is installed. This chapter contains these topics:
After the installation of Oracle R Enterprise client and server is complete, the next step is to create at least one database user that is configured for Oracle R Enterprise.
The Oracle R Enterprise server
directory includes a script that you can run to create a sample user named RQUSER
. The script verifies the installation of Oracle Database and Oracle R Enterprise before creating the user. You can modify the script to create additional users.
To create a sample user for Oracle R Enterprise:
Verify that your operating system user ID is a member of the OSDBA group (DBA
on Linux and UNIX; ora_dba
on Windows). See Section 4.2.3.1 for details about OSDBA.
Navigate to the Oracle R Enterprise server
directory:
% cd download_directory/server
Run the demo_user
script:
-- Linux or UNIX % ./demo_user.sh -- Windows > demo_user.bat
The script prompts you to optionally enter the names of permanent and temporary tablespaces for the RQSYS
schema. The default tablespaces are SYSAUX
and TEMP
. To accept the defaults, press ENTER
.
Oracle R Enterprise users require a basic set of database privileges. Some users may require additional privileges, depending on the tasks they need to perform and the data they need to access.
To grant the basic privileges to RQUSER
, start SQL*Plus as sysdba and execute these GRANT
statements:
% sqlplus / AS SYSDBA SQL> GRANT CREATE TABLE TO RQUSER; SQL> GRANT CREATE PROCEDURE TO RQUSER; SQL> GRANT CREATE VIEW TO RQUSER; SQL> GRANT CREATE MINING MODEL TO RQUSER;
The Oracle R Enterprise server installation creates a database role called RQADMIN
. A user with the RQADMIN
role can create and drop R scripts that use the database embedded R engine. The RQADMIN
role is also required for executing embedded R.
To grant RQADMIN
to RQUSER
, start SQL*Plus as sysdba and execute this GRANT
statement:
% sqlplus / AS SYSDBA SQL> GRANT RQADMIN to RQUSER;
Note:
Use caution when granting theRQADMIN
role. Only users that require Oracle R Enterprise administrative privileges should have this role.To connect Oracle R Enterprise client to the database, start R using the ORE script:
% ORE R> library(ORE)
The following examples connect as user RQUSER
with password RQUSERpsw
:
For a remote database, specify the Oracle Database service identifier (SID), the host name, and the port for the connection.
R> ore.connect(user="RQUSER", sid="orcl", host="SVR3", password="RQUSERpsw", port=1521, all=TRUE)
Note:
To avoid specifying the password and other connection details in embedded R scripts, you can use Oracle Wallet. See "Creating an Oracle Wallet for an Oracle R Enterprise Connection".For a local database, specify the connection as follows:
R> ore.connect("RQUSER", password="RQUSERpsw", conn_string="", all=TRUE)
After connecting as described in Section 6.2, you can test some of the basic functionality of Oracle R Enterprise with these commands:
## Is the ORE client connected to the ORE server? ## The output of this command should be TRUE. R> ore.is.connected() ## List the available database tables R> ore.ls() ## Push an R dataframe to a database table R> cars <- ore.push(cars) R> head(cars) ## Run embedded RR> ore.doEval(function() { 123 })
You can further verify the success of the installation by running the Oracle R Enterprise demo scripts. If a script runs to completion without errors, then the example is successful.
The example scripts are located in $ORACLE_HOME/R/library/ORE/demo
.
This R command provides a list of available examples:
R> demo(package="ORE")
These commands run two of the examples before exiting R. The aggregate
script tests the use of an R function on data that is resident in database memory; the row_apply
script tests embedded R execution.
R> demo("aggregate", package="ORE") R> demo("row_apply", package="ORE") R> q()