I am trying to establish a connection to an Oracle Database in RStudio (Version 2022.07.1 Build 554. Running on SUSE SLE15, SP4).
The connection should by established via an ldap-Server. Its address is in my ldap.ora file which is in /opt/instantclient_19/network/admin.
The code isql my_datasource does establish the connection.
Putting the following code in an R-file an executing via Rscript establishes the connection.
dbConnect(
odbc::odbc(),
dsn = "my_datasource",
UID = "***",
PWD = "***"
)
Trying to source the same script in RStudio (or RStudio Server) throws an error:
Error: nanodbc/nanodbc.cpp:1021: 00000: [Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve the connect identifier specified