Unable to connect to Oracle 12c pluggable database

Description

The Oracle 12c driver available from the extensions page (link from the 'type' section of the 'new datasource' page) does not appear to support pluggable databases. Attempting to create a connection results in this error:

Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

The error indicates that the driver is attempting to use a SID, which is not correct for connections to pluggable databases.

It's possible that this is a case of user error, but the prompts available don't provide any real guidance ('database' should really be 'service name', and a hint for the user name field to indicate what format to use ('sys'? 'sys@pluggable1'? 'sys@pluggable1 as sysdba'?) would be helpful

Environment

Linux (Centos 7), 4GB VirtualBox VM, fresh Lucee install

Activity

Show:
Tim Parker
October 4, 2016, 5:04 PM

still broken with fresh install of build 254 (actually... fresh install didn't appear to replace build 252 - after installing 254, I still had to run the update from within the Lucee server admin)

It appears that the code has not been updated to use service NAME instead of service ID - this change is required for connecting to pluggable databases - if your Oracle 12c installation isn't configured to use pluggable databases, you won't see any problems with the current driver code.

I'd be happy to do a screen-share with you - let me know your availability and we'll work something out.

Tim Parker
October 26, 2016, 9:47 PM

same problem with 5.1.0.34 - Oracle 12c does not use SIDs for pluggable databases

Umbrae Soulsbane
March 13, 2019, 4:51 PM
Edited

Just to keep this on the map. I am running into this same issue with 5.2.9.31. This is a major issue for us as we use a lot of Oracle Databases and this blocks us from upgrading to Lucee from ACF.

It must have something to do with Oracle and different configurations. I have one that works properly and one that gives the "ORA-12505, TNS:listener does not currently know of SID given in connect descriptor" error.

When I this up as a "Other - JDBC Driver (deprecated)" driver with the same information it works fine. Just cannot use the "Oracle 12c (Release 1)" for it without the error.

JDBC String that we use in ACF and works in Lucee is:

jdbc:macromedia:oracle://SERVER.URLORT;ServiceName=SID;ConnectionRetryCount=10;ConnectionRetryDelay=10

Mihai Manuta
August 21, 2020, 10:16 AM

This is still an issue and it appears from the 2 ways you can have the Oracle database configured: stand alone or RAC.

In stand alone (most common), the SID (Service ID) is used. In this case the JDBC connection string is jdbc:oracle:{drivertype}:@{host}:{port}:{database}

In RAC mode (real application cluster), the SERVICE_NAME is used as for a single service you can have multiple instances allocated (and those can go up and down, but you don’t care, you connect to a single service). In this case the JDBC connection string is jdbc:oracle:{drivertype}:@{host}:{port}/{database}

Mihai Manuta
August 21, 2020, 12:24 PM
Edited

I created PR: https://github.com/lucee/extension-jdbc-oracle/pull/1/files?diff=split&w=1 for this, it’s a crude fix but it does work.

Assignee

Michael Offner

Reporter

Tim Parker

Priority

Major

Labels

Fix versions

None

Affects versions

Configure