Pages: [1]
  Print  
Author Topic: Choosing a schema in Oracle via DatabaseExampleSource  (Read 2703 times)
tom73
Guest
« on: January 22, 2009, 10:20:13 AM »

Hi,

first of all, i am a totally rookie regarding rapid miner but it seems to be a very good dm software...
Anyway, for my work it is absolutely necessary to connect to oracle databases. In my specific exampel, the connection to database works (testing via wizard), but the tables are missing. I assume  that the defalut connection uese the db schema of the user.So, how can i change to another database schema?
Do you have any advices

Thanks in advance

Thomas
Logged
homburg
Administrator
Jr. Member
*****
Posts: 95


« Reply #1 on: January 22, 2009, 03:54:30 PM »

Hi Thomas.

The Oracle database usually holds a schema for every user, defining that users privileges and view of the underlying data structure. In order to receive information from a certain table it should be sufficient to select an appropriate user or alter the users database schema in a way, that it grants acces to the table (respectively constructs it). This can be done i.e. by using the Portal Navigator software from Oracle.

Best regards,
   Helge Homburg
Logged

Please add [SOLVED] to the topic title when your problem has been solved! (do so by editing the first post in the thread and modifying the title)
Please click here before posting.
Tom73
Guest
« Reply #2 on: January 22, 2009, 09:13:40 PM »

Hello Helge,

thanks for your quick response. Of course, the db provides for every user an own schema. But in our company the policy for our datawarehouse database is to give every person his own (read-only) user (plus empty schema) whereas the tables are hold in schemas of artifical users (like ETL-Job user).  So selecting an apprpriate user is no choice.
Altering the users database schema sounds like an option which won't work as well from the philosophy of  (our) company. Isn't there any solution to change to another schema like for office/odbc or straight oracle/sql? This way would really help for acceptance at our company.

Cheers
Thomas
Logged
keith
Full Member
***
Posts: 160


« Reply #3 on: January 23, 2009, 09:38:33 PM »

I'm a little unclear on what you're asking, but let me offer a few ideas:

First, the wizard may not let you select tables not in your own schema, but you can still write SQL queries directly that do.  Try entering this in the query text field:

SELECT * FROM OtherSchema.MyTable

I haven't tested this, but I think if you issue the following commands in an Oracle session:

ALTER SESSION SET CURRENT_SCHEMA = <OtherSchema>
SELECT * FROM MyTable

It should change the default schema to OtherSchema temporarily (i.e. just for the duration of this connection), and thus the SELECT statement would point to the table you want.

Unfortunately, it looks like RM doesn't allow for issuing multiple SQL statements in sequence inside one operator, nor for allowing SQL statements that don't return a result set. 

I thought about chaining two database operators together.  But I think that two consecutive database operators would open separate database connections, so even if you could issue an ALTER SESSION with the first operator (and have it not return with an error), the effect would be lost by the time the 2nd operator was executed.

If I'm correct about the statements above, and someone from Rapid-I is listening, it would be nice to enhance one of the existing Database operators to (a) allow multiple SQL statements to be issued as part of a single operator, with the last result set returned taken to the be the example set, and/or (b) have an option for a database operator to ignore the fact that a result set might not be returned (this would allow arbitrary SQL commands to be sent to the database server without generating an error).
« Last Edit: January 24, 2009, 06:12:45 PM by keith » Logged
Sebastian Land
Administrator
Hero Member
*****
Posts: 2426


« Reply #4 on: January 24, 2009, 11:34:43 AM »

Hi guys,
we will check if thats possible using the JDBC driver and possibly include it in one of our future releases.

Greetings,
  Sebastian
Logged
tom73
Guest
« Reply #5 on: January 27, 2009, 09:56:04 AM »

Hi,

tanks keith. I used now directly the operator DatabaseExampleSource (using the wizard to get the notation of the databse_url only) and inserted a query with data from an other schema. Works quite well.  Smiley
In this case it did not need to use  the alter-statement (which wouldn't work in the a second oracle session (seelct-statement) at least today)

Greetings from a new convinced rm-user
Thomas
Logged
Sebastian Land
Administrator
Hero Member
*****
Posts: 2426


« Reply #6 on: February 24, 2009, 06:58:47 PM »

Hi,
as a late reply: RapidMiner did already support arbitrary SQL statements by the operator SQLExecution.

Greetings,
  Sebastian
Logged
Pages: [1]
  Print  
 
Jump to: