How to Use R Language to Connect with an ORACLE Database
Method 1 of 5:
Instant Client + ODBC packages
- Choose your OS (Linux 32) here:http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
- Accept the License Agreement and agree to download:
-
- Instant Client Package - Basic
- Instant Client Package - ODBC
-
- Unzip both packages in the same directory. For example, /home/sven/instantclient_11_2
Method 2 of 5:
Unixodbc
- Download unixodbc from here: http://www.unixodbc.org/download.html.
- Install it.
Method 3 of 5:
Edit odbc.ini & odbcinst.ini
- Find the two .ini files. These are located in /etc/ (Ubuntu). Perhaps there are similar files in other locations; if so, it's recommended that you delete them.
- Add a new entry like this:
- For odbc.ini ...
- [ORACLE2]
- Driver = ORACLE2
- ServerName = 143.93.91.33:1521/xe
- UserID = your_username
- Password = xxx
- METADATA_ID = 0
- ENABLE_USER_CATALOG = 1
- ENABLE_SYNONYMS = 1
- For odbcinst.ini ...
- [ORACLE2]
- Description = oracle driver
- Driver = /home/sven/instantclient_11_2/libsqora.so.11.1
- DontDLClose = 1
- FileUsage = 1
- UsageCount = 1
- Notes: 'Driver' points at the file 'libsqora.so.11.1' in the Instant-client location.
Method 4 of 5:
Add to your path
- You may need to add 2 entries to your path (example):
- export OCI_LIB=/home/sven/instantclient_11_2
- export LD_LIBRARY_PATH=/home/sven/instantclient_11_2
- export OCI_LIB=/home/sven/instantclient_11_2

Method 5 of 5:
The R language
- Obtain a package called 'RODBC' in order to connect with the database. Download it here: http://cran.r-project.org/web/packages/RODBC/index.html
- Start R, switch to the location which contains the RODBC package and an enter the following R code:
- install.packages(packagename.tar.gz)
- After the package installation you can create a channel:
- ch=odbcConnect("ORACLE2")
- Check the channel with odbcGetInfo(ch)
- If the connection was successful, the console shows something like this:
- odbcGetInfo(ch)
- DBMS_Name DBMS_Ver Driver_ODBC_Ver
- "Oracle" "10.02.0010" "03.52"
- Data_Source_Name Driver_Name Driver_Ver
- "ORACLE2" "SQORA32.DLL" "11.02.0001"
- ODBC_Ver Server_Name
- "03.52" "143.93.91.33:1521/xe"
4.3 ★ | 3 Vote
You should read it
- Use Nautilus as FTP Client
- Instructions for registering V90 package is only 90k to receive the super 3-in-1 integration right away
- Package in Python
- How to check Internet package network FPT, VNPT, Viettel are using
- How to use winget - New Package Manager for Windows 10
- Learn about the ISA Firewall Client (Part 1)
- What is a package dependency in Linux?
- Exciting with World Cup MobiFone launched a great data package
May be interested
- Learn About Accent Oracle: AI That Can Predict Accents With Extreme Accuracyeven if you think your accent is too good to be detected, accent oracle can prove you wrong.
- Oracle improves MySQL on Windowsoracle has updated the commercial version of mysql database for windows, added a graphical installer and the ability to perform failover clustering, ...
- Instructions on how to connect to MySQL Database in Eclipseinstructions for connecting to mysql database in eclipse, helping you to connect to the mysql server database to manipulate data directly on the ide instead of using the mysql workbench tool
- Relational database management system RDBMS in SQLwhat is rdbms? rdbms stands for relational database management system. rdbms is the foundation for sql as well as for all other database systems such as ms sql server, ibm db2, oracle, mysql and microsoft access.
- eQuiz - Multiple choice test on ASPhere is a small test of asp web programming language, a total of 30 questions will be answered with no time to answer each sentence.
- Microsoft and Oracle, along with the 'matching swords' against Amazon in the cloud computing battlemicrosoft and oracle - the two giant service providers of the cloud computing market - recently said they have reached an important joint cooperation agreement.
- Processing data in Java in Oracleis oracle always the best tool or application to handle data? the answer lies inside what you do. typically, data is transformed through the data processing language, but it can also be transformed through processing strings or numbers.
- eQuiz - Multiple choice test on SQLthis is a small test of the sql database administration system, there will be 10 questions in total with no time for answering each sentence.
- How to Create a Windows Azure SQL Databasethis wikihow article show you how to create a windows azure sql database. also it shows you how to connect to database from your app. log in to your windows azure management portal.
- Oracle wants to turn Java EE into fully open sourcethis week, oracle announced plans to move java ee project management to an open source platform, like apache or eclipse.