What is the database connection URL for Oracle RAC?

This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal.

We want to use format like below to connect to Oracle RAC.

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac-scan-12c.ouhk.edu.hk)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=S90UAT2.world)))

However, it said "Invalid Database connection details. Database connection url is not in proper format." Any suggestions?

Hi Gregory,

JDBC URL form for Oracle DB:

Syntax: jdbc:oracle:<drivertype>:@<database>

The following example connects to your database

"jdbc:oracle:thin:@rac-scan-12c.ouhk.edu.hk:1521:world"

Please check with the above URL.

Hi,

I've tried this format. But, it won't work unless I forced to use one of the instances.

e.g. we have 3 node RAC. It works only if I use "jdbc:oracle:thin:@rac-scan-12c.ouhk.edu.hk:1521:S90UAT22" <- note the last digit refers to a specific RAC node.

Hi Gregory,

Did you check with below URL

"jdbc:oracle:thin:@rac-scan-12c.ouhk.edu.hk:1521:S90UAT2"

Hi,

Results of running "jdbc:oracle:thin:@rac-scan-12c.ouhk.edu.hk:1521:S90UAT2"

Invalid Database connection details. Failed to connect jdbc:oracle:thin:@rac-scan-12c.ouhk.edu.hk:1521:S90UAT2​

Hi Gregory,

Service Name is alias to an INSTANCE (or many instances). The main purpose of this is if you are running a cluster, the client can say "connect me to SALES.abc.com", the DBA can on the fly change the number of instances which are available to SALES.abc.com requests, or even move SALES.abc.com to a completely different database without the client needing to change any settings.

You can use the below format.

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=OFF)(FAILOVER=ON)

(ADDRESS=(PROTOCOL=TCP)(HOST=rac-scan-12c.ouhk.edu.hk)(PORT=1521))

(ADDRESS=(PROTOCOL=TCP)(HOST=rac-scan-12c.ouhk.edu.hk)(PORT=1521)))

(CONNECT_DATA=(SERVICE_NAME=S90UAT2.world)(SERVER=DEDICATED)))

If you still face any issue, please copy the tnsentries from your tnsnames.ora or check with your DBA.

Hi,

I've tried this format before

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=OFF)(FAILOVER=ON)

(ADDRESS=(PROTOCOL=TCP)(HOST=rac-scan-12c.ouhk.edu.hk)(PORT=1521)))

(CONNECT_DATA=(SERVICE_NAME=S90UAT2.world)(SERVER=DEDICATED)))

MobileFabric returned:

"Invalid Database connection details. Database connection url is not in proper format.​"

Hi,

Can you please check the tnsentries from your tnsnames.ora or check with your DBA.

Below is the syntax.

jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(FAILOVER=on)(ADDRESS =(PROTOCOL=TCP)(HOST=scan-alias)(PORT = 1521))(CONNECT_DATA=(SERVICE_NAME=servicename)))

Hi,

Actually, I've copy and pasted my tns connection string before and it does not work.

jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan-12c.ouhk.edu.hk)(PORT = 1521))(LOAD_BALANCE = on)(FAILOVER = on)(CONNECT_DATA = (SERVICE_NAME = S90UAT2.world)(FAILOVER_MODE = (TYPE = SELECT)(METHOD = BASIC)(RETRIES = 20)(DELAY = 1))))

I received

"Invalid Database connection details. Database connection url is not in proper format."​