Declaring multiple identical service in tnsnames.ora supported by oracle thin driver
Asked Answered
M

1

11

I've been trying to switch from the Oracle OCI driver to the thin driver, I got the thin driver to pickup my tnsnames.ora by adding -Doracle.net.tns_admin=/path to the command line.

However, our tnsnames.ora contains lines where multiple services are defined at once. They look like this:

NEWS2,NEWS,NEWSFX = (DESCRIPTION_LIST=...)

The OCI driver seems happy with this format, but the thin driver doesn't understand that those are 3 separate services NEWS2, NEWS and NEWSFX. Some painful debugging sessions have revealed that it thinks this is a single service named NEWS2,NEWS,NEWSFX.

Our DBA's are understandably not very keen on copy-pasting service descriptors left and right, and insist that we find a way to be able to declare different names for the same service descriptor without copy paste before switching from OCI to thin.

Is there a properly supported way to achieve this with the oracle thin driver?

PS: here's a post from a guy who is using that same feature, and also mentions that it is apparently undocumented: https://dbamarco.wordpress.com/2015/12/02/tnsnames-ora-secrets/

Militia answered 28/5, 2018 at 14:52 Comment(1)
Very good question. I saw this used in another department at work and wondered about the syntax...Papillary
S
1

As of now, JDBC Thin driver doesn't support this feature. This will be one of the enhancements that our team will be working on. Sorry for the inconvenience. The only way is to provide the URL for each of the aliases.

Smokedry answered 18/6, 2018 at 16:30 Comment(1)
Nice to know that this is going to be worked on. Is there any way I be notified when such a feature becomes available? It would be really convenient for our company to have a drop-in replacement for the OCI driver.Militia

© 2022 - 2024 — McMap. All rights reserved.