[R] Implementing R through Oracle

elw at stderr.org elw at stderr.org
Tue Oct 30 20:11:54 CET 2007



> I have been looking for a statistical package that I can implement in 
> our application and I came across R. We run an n-Tier environment with 
> an Oracle 10g backend. Our design is to keep all business logic in the 
> backend. What I would like to do is call R from pl/sql. I noticed that 
> ROracle is designed to connect with and process from a client 
> perspective. I actually would be running in the database preparing the 
> data and then apply the statistics to the result set for additional 
> information. Then I would take the results from R and apply additional 
> processing. Has anyone done this? Thanks.

So you want to:

1) process your data, mostly inside of oracle, and are going to store it
    there: either in some kind of table or some kind of view

2) you want to query the data out of oracle and into R objects, probably
    using SELECT and storing the resultset...

3) INSERT the results of R's statistical computations back into Oracle,
    probably into something like a temporary table, and then do further
    manipulation within Oracle based on those results

It sounds to me like ROracle is just what you want.  I've done the above 
series of things before - fairly trivially, mostly by cribbing from the 
examples in the help() for ROracle.

To be very honest getting your environment set up correctly (e.g. 
functioning oracle client libraries and ROracle extension) is the most 
difficult piece.  [I did it without having touched Oracle in the last six 
years or so, and had to work around some bugs in the installation that 10g 
dropped on the disk -- it wasn't all quite ready to go, yet.  Hopefully 
that has changed since then.]

I'd love a status report on the current condition of the R->Oracle 
connectivity, once you get it going at your site: people occasionally ask 
me about it, and it isn't something that I need to do often.

--elijah



More information about the R-help mailing list