Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Currently I have...

url=
"
  jdbc:oracle:thin:@
    (
    DESCRIPTION=
      (
      ADDRESS_LIST=
        (LOAD_BALANCE=OFF)
        (FAILOVER=ON)
        (
        ADDRESS=
          (PROTOCOL=TCP)
          (HOST=10.0.0.6)
          (PORT=1521)
        )
        (
        ADDRESS=
          (PROTOCOL=TCP)
          (HOST=10.0.0.7)
          (PORT=1521)
        )
      )
      (
      CONNECT_DATA=
        (SERVICE_NAME=mySID.nowhere.org)
        (SERVER=DEDICATED)
      )
     )
"
share|improve this question
    
And... what? What's the problem you are experiencing? More details, please. –  Kerri Shotts Jul 14 '11 at 21:09
    
Did you already check "Data Sources and URLs" from Oracle (download.oracle.com/docs/cd/B28359_01/java.111/b31224/urls.htm)? –  MicSim Jul 15 '11 at 17:20

1 Answer 1

You don't setup Fast-Start Failover in the URL. It's something that you setup on the data source using the setFastConnectionFailoverEnabled(true) function call.

Per here

An application enables Fast Connection Failover by calling setFastConnectionFailoverEnabled(true) on a DataSource instance, before retrieving any connections from that instance.

You cannot enable Fast Connection Failover when reinitializing a connection cache. You must enable it before using the OracleDataSource instance.

For example

    ods = new OracleDataSource();
    ...
    ods.setFastConnectionFailoverEnabled(true);

Also, it mentions:

FAST CONNECTION FAILOVER PREREQUISITES

1.) The implicit connection cache is enabled. Fast Connection Failover works in conjunction with the JDBC connection caching mechanism. This helps applications manage connections to ensure high availability.

2.) The application uses service names to connect to the database; the application cannot use service IDs (ORACLE_SID). Use a service name rather than an SID when setting the OracleDataSource url property.

3.) The underlying database has Release 10 (10.1) or Release 10 (10.2) Real Application Clusters (RAC) capability. If failover events are not propagated, connection failover cannot occur.

4.) Oracle Notification Service (ONS) is configured and available on the node where JDBC is running and on the Oracle RAC. JDBC depends on ONS to propagate database events from RAC and notify JDBC of them. If ONS is not correctly set up, then implicit connection cache creation fails and an ONSException is thrown at the first getConnection request.

5.) The JVM in which your JDBC instance is running must have oracle.ons.oraclehome set to point to your ORACLE_HOME. For example:

-Doracle.ons.oraclehome=C:\oracle\product\10.2.0\db_1

6.) Set the FastConnectionFailoverEnabled property before making the first getConnection request to an OracleDataSource. When Fast Connection Failover is enabled, the failover applies to all connections in the connection cache. If your application explicitly creates a connection cache using the Connection Cache Manager, then you must first set FastConnectionFailoverEnabled before retrieving any connections.

7.) The ons.jar must be part of the CLASSPATH for the application. The ons.jar can be found in the Oracle Client installation.


Edit: One last thought, if there ever is a failover, you will need to handle the SQLException:

ORA-17008: Closed Connection

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.