Use case
For the purpose of HA (high availability) in some environments it makes sense to have Oracle ODBC connections with scan listener/service name, and not a single instance name
Problem
When creating a conneciton, you fill in the fields for Host, Port, and Service. The URL is generated like below:
jdbc:oracle:thin:@my.host.name:1521:MYSERVICE
Note the final ":" between the Port and Service. When testing you will likely get something like "TNSlistener does not currently know of SID" error. If you change the Service to the actual Instance name of "MYINSTANCE" instead of "MYSERVICE", the connection works but this defeats the entire point of HA
Solution
Use the following URL connection string format, and leave Host, Port and Service fileds blank:
jdbc:oracle:thin:@my.host.name:1521/MYSERVICE
Note the final "/" between Port and Service. The "/" tells Oracle that the next parameter will be a Service Name. The ":" instead told Oracle that the next parameter was going to be an Instance name, and since it was not an Instance name Oracle threw an error.
_________
Ref. case #01479210
Recommended Comments
There are no comments to display.