Please refer to the official Oracle page for instructions on how to download and setup the driver: Oracle ODBC driver page
There are packages that either connect via ODBC but do not provide support for
DBI, or offer
DBI support but connect via JDBC. The
odbc package, in combination with a driver, satisfies both requirements.
Another package that provides both ODBC connectivity and
DBI support is
ROracle. The current version of
dbplyr in CRAN does not yet fully support a connection coming from
ROracle, but we are working on it.
There are five settings needed to make a connection:
- Driver - See the Drivers section for more setup information
- Host - A network path to the database server
- SVC - The name of the schema
- UID - The user’s network ID or server local account
- PWD - The account’s password
- Port - Should be set to 1521
con <- DBI::dbConnect(odbc::odbc(), Driver = "[your driver's name]", Host = "[your server's path]", SVC = "[your schema's name]", UID = rstudioapi::askForPassword("Database user"), PWD = rstudioapi::askForPassword("Database password"), Port = 1521)
This section will be updated as new issues are found, and when fixes are applied in the development version of the dbplyr package. The issue will be fully removed when the fix is part of of the package’s version in CRAN.
Retrieving the top records, in instances when
head()is used or when a tibble prints a preview of the dataset, only works with version 12c (Issue 2928)
RJDBC support - Even though it is not considered an issue, we have found a workaround. The approach is to point the current JDBC connection to the Oracle translation inside
sql_translate_env.JDBCConnection <- dbplyr:::sql_translate_env.Oracle sql_select.JDBCConnection <- dbplyr:::sql_select.Oracle sql_subquery.JDBCConnection <- dbplyr:::sql_subquery.Oracle
Please refer to the Issues section in
dplyr to find out the latest regarding bugs and resolutions.