[R-sig-DB] using DBI

Don MacQueen m@cq @end|ng |rom ||n|@gov
Fri Jan 12 19:43:20 CET 2007


I'm not particularly expert in making connections to Oracle ... but I 
do have a working connection and am able to run queries. So maybe I 
can help.

My standard connection script is this:

require(ROracle)
dbm <- Oracle()
con <- 
dbConnect(dbm,user='user',dbname='db.host.domain.name',password='password')

Where "db.host.domain.name" is an entry in my tnsnames.ora file. Do 
you have ORACLE_HOME correctly defined in the environment?

The standard port is 1521, as far as I know, and you have 1522 in 
your occi example. The port is defined in the tnsnames.ora file, and 
having the wrong port could explain the report of no listener.

-Don


At 1:05 PM -0500 1/12/07, Stephen Bond wrote:
>Yes I have that and
>drv=dbDriver("Oracle") executes without complaint.
>The platform is Solaris 10 on x86. I try
>
>conn=dbConnect(drv,user='user',password='password',dbname='dwsh.blabla.com')
>which fails complaining about no listener.
>
>the connect string that does the job using occi is:
>
>const string
>connectString="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(COMMUNITY=
>mplstcp)(PROTOCOL=TCP)(Host=dwsh.blabla.com)(Port=1522)))(CONNECT_DATA=(SID=dwsh)))";
>
>Could you pls suggest the syntax to call dbConnect?
>Thank you greatly
>
>
>Stephen C. Bond
>Queen's University
>
>On Thu, 11 Jan 2007, Don MacQueen wrote:
>
>>  First:
>>
>>  Have you successfully installed the ROracle package?
>>
>>  (Until you've done that, I don't think there's any point in trying to
>>  help with or answer the other questions.)
>>
>>  At some point you will have to tell people what platform you're
>>  running R on (see http://www.R-project.org/posting-guide.html), and
>>  you may get asked to provide commented, minimal, self-contained,
>>  reproducible code.
>>
>>  -Don
>>
>>  At 9:21 PM -0600 1/9/07, Stephen Bond wrote:
>>  >Dear DBI Maintainer,
>>  >
>>  >Please, help with the following connection: I need to connect to an
>>  >oracle database on HP Unix host.
>>  >I looked at the DBI.pdf which I am sure is very informative for the
>>  >competent readers but it is French to me.
>>  >I am not sure what is the difference between Oracle and ROracle drivers
>>  >and how to provide an IP address if that is at all possible.
>>  >Also, is there a need for special libs on the host as the DBI.pdf says
>>  >that the drivers need to be extended on the backend?
>>  >I know how to use SQL and conect from SAS or C++ using occi, but the R
>>  >DBI is a challenge.
>>  >Thank you very much
>>  >Stephen
>>  >
>>  >_______________________________________________
>>  >R-sig-DB mailing list -- R Special Interest Group
>>  >R-sig-DB using stat.math.ethz.ch
>>  >https://stat.ethz.ch/mailman/listinfo/r-sig-db
>>
>>
>>  --
>>  --------------------------------------
>>  Don MacQueen
>>  Environmental Protection Department
>>  Lawrence Livermore National Laboratory
>  > Livermore, CA, USA
>  > --------------------------------------
>  >


-- 
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA




More information about the R-sig-DB mailing list