Hi Developers, welcome to new article of ozanecare. this article i’ll write the queries to connect Rstudio with Oracle Database or R with Oracle Database. The First step we need to
create domain server name (DSN). After creating ,use the dsn inside odbcConnect .let’s see the queries.

Directly Test the below queries into rstudio.
#Install RODBC Package
install.packages(Rodbc)
# Load RODBC package
library(RODBC)
#Syntax For Connection
#Connection_Name <- odbcConnect("DSN", uid="User_Name", pwd="passwprd",believeNRows=FALSE)
# Example for Create a connection to the database called "conn1"
conn1 <- odbcConnect("HR_Test", uid="HR", pwd="hr",believeNRows=FALSE)
summary(conn1)
#To Run Oracle Database Table, use sqlQuery
sqlQuery(conn1,'SELECT * FROM HR.COUNTRIES')
# When finished, close the connection (optional)
odbcClose(channel)
Happy Queries…Thanks.