Edit D:\app\Administrator\product\11.2.0\dbhome_1\oc4j\j2ee\oc4j_applications\applications\em\em\online_help\tdprc\configwlm002.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title>Configuring JDBC Clients for Fast Connection Failover</title> <meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1 Build 135" /> <meta name="date" content="2009-06-04T14:31:50Z" /> <meta name="robots" content="noarchive" /> <meta name="doctitle" content="Configuring JDBC Clients for Fast Connection Failover" /> <meta name="relnum" content="11g Release 2 (11.2)" /> <meta name="partnum" content="E10743-01" /> <link rel="copyright" href="./dcommon/html/cpyr.htm" title="Copyright" type="text/html" /> <link rel="stylesheet" href="./dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" /> <link rel="contents" href="toc.htm" title="Contents" type="text/html" /> <link rel="prev" href="tdprc_config_jdbc_client.htm" title="Previous" type="text/html" /> <link rel="next" href="configwlm003.htm" title="Next" type="text/html" /> <script src="./callback.js" type="text/javascript"></script> <noscript>Your browser does not support JavaScript. This help page requires JavaScript to render correctly.</noscript> </head> <body> <div class="zz-skip-header"><a href="#BEGIN">Skip Headers</a></div> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <col width="86%" /> <col width="*" /> <tr valign="bottom"> <td align="left"></td> <td align="center"><a href="tdprc_config_jdbc_client.htm"><img src="./dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="configwlm003.htm"><img src="./dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="CACBAGAA" name="CACBAGAA"></a><a id="TDPRC313" name="TDPRC313"></a></p> <div class="sect3"><!-- infolevel="all" infotype="General" --> <h1>Configuring JDBC Clients for Fast Connection Failover</h1> <a name="BEGIN" id="BEGIN"></a> <p>The Universal Connection Pool subscribes to the FAN Load Balancing events automatically when you configure fast connection failover. Instead of randomly assigning a free connection to a work request, the connection pool chooses the connect that will give the best service according to the latest information it has received. If a node becomes hung, the connection pool gradually shifts connections from the hung node to other nodes in the cluster.</p> <a id="TDPRC314" name="TDPRC314"></a> <p class="subhead2">To configure JDBC clients for Fast Connection Failover:</p> <ol> <li> <p>Use the Cluster Managed Services page in Oracle Enterprise Manager Database Control or Oracle Enterprise Manager Grid Control to create new services. See <a href="tdprc_create_services.htm#CACFEADG">"Creating Services"</a> for more information about creating services.</p> </li> <li> <p>Enable fast connection failover for JDBC clients by setting the UCP DataSource property FastConnectionFailoverEnabled to <code>TRUE</code>. Also, Configure a remote Oracle Notification Services (ONS) subscription on the JDBC client so that an ONS daemon is not required on the client, as shown in the following example:</p> <pre xml:space="preserve" class="oac_no_warn"> PoolDataSource pds = PoolDataSourceFactory.getPoolDataSource(); Pds.setConnnectionPoolName(“FCFSampleUCP”); <span class="bold">pds.setONSConfiguration(“nodes=docrac1:4200,docrac2:4200”);</span> <span class="bold">pds.setFastConnectionFailoverEnabled(true);</span> pds.setConnectionFactoryClassName(“oracle.jdbc.pool.OracleDataSource”); </pre> <p>The remote ONS subscription must contain every host that the client application can use for failover.</p> <div class="helpinfonote"> <p><span class="bold">See Also: </span><a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=JJUCP','newWindow').focus()"><span class="italic">Oracle Universal Connection Pool for JDBC Developer's Guide</span> f</a>or more information</p> </div> </li> <li> <p>Set the <code>oracle.net.ns.SQLnetDef.TCP_CONNTIMEOUT_STR</code> property to a nonzero value on the data source. When this property is set, if the JDBC client attempts to connect to a host that is unavailable, the connection attempt is bounded to the time specified for <code>oracle.net.ns.SQLnetDef.TCP_CONNTIMEOUT_STR</code>. After the specified time has elapsed and a successful connection has not been made, the client attempts to connect to the next host in the address list. Setting this property to a value of 3 seconds is sufficient for most installations.</p> </li> <li> <p>Configure JDBC clients to use a connect descriptor that includes the SCAN and the service name, and optionally the port that the SCAN listener listens on, for example:</p> <pre xml:space="preserve" class="oac_no_warn"> @//docrac.example.us.oracle.com:1521/Sales_JDBC </pre> <div class="helpinfonote"> <p><span class="bold">Note: </span>Do not configure Transparent Application Failover (TAF) with Fast Connection Failover for JDBC clients as TAF processing will interfere with FAN ONS processing.</p> </div> <p>In the JDBC application, you would connect to the database using a connect string, such as the following one:</p> <pre xml:space="preserve" class="oac_no_warn"> pds.setURL("jdbc:oracle:thin:@//docrac.example.us.oracle.com:1521/Sales_JDBC") </pre> <p>If you are using a JDBC driver, you must include the complete connect descriptor in the URL because the JDBC driver does not use Oracle Net.</p> </li> <li> <p>Make sure that both <code>ucp.jar</code> and <code>ons.jar</code> are in the application CLASSPATH.</p> </li> </ol> <div class="helpinfonotealso"> <h2>Related Topics</h2> <p><a href="tdprc_create_services.htm#CACFEADG">Creating Services</a></p> <p><a href="tdprc_about_fan.htm#CHDDCDFA">About Fast Application Notification (FAN)</a></p> <p><a href="tdprc_config_clnt_failovr.htm#CHDCGJJJ">Configuring Clients for High Availability</a></p> <p><a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=JJDBC27000','newWindow').focus()"><span class="italic">Oracle Database JDBC Developer's Guide</span></a> for more information about fast connection failover and configuring ONS</p> <p><a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=TDPJD176','newWindow').focus()"><span class="italic">Oracle Database 2 Day + Java Developer's Guide</span></a> for information about creating a method to authenticate users</p> <p><a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=RACAD076','newWindow').focus()"><span class="italic">Oracle Real Application Clusters Administration and Deployment Guide</span></a> for information about configuring client failover</p> </div> </div> <!-- class="sect3" --> <!-- Start Footer --> <div class="footer"> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <col width="86%" /> <col width="*" /> <tr> <td align="left"><span class="copyrightlogo">Copyright © 2006, 2009, Oracle and/or its affiliates. All rights reserved.</span><br /> <a href="./dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td> <td align="center"><a href="tdprc_config_jdbc_client.htm"><img src="./dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="configwlm003.htm"><img src="./dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> </div> <!-- class="footer" --> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de