[R-sig-DB] RODBC connection linux (ubuntu)

Marc Schwartz m@rc_@chw@rtz @end|ng |rom me@com
Fri Sep 7 16:20:36 CEST 2012


On Sep 7, 2012, at 8:26 AM, Luis Ridao <luridao using gmail.com> wrote:

> HI,
> 
> i think this problem has come up pretty often on this and other lists
> and still have not managed to solved it.
> 
> i need to connect to a an Oracle database through R.
> 
> I have installed the oracle install client and the package RODBC in R
> but still get the same error:
> 
> [RODBC] ERROR: state IM002, code 0, message [unixODBC][Driver Manager]Data
> source name not found, and no default driver specified
> 2: In odbcDriverConnect("DSN=MAGNUS;UID=my_uid;PWD=my_pwd") :
>  ODBC connection failed
> 
> /etc/odbc.ini looks like:
> 
> odbc.ini
> ---------------------------------------
> [ORACLE_SAMPLE]
> driver = Easysoft ODBC-Oracle WP
> description = Easysoft Oracle ODBC WP driver
> server = oserver
> port = 1521
> sid = 192.168.20.129/MAGNUS
> user = luisr
> password =my_pwd
> logging = No
> logfile =
> enable_user_catalog = yes
> enable_synonyms = yes
> metadata_dont_change_case = no
> metadata_dont_do_schema = no
> metadata_id = no
> limit_long = 0
> 
> i know i need another odbcinst.ini file
> but i don't know a stanza for it (i actually made the odbc.ini file above
> from some other source)
> 
> the unixODBC driver is also installed in my linux system
> 
> any ideas?
> 
> thanks in advance



The content above is unlikely to be correct, as the EasySoft ODBC driver for Oracle is rather expensive as I recall, so I would doubt that you are using it on Ubuntu. The errors above suggest that you have not configured the DNS connection properly.

In R use:

  vignette("RODBC")

which will bring up the package vignette, which has additional details on configuring the DNS settings.

As noted in the above document, if you have the Oracle client set up correctly, you should be able to login to the server from the command line. If you can, then that leaves RODBC related configuration issues to resolve. If you cannot, then you still have Oracle client related configuration issues and you may need assistance from your SysAdmin/DBAdmin.

Regards,

Marc Schwartz




More information about the R-sig-DB mailing list