Windows 环境下安装 Oracle R Enterprise(ORE) 1.5.1 笔记

一、安装ORE的步骤

下面的安装步骤和安装路线图说明了典型的 ORE安装。

注:OREServer安装包中的脚本可以安装支持包和创建数据库用户。

 

ORE安装路线图

路线图提供了安装和配置ORE的典型步骤。

ORE的安装步骤如下:

1.  验证系统是否符合基本要求

2.  获取正确的安装软件

3.  执行和验证安装


二、安装Oracle 11.2.0.4

ORE 1.5.1 至少要求Oracle 11.2.0.4。

1、安装:过程从略。

2、创建数据库,本例为 CymcoBI(可选,如果没有数据库实例,则需要先创建数据库)

小提示:如果已经有多个数据库实例,则应注意Windows注册表中HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\KEY_Oracle11g的 ORACLE_SID 项值,后续的ORE 服务器端的脚本过程中使用的 ORACLE_SID与之对应。如果此项注册表值不是预期的数据库实例,可以双击该项进行更改。

此外,也可以通过在Windows环境变量中指定ORACLE_SID

 

 

3、执行SQL语句创建表空间和用户(可选)

CREATE TABLESPACE rqsys DATAFILE 'C:\oracle\oradata\CymcoBI\rqsys01.dbf' size 2000m;
CREATE USER ruser IDENTIFIED BY ruser;

注:(1)如果不创建表空间,可以使用 SYSAUX;

(2)如果不创建用户,在ORE Server安装过程中会提示用户输入用户名和密码(以及此用户的永久和临时表空间),并自动创建。


三、安装R

推荐安装Oracle R Distribution。

到Oracle官方网站下载ORD-3.3.0-win.zip,双击压缩包内的R-3.3.0-win.exe 执行安装,安装过程中注意不能使用默认的安装路径“C:\Program Files\R\R-3.3.0”,而应指定没有空格符的路径,例如“C:\R\R-3.3.0”,否则在后面执行安装 ORE Server的脚本过程中会出错而无法安装。

  

四、安装Oracle R EnterpriseServer和支持包

1、到Oracle官方网站下载下列文件

ore-server-win-x86_64-1.5.1.zip

ore-supporting-win-x86_64-1.5.1.zip

2、把这两个压缩包解压到同一路径下,形成下列结构(这样在安装ORE Server时会同时安装支持包)

 

 注:上述截图中*.log文件是安装(卸载)过程中形成的日志文件,如果没有执行过安装(卸载),则这些文件不会出现。

3、在CMD窗口中执行 server.bat 进行安装(绿色背景部分需要人工输入)

 

E:\Downloads\ORE\ore-server-win-x86_64-1.5.1>server.bat

 

Oracle R Enterprise 1.5.1 Server.

 

Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rightsreserved.

 

找不到E:\Downloads\ORE\ore-server-win-x86_64-1.5.1\tmp*.sql

Checkingplatform .................. Pass

CheckingR ......................... Pass

CheckingR libraries ............... Pass

CheckingORACLE_HOME ............... Pass

CheckingORACLE_SID ................ Pass

Checkingsqlplus ................... Pass

CheckingORACLE instance ........... Pass

CheckingCDB/PDB ................... Pass

CheckingORE ....................... Pass

 

Choosing RQSYS tablespaces

  PERMANENT tablespace to use for RQSYS [list]:RQSYS

  TEMPORARY tablespace to use for RQSYS [list]:TEMP

 

Choosing ORE user

  ORE user to use [list]: ruser

 

Current configuration

  R Version ........................ OracleDistribution of R version 3.3.0 (2016-05-03)

  R_HOME........................... C:\R\R-3.3.0

  R_LIBS_USER ......................C:\oracle\product\11.2.0\dbhome_1\R\library

 

  ORACLE_HOME ...................... C:\oracle\product\11.2.0\dbhome_1

  ORACLE_SID ....................... CymcoBI

 

  Existing R Version............... None

  Existing R_HOME .................. None

  Existing ORE data ................ None

  Existing ORE code ................ None

  Existing ORE libraries ........... None

 

  RQSYS PERMANENT tablespace....... RQSYS

  RQSYS TEMPORARY tablespace ....... TEMP

 

  ORE user type.................... Existing

  ORE user name .................... RUSER

  ORE user PERMANENT tablespace .... USERS

  ORE user TEMPORARY tablespace .... TEMP

  Grant RQADMIN role ............... No

 

  Operation........................ Install/Upgrade/Setup

 

Proceed? [yes] y

 

Removing R libraries ............... Pass

InstallingR libraries ............. Pass

InstallingORE libraries ........... Pass

InstallingRQSYS data .............. Pass

ConfiguringORE .................... Pass

InstallingRQSYS code .............. Pass

InstallingORE packages ............ Pass

CreatingORE script ................ Pass

Installingmigration scripts ....... Pass

Installingsupporting packages ..... Pass

GrantingORE privileges ............ Pass

 

Done

 

4、检查server.bat 所在路径中的下列日志文件中是否存在错误(验证安装)

rqproc.log

rqconfig.log

rqgrant.log

 

五、客户端安装

1、安装Oracle Database Instant Client(安装过程从略)

2、安装Oracle R Distribution(安装过程上面已述,略)

3、安装ORE 支持包

将支持包中解压缩后的下列文件,在RGui 中通过安装本地包功能执行安装。

4、安装ORE Client 包

到官方网站下载ore-client-win-x86_64-1.5.1.zip,解压缩,在RGui 中通过安装本地包功能执行安装。


 

六、关于R用户赋权

1、ORE Server安装脚本会为用户自动设置支持ORE的相关权限。如果需要人工指定,则可以执行下列SQL语句:

GRANT CREATE TABLE TO RUSER;
GRANT CREATE PROCEDURE TO RUSER;
GRANT CREATE VIEW TO RUSER;
GRANT CREATE MINING MODEL TO RUSER;
GRANT CREATE SESSION TO RUSER;


2、关于RQADMIN用户角色

OREServer安装脚本会创建一个RQADMIN用户角色,此角色有权限创建和移除嵌入式R执行中的R 脚本。默认情况下,此安装脚本不授予RQADMIN给ORE 用户。如果需要指定此角色,则执行下列SQL语句即可:

GRANT RQADMIN to RUSER;


七、安装验证

1、在RGui中执行下列代码

> library(ORE)

Loadingrequired package: OREbase

Loadingrequired package: OREcommon

 

Attaching package: ‘OREbase’

 

Thefollowing objects are masked from ‘package:base’:

 

    cbind, data.frame, eval, interaction,order, paste, pmax, pmin,

    rbind, table

 

Loading required package: OREembed

Loadingrequired package: OREstats

Loadingrequired package: OREgraphics

 

Attaching package: ‘OREgraphics’

 

Thefollowing object is masked from ‘package:grDevices’:

 

    xy.coords

 

Loading required package: OREeda

Loadingrequired package: OREmodels

Loadingrequired package: OREdm

Loadingrequired package: OREpredict

Loadingrequired package: ORExml

> ore.connect(user="RUSER",sid="CymcoBI", host="127.0.0.1",password="ruser",port=1521, all=TRUE)

> ore.is.connected()

[1]TRUE

> ore.ls()

character(0)

> demo(package="ORE")

 

 >demo("aggregate",package="ORE")

(输出部分略)

>demo("row_apply",package="ORE")

(输出部分略)

 

 

八、故障排除2例

1、在安装完成后,执行演示程序时遇到找不到“OREserver”R包错误的处理:

 

> demo("stepwise")

 

 

        demo(stepwise)

        ---- ~~~~~~~~

 

Type  <Return>   to start :

 

>#

>#     O R A C L E  R  E NT E R P R I S E  S A M P L E   L I B R A R Y

>#

>#     Name: stepwise.R

>#     Description: STEPWISE MultivariateRegression

>#

>#

>#

>

>## Set page width

>options(width = 80)

 

># Push the built-in iris data frame to the database

>IRIS_TABLE <- ore.push(iris)

 

># Display the class of IRIS_TABLE

>class(IRIS_TABLE)

[1]"ore.frame"

attr(,"package")

[1]"OREbase"

 

># Let us first project out the non numeric columns

>IRIS_TABLE = IRIS_TABLE[, c("Sepal.Length", "Sepal.Width",

+                            "Petal.Length", "Petal.Width")]

 

># Predict Sepal.Length based on the other 3 numeric columns

># Do it stepwise

>model = ore.lm(Sepal.Length ~ ., data = IRIS_TABLE)

Error in .oci.GetQuery(conn, statement,data = data, prefetch = prefetch,  :

 Error in try({ : ORA-20000: RQuery error

Error in loadNamespace(name) : there isno package called 'OREserver'

ORA-06512: "RQSYS.RQEVALIMPL", line 104

ORA-06512: "RQSYS.RQEVALIMPL", line 101

 

故障排除:

经检查,在C:\oracle\product\11.2.0\dbhome_1\R\library文件夹中没有找到OREserver文件夹,尝试从ORE Server安装包中将 OREserver_1.5.1.zip中的文件人工解压到此文件夹下,然后再次执行此命令,发现原错误已经消失,代之为新错误。最后在重新安装ORE Server后,上述故障全部消除。

结论:ORE Server的安装脚本并不能确保R包都正确安装。在遇到此错误时,推荐重新安装来解决问题。类似地,如果客户端因R包未安装成功导致错误时,重新安装这些R包即可。

注:在安装脚本中,R包的安装命令为%RCMD% --vanilla CMD INSTALL--library="%ORE_LIBS_USER%" !pkg! > outr.log 2>&1

 

> demo("stepwise")

 

 

        demo(stepwise)

        ---- ~~~~~~~~

 

Type  <Return>   to start :

 

>#

>#     O R A C L E  R  E NT E R P R I S E  S A M P L E   L I B R A R Y

>#

>#     Name: stepwise.R

>#     Description: STEPWISE MultivariateRegression

>#

>#

>#

>

>## Set page width

>options(width = 80)

 

># Push the built-in iris data frame to the database

>IRIS_TABLE <- ore.push(iris)

 

># Display the class of IRIS_TABLE

>class(IRIS_TABLE)

[1]"ore.frame"

attr(,"package")

[1]"OREbase"

 

># Let us first project out the non numeric columns

>IRIS_TABLE = IRIS_TABLE[, c("Sepal.Length", "Sepal.Width",

+                            "Petal.Length", "Petal.Width")]

 

># Predict Sepal.Length based on the other 3 numeric columns

># Do it stepwise

>model = ore.lm(Sepal.Length ~ ., data = IRIS_TABLE)

Error in .oci.GetQuery(conn, statement,data = data, prefetch = prefetch,  :

 ORA-20000: RQuery error

Error in structure(.Internal(La_qr(x)),useLAPACK = TRUE, class = "qr") :

 LAPACK routines cannot be loaded

ORA-06512: "RQSYS.RQROWEVALIMPL", line121

ORA-06512: "RQSYS.RQROWEVALIMPL", line118

 

 

2、在安装完成后,执行演示程序时遇到“ORA-01950: 对表空间'USERS' 无权限”错误的处理

> demo("aggregate",package="ORE")

 

 

        demo(aggregate)

        ---- ~~~~~~~~~

 

Type  <Return>   to start :

 

>#

>#     O R A C L E  R  E NT E R P R I S E  S A M P L E   L I B R A R Y

>#

>#     Name: aggregate.R

>#     Description: Demonstratesaggregations

>#     See also summary.R

>#

>#

>#

>

>## Set page width

>options(width = 80)

 

># Push the built-in iris data frame to the database

>IRIS_TABLE <- ore.push(iris)

Error in .oci.WriteTable(conn, name,value, row.names = row.names, overwrite = overwrite,  :

 Error in .oci.GetQuery(con, stmt, data = value) :

 ORA-01950: 对表空间 'USERS' 无权限

 

故障排除:

执行下列SQL语句后,演示程序即可正常运行:

alter user ruser quota unlimited on users;

 

 

九、关于卸载ORE  Server

1、部分卸载

部分卸载是从数据库中删除RQSYS 元数据和 PL/SQL 包,但是保留Oracle主目录中支持Oracle R Enterprise 的库和R包。在CMD窗口中执行批处理命令即可:

server.bat -u

 

2、完全卸载

完全卸载是删除 Oracle 主目录中的库和R包,并从数据库中删除  RQSYS 元数据和PL/SQL代码。在CMD窗口中执行批处理命令即可:

server.bat -u --full

注:执行完全卸载后,如果需要再次安装ORE Server,通常先需要重新安装Oracle R Distribution,然后再安装ORE Server。

 

 

已标记关键词 清除标记
相关推荐
Data Science Using Oracle Data Miner and Oracle R Enterprise: Transform Your Business Systems into an Analytical Powerhouse English | 8 Feb. 2017 | ISBN: 1484226135 | 289 Pages | PDF | 12.99 MB Automate the predictive analytics process using Oracle Data Miner and Oracle R Enterprise. This book talks about how both these technologies can provide a framework for in-database predictive analytics. You'll see a unified architecture and embedded workflow to automate various analytics steps such as data preprocessing, model creation, and storing final model output to tables. You'll take a deep dive into various statistical models commonly used in businesses and how they can be automated for predictive analytics using various SQL, PLSQL, ORE, ODM, and native R packages. You'll get to know various options available in the ODM workflow for driving automation. Also, you'll get an understanding of various ways to integrate ODM packages, ORE, and native R packages using PLSQL for automating the processes. Data Science Automation Using Oracle Data Miner and Oracle R Enterprise starts with an introduction to business analytics, covering why automation is necessary and the level of complexity in automation at each analytic stage. Then, it focuses on how predictive analytics can be automated by using Oracle Data Miner and Oracle R Enterprise. Also, it explains when and why ODM and ORE are to be used together for automation. The subsequent chapters detail various statistical processes used for predictive analytics such as calculating attribute importance, clustering methods, regression analysis, classification techniques, ensemble models, and neural networks. In these chapters you will also get to understand the automation processes for each of these statistical processes using ODM and ORE along with their application in a real-life business use case. What you'll learn Discover the functionality of Oracle Data Miner and Oracle R Enterprise Gain methods to perform in-database predictive analytics Use Oracle's SQL and PLSQL APIs for building analytical solutions Acquire knowledge of common and widely-used business statistical analysis techniques Who this book is for IT executives, BI architects, Oracle architects and developers, R users and statisticians.
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页