I have been using DBI package to connect to an oracle database (instant client 12.2) using the following
con <- DBI::dbConnect(odbc::odbc(), dsn="name",uid="user",pass="pass"))
my odbc.ini file has an entry like:
[ODBC 32 bit Data Sources]
serverName=Oracle in instantclient_12_2 (32 bit)
[serverName]
Driver32=c:\instantclient_12_2\SQORA32.dll
Everything is great! However now i want to try connecting a different way using the sid, host, port, something like:
channel <- DBI::dbConnect(odbc::odbc(),
driver="Oracle in instantclient_12_2",
Host=server.name,
Port=portNum,
SVC=sid,
uid="user",
pwd="pass")
However i get an error
Error: nanodbc/nanodbc.cpp:1021: IM006: [Oracle][ODBC][Ora]ORA-12560: TNS:protocol adapter error
[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
I have read rstudio help on oracle and connecting to a database and the DBI::dbConnect help but i can't seem to figure out what i am doing wrong.
Any advice welcomed