This discussion is archived
10 Replies Latest reply: May 29, 2013 7:33 AM by 917702 RSS

Single Node RAC on 11.2.0.3

mail.madhankumar Newbie
Currently Being Moderated
Hi,
i have implemented Oracle 11.2.0.3 Single Node RAC with 2 node. i have enabled ons on both node. for TAF it's working fine. but when we apply in java .. it is not working.. how can i implement in java...
we had done all the methods using following links..

http://www.drdobbs.com/jvm/jdbc-fast-connection-failover-with-oracl/222700353?pgno=2
  • 1. Re: Single Node RAC on 11.2.0.3
    Victor Armbrust Oracle ACE
    Currently Being Moderated
    Why don't use SCAN for JDBC string?


    jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=*<your_scan_name>*)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=sales.foo.com)))


    Victor
  • 2. Re: Single Node RAC on 11.2.0.3
    mail.madhankumar Newbie
    Currently Being Moderated
    Hi victor,
    i tried in both ways. through scan 1ly task should be completed.. in backend it works well.. but in front end getting disconnect...
  • 3. Re: Single Node RAC on 11.2.0.3
    Victor Armbrust Oracle ACE
    Currently Being Moderated
    Have you try to update your JDBC driver client version? Since it is 11gr2, should be ok with SCAN
  • 4. Re: Single Node RAC on 11.2.0.3
    mail.madhankumar Newbie
    Currently Being Moderated
    Hi Victor,
    We are using Latest JDBC Driver 1ly, but no use..
  • 5. Re: Single Node RAC on 11.2.0.3
    Sebastian Solbach (DBA Community) Guru
    Currently Being Moderated
    Hi,

    have you checked:
    http://www.oracle.com/technetwork/products/clustering/overview/awm11gr2-130711.pdf

    Note: FCF and FAN does not provide select failover. Just a fast way to reestablish/refresh the connection pool.
    The failover implementation has to be done in the (java) app itself.

    You could use TAF for Java as well in connection with FAN. However this requires the FAT client, not JDBC thin.

    Regards

    Sebastian
  • 6. Re: Single Node RAC on 11.2.0.3
    mail.madhankumar Newbie
    Currently Being Moderated
    Hi Sebastian,
    We have configured like below in application. it connects well. Oracle Configured as Single Node Rac in 11.2.0.3.
    when i down the available server, 2nd node getting up, it works in backend whn i use TAF. when apply below method it returns ORA-17410 error .. could u check below code and suggest me to change to work..



    OracleDataSource ods;
         
         public Test2(){

              java.util.Properties prop = new java.util.Properties();
              prop.setProperty("MinLimit", "5"); // the cache size is 5 at least
              prop.setProperty("MaxLimit", "25");
              prop.setProperty("InitialLimit", "1"); // create 3 connections at startup
              prop.setProperty("InactiveConnectionTimeout", "20"); // seconds

              prop.setProperty("ConnectionWaitTimeout", "20"); // seconds
              prop.setProperty("PropertyCheckInterval", "60"); // seconds


              try {
                   System.out.println(" --> Loading JDBC Driver.");
                   ods = new OracleDataSource();
                   // Set the user name, password, and so on
                   //System.out.println("ONS Configuration file:"+ods.getONSConfiguration());
                   ods.setUser("FORECONNECT28NOV");
                   ods.setPassword("econnect");
                   ods.setURL("jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS=(PROTOCOL=TCP)(HOST=rac-scan)(PORT = 1521))(LOAD_BALANCE = yes)(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = testrac)(FAILOVER_MODE =(TYPE = SELECT)(METHOD = PRECONNECT)(RETRIES = 180)(DELAY = 5))))");
                   ods.setConnectionCacheProperties(prop);
                   ods.setConnectionCachingEnabled(true);
                   ods.setFastConnectionFailoverEnabled(true);
                   ods.setONSConfiguration("nodes=192.168.74.118:4200,192.168.74.90:4200");
                   ods.setServiceName("testrac");

                   //ods.setTNSEntryName("");
                   ods.setImplicitCachingEnabled(true);
                   ods.setConnectionCacheName("MyCache");

              } catch (Exception e) {
                   System.out.println("ERROR: Loading JDBC Driver");
                   e.printStackTrace();
                   System.exit(1);
              }

              System.out.println(" --> JDBC Driver Loaded Succesfully.");
              // System.out.println(" --> ValidateConnection = " + prop.getProperty("ValidateConnection"));
         }
  • 7. Re: Single Node RAC on 11.2.0.3
    onedbguru Pro
    Currently Being Moderated
    Explain how you have a single node RAC on two nodes??
  • 8. Re: Single Node RAC on 11.2.0.3
    mail.madhankumar Newbie
    Currently Being Moderated
    Hi,
    are you aware of oracle 11gr2 feature.. Rac One Node.. this RAC One Node 1ly i have implemented.. Please check below link for your reference..

    http://www.databasejournal.com/features/oracle/article.php/3906196/Moving-to-Oracle-RAC-One-Node.htm
  • 9. Re: Single Node RAC on 11.2.0.3
    Sebastian Solbach (DBA Community) Guru
    Currently Being Moderated
    Hi,

    have a look on the following whitepaper (it includes a Java example on FCF and FAN, and especially what driver to use!)

    http://www.oracle.com/technetwork/database/features/availability/maa-wp-11gr2-client-failover-173305.pdf
    and
    Universal Connection Pool Documentation:
    http://www.oracle.com/pls/db112/to_pdf?pathname=java.112/e12265.pdf

    Check if you are using the correct data source with the correct connection pooling mechanism.
    Furthermore: If you use FCF and FAN, then the reconnect/get connection out of the connection pool, is something the application has to do, after it received a client error.

    Also: You connection string implies you want to use TAF
    (TYPE = SELECT)(METHOD = PRECONNECT)(RETRIES = 180)(DELAY = 5)
    but this is not available in JDBC Thin.... Just in JDBC Thick. And TAF + FCF won't work (just TAF with FAN).

    Regards
    Sebastian
  • 10. Re: Single Node RAC on 11.2.0.3
    917702 Newbie
    Currently Being Moderated
    Hi,
    Does anyone got any solutions as we are struck with same issue
    -Gopi

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points