3

There are a lot of examples how to connect to an Oracle DB using password authentication (i.e. user id + password) in R. However, I need to figure out to set up the connection using Windows authentication / a trusted connection in R for an Oracle DB.

Example

I saw a similar case for a MySQL DB where a connection string is specified containing trusted_connection=true which, if I understand correctly, indicates Windows authentication / a trusted conenction.

library(RODBC)
dbhandle <- odbcDriverConnect('driver={SQL Server};server=servername\\\\instancename,port;database=testing;trusted_connection=true')
res <- sqlQuery(dbhandle, 'select * from information_schema.tables')

1) How exactly would that look like for Oracle DB using the information below?

Additional info (maybe useful):

In the tsnames.ora config file I added the following database address, which works using MS Access.

DBNAME.XXX.COM =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = DBNAME.XXX.COM)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = DBNAME.XXX.COM)
    )
  )
Mark Heckmann
  • 10,943
  • 4
  • 56
  • 88
  • 1
    DId you google, "oracle connect windows authentication" because there are a zillion results. – OldProgrammer Jul 05 '17 at 15:58
  • Yes. But did not understand how to do it in r. That is BTW why I took the time to formulate this question in the first place... So any helpful advice? – Mark Heckmann Jul 05 '17 at 22:12
  • I assume that you want to authenticate remotely, correct? Oracle deprecated remote OS authentication as of 11g due to security concerns. Good discussion here with why that's an issue: https://dba.stackexchange.com/questions/299/why-is-os-authentication-considered-poor-security-for-oracle-databases – Kris Johnston Jul 06 '17 at 12:52
  • hhm, in our company I log into the Orcale DB via os authentication when I use MS Access. So I would assume that it should also be possible doing the same using R as well, or am I wrong there? – Mark Heckmann Jul 06 '17 at 15:32
  • @krisjohnston I want to log on over VPN. I am not sure if that would be remotely or not. – Mark Heckmann Jul 07 '17 at 11:31
  • If you are logging in over the network, that is considered remote (from one machine to another). – Kris Johnston Jul 07 '17 at 12:48

0 Answers0