Forum Stats

  • 3,769,238 Users
  • 2,252,937 Discussions
  • 7,874,957 Comments

Discussions

open connection string

kaericn
kaericn Member Posts: 305 Blue Ribbon

Greeting Dear community.

What I have in my tnsnames.ora and verify it all works via sqlplus

CDB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdb1)
    )
  )


ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
YMQCTPRD =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ymsdbprd-scan)(PORT = 1522))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = YMQCTPRD)
    )
  )




YMQCTSUP =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ymsdbppr-scan)(PORT = 1522))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = YMQCTSUP_SRV)
    )

I am trying to get RJDBC to work so I can connect to Oracle from R doing some data analysis..

This connection string works for my local db which I have it running in my Virtual Box

con <- dbConnect(drv, "jdbc:oracle:thin:@//localhost:1521/orcl", "demo", "demo")

However, it does not work when I do it for the remote db that I really need to pull data from...

> con <- dbConnect(drv, "jdbc:oracle:thin:@//ymsdbppr-scan:1522/YMQCTPRD", "user_read", "user_read")
Error in .jcall([email protected], "Ljava/sql/Connection;", "connect", as.character(url)[1],  : 
  java.sql.SQLException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
Tagged:
aJohnykaericn

Best Answer

Answers

This discussion has been closed.