How can I access an Oracle database via ODBC from R without making the password public? How can I access an Oracle database via ODBC from R without making the password public? oracle oracle

How can I access an Oracle database via ODBC from R without making the password public?


Another possibility is to use an environment variable which your R scripts read via Sys.getenv() and then insert into the connection string.


Assuming this is from Windows, you can set up the DSN in the Data Sources to store the password information. Also you can allow the user to provide the details at runtime - if they are required by odbcConnect the authentication dialog from the Data Sources set up will come up.

Those options aren't very advanced and they require transferring your questions about security to the operating system, but might be helpful if you've not considered them already.


an update: you can use ROracle with Oracle Wallet (instructions). After installing ROracle and setting up the Oracle Wallet, you can connect using

con <- dbConnect(drv, username="", password="", dbname="MY_DB_NAME")

i.e. using empty strings as inputs to username and password

To INSTALL ROracle, you will need Oracle instant client and also sdk which you can find it here