How can I connect to an Oracle database using the ROracle library?

219 views
Skip to first unread message

EDGAR LUIS CÁCERES ANGULO

unread,
Feb 8, 2018, 4:58:57 PM2/8/18
to shinyapps.io Users

setwd('PATH TO DOWNLOAD') # set to path of download (remember to escape slashes ie: c:\\users\\etc..) 
install.packages('ROracle_1.2-1.zip', repos = NULL) 
library("ROracle") 
drv <- dbDriver("Oracle")

host <- "##.#.#.###"
port <- ####
sid <- "######"
connect.string <- paste(
  "(DESCRIPTION=",
  "(ADDRESS=(PROTOCOL=tcp)(HOST=", host, ")(PORT=", port, "))",
  "(CONNECT_DATA=(SID=", sid, ")))", sep = "")
## Use username/password authentication.
con <- dbConnect(drv, username = "######", password = "#######",
                 dbname = connect.string)
I'm trying to connect an oracle database
I find the following error, please, some help or suggestion

> library(ROracle)
Error: package or namespace load failed for ‘ROracle’ in inDL(x, as.logical(local), as.logical(now), ...):
 unable to load shared object 'C:/Users/ECACERES/Documents/R/R-3.4.3/library/ROracle/libs/x64/ROracle.dll':
  LoadLibrary failure:  %1 no es una aplicación Win32 válida.


Joshua Spiewak

unread,
Feb 9, 2018, 11:16:33 AM2/9/18
to shinyapps.io Users
It isn't clear to me if you are having problems with just shinyapps.io, or locally as well.
But for shinyapps.io, you generally do not want to use setwd (see the Troubleshooting section of the documentation).
The section on accessing your local database is being updated this week, and I will be posting an announcement to the group, to recommend the use of the "odbc" package which makes the RStudio Professional Drivers available on shinyapps.io
If you must use "ROracle", you will likely need to open an issue or pull request in shinyapps-package-dependencies so that the Oracle client can be installed.
Reply all
Reply to author
Forward
0 new messages