[R-sig-DB] Intermittent connectivity issues for RJDBC / Oracle
David
d@v|d @end|ng |rom @erend|p|ty@c|ence@com
Fri Oct 5 02:38:51 CEST 2012
Well as it is, I am already going against an Oracle database - so the
checks are already out the door. My issue is how to connect R that runs on
a different application server to connect to the Oracle instance on the
database server. I read Dennis' comment as using another type of driver to
connect to the Oracle DB. If you or he were referring to the R that Oracle
has embedded in the DB - that is definitely out of the question.
But if it is driver - to respond to Denis, I didn't use ROracle because it
didn't install correctly and I gave up. I just went through the process
again. I downloaded these files...
-rw-r--r-- 1 R ss 60331694 Oct 4 18:08
instantclient-basic-linux.x64-11.2.0.3.0.zip
-rw-r--r-- 1 R ss 641586 Oct 4 18:11
instantclient-sdk-linux.x64-11.2.0.3.0.zip
-rw-r--r-- 1 R ss 151972 Oct 4 18:05 ROracle_1.1-5.tar.gz
unzipped both to this dir:
R using ss-dev:/home/oracle/instantclient_11_2$ ls -al
total 182076
drwxr-xr-x 3 root root 4096 Oct 4 18:13 .
drwxrwxrwx 5 R ss 4096 Oct 4 18:13 ..
-rwxrwxr-x 1 root root 25308 Sep 17 2011 adrci
-rw-rw-r-- 1 root root 437 Sep 17 2011 BASIC_README
-rwxrwxr-x 1 root root 46228 Sep 17 2011 genezi
-rwxrwxr-x 1 root root 52761218 Sep 17 2011 libclntsh.so.11.1
-r-xr-xr-x 1 root root 7955322 Sep 17 2011 libnnz11.so
-rwxrwxr-x 1 root root 1971762 Sep 17 2011 libocci.so.11.1
-rwxrwxr-x 1 root root 118408281 Sep 17 2011 libociei.so
-r-xr-xr-x 1 root root 164836 Sep 17 2011 libocijdbc11.so
-r--r--r-- 1 root root 2095661 Sep 17 2011 ojdbc5.jar
-r--r--r-- 1 root root 2714016 Sep 17 2011 ojdbc6.jar
drwxrwxr-x 4 root root 4096 Sep 17 2011 sdk
-rwxrwxr-x 1 root root 191237 Sep 17 2011 uidrvci
-rw-rw-r-- 1 root root 66779 Sep 17 2011 xstreams.jar
and ran these commands...
root using ss-dev:/home/R/Downloads# export
OCI_LIB=/home/oracle/instantclient_11_2
root using ss-dev:/home/R/Downloads# export
LD_LIBRARY_PATH=/home/oracle/instantclient_11_2:$LD_LIBRARY_PATH
root using ss-dev:/home/R/Downloads# R CMD INSTALL ROracle_1.1-5.tar.gz
* installing to library �/usr/local/lib/R/site-library�
* installing *source* package �ROracle� ...
** package �ROracle� successfully unpacked and MD5 sums checked
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I/usr/share/R/include
-I/home/oracle/instantclient_11_2/sdk/include -fpic -O3 -pipe -g -c
rodbi.c -o rodbi.o
gcc -std=gnu99 -I/usr/share/R/include
-I/home/oracle/instantclient_11_2/sdk/include -fpic -O3 -pipe -g -c
rooci.c -o rooci.o
gcc -std=gnu99 -shared -o ROracle.so rodbi.o rooci.o
-L/home/oracle/instantclient_11_2 -lclntsh -L/usr/lib/R/lib -lR
/usr/bin/ld: cannot find -lclntsh
collect2: ld returned 1 exit status
make: *** [ROracle.so] Error 1
ERROR: compilation failed for package �ROracle�
* removing �/usr/local/lib/R/site-library/ROracle�
As root (thinking to avoid permission issues..) The OS is Ubuntu:
R using ss-dev:/home/oracle/instantclient_11_2$ uname -a
Linux ss-dev 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012
x86_64 x86_64 x86_64 GNU/Linux
Basically the same thing happened the first time around and I tried RJDBC
and it worked.. or seemed to work. The intermittent stuff I didn't really
notice until later. I am open to the ROracle driver if we can get it to
work.
Ideas on why it isn't installing correctly?
Thanks - David
On Thu, Oct 4, 2012 at 6:21 PM, Dirk Eddelbuettel <edd using debian.org> wrote:
>
> Denis,
>
> On 4 October 2012 at 14:07, Denis Mukhin wrote:
> | David,
> |
> | Have you considered using ROracle instead? It is also DBI based. ROracle
> uses native interfaces (OCI) so it should be much faster (although I have
> not run any comparisons). It is also actively maintained by Oracle so if
> you have any problems/concerns we should be able to address them fairly
> quickly.
>
> This is the second time this week you are pulling this stunt, and I
> formally
> object.
>
> If someone wants and need (R)Oracle, they will know where and how to get
> it,
> provided they also find their six-figure check.
>
> This is an open source mailing list, and I would like to ask you to stop
> your
> salesmanship here. The last post ("I don't know anything about
> RPostgreSQL,
> but this is what ROracle does") was borderline amusing, but this one is
> very
> clearly stepping over that line we all know.
>
> Stop it now, please.
>
> Dirk
>
>
> |
> | Denis
> |
> | -----Original Message-----
> | From: David [mailto:david using serendipityscience.com]
> | Sent: Thursday, October 04, 2012 4:45 PM
> | To: r-sig-db using r-project.org
> | Subject: [R-sig-DB] Intermittent connectivity issues for RJDBC / Oracle
> |
> | I will forward more details like versions of xyz when i can, but any
> thoughts on what I can focus on to debug the problem described below?
> |
> | Thank you, David
> | ---------- Forwarded message ----------
> | From: "dh_ss" <david using serendipityscience.com>
> | Date: Oct 4, 2012 1:29 AM
> | Subject: [R] Intermittent connectivity issues for JDBC / Oracle
> | To: <r-help using r-project.org>
> |
> | I have been experiencing issues with an R script hanging when connecting
> to an Oracle database. To help debug, I found a function here in the
> nabble forum and made a small test script:
> |
> | #!/usr/bin/Rscript --no-restore --no-save --no-init-file
> | library("RJDBC")
> | drv<-JDBC("oracle.jdbc.OracleDriver","/home/oracle/lib/ojdbc6.jar",
> "'")
> |
> | dbCheck = function(url, user='', pwd='') {
> | j = .jcall("java/sql/DriverManager", "Ljava/sql/Connection;",
> | "getConnection", url, user, pwd, check=FALSE)
> | x = .jgetEx()
> | .jcheck()
> | x
> | }
> | dbCheck("jdbc:oracle:thin:@192.168.3.10:1521
> :psrndpt1","myuser","mypass")
> |
> |
> | When I run the file - sometimes it works, returning NULL, and sometimes
> it hangs for between 1 and 2.5 minutes before throwing an error. The
> database is new and stable, on the same network - with no connection issues
> from any other clients. This machine isn't currently doing anything else
> except for running this script. Output from running it several times looks
> like this:
> |
> | R using ss-dev:~/scripts$ ./dbCheck.R
> | Loading required package: methods
> | Loading required package: DBI
> | Loading required package: rJava
> | NULL
> | R using ss-dev:~/scripts$ ./dbCheck.R
> | Loading required package: methods
> | Loading required package: DBI
> | Loading required package: rJava
> | NULL
> | R using ss-dev:~/scripts$ ./dbCheck.R
> | Loading required package: methods
> | Loading required package: DBI
> | Loading required package: rJava
> | NULL
> | R using ss-dev:~/scripts$ ./dbCheck.R
> | Loading required package: methods
> | Loading required package: DBI
> | Loading required package: rJava
> | NULL
> | R using ss-dev:~/scripts$ ./dbCheck.R
> | Loading required package: methods
> | Loading required package: DBI
> | Loading required package: rJava
> | NULL
> | R using ss-dev:~/scripts$ ./dbCheck.R
> | Loading required package: methods
> | Loading required package: DBI
> | Loading required package: rJava
> | NULL
> | R using ss-dev:~/scripts$ ./dbCheck.R
> | Loading required package: methods
> | Loading required package: DBI
> | Loading required package: rJava
> | Error in .jcall("java/sql/DriverManager", "Ljava/sql/Connection;",
> "getConnection", :
> | ignoring SIGPIPE signal
> | Calls: dbCheck -> .jcall -> .External
> | Execution halted
> | R using ss-dev:~/scripts$ ./dbCheck.R
> | Loading required package: methods
> | Loading required package: DBI
> | Loading required package: rJava
> | Error in .jcall("java/sql/DriverManager", "Ljava/sql/Connection;",
> "getConnection", :
> | ignoring SIGPIPE signal
> | Calls: dbCheck -> .jcall -> .External
> | Execution halted
> | R using ss-dev:~/scripts$ ./dbCheck.R
> | Loading required package: methods
> | Loading required package: DBI
> | Loading required package: rJava
> | NULL
> | R using ss-dev:~/scripts$ ./dbCheck.R
> | Loading required package: methods
> | Loading required package: DBI
> | Loading required package: rJava
> | Error in .jcall("java/sql/DriverManager", "Ljava/sql/Connection;",
> "getConnection", :
> | ignoring SIGPIPE signal
> | Calls: dbCheck -> .jcall -> .External
> | Execution halted
> |
> |
> | The times that it returns NULL, it returns immediately. When it throws
> the error, it is a varying amount of time between roughly 1 and 2.5 minutes.
> | Both machines are not busy at all.
> |
> | Any ideas would greatly appreciated. Thanks.
> |
> |
> |
> | --
> | View this message in context:
> |
> http://r.789695.n4.nabble.com/Intermittent-connectivity-issues-for-JDBC-Oracle-tp4644960.html
> | Sent from the R help mailing list archive at Nabble.com.
> |
> | ______________________________________________
> | R-help using r-project.org mailing list
> | https://stat.ethz.ch/mailman/listinfo/r-help
> | PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> | and provide commented, minimal, self-contained, reproducible code.
> |
> | [[alternative HTML version deleted]]
> |
> | _______________________________________________
> | R-sig-DB mailing list -- R Special Interest Group R-sig-DB using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-db
> |
> | _______________________________________________
> | R-sig-DB mailing list -- R Special Interest Group
> | R-sig-DB using r-project.org
> | https://stat.ethz.ch/mailman/listinfo/r-sig-db
>
> --
> Dirk Eddelbuettel | edd using debian.org | http://dirk.eddelbuettel.com
>
> _______________________________________________
> R-sig-DB mailing list -- R Special Interest Group
> R-sig-DB using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-db
>
[[alternative HTML version deleted]]
More information about the R-sig-DB
mailing list