This discussion is archived
3 Replies Latest reply: Jul 31, 2013 3:09 AM by 3c29ea41-203a-4131-808b-f45a28d3a980 RSS

How do the application servers connect the new database after failing over from primary DB to standby DB

3c29ea41-203a-4131-808b-f45a28d3a980 Newbie
Currently Being Moderated

How do the application servers connect the new database after failing over from primary DB to standby DB?

 

We have setup a DR environment with a standalone Primary server and a standalone Physical Standby server on RHEL Linux 6.4. Now our application team would like to know:

 

When the primary DB server is crashed, the standy DB server will takeover the role of primary DB through the DataGuard fast failover. As the applications are connected by the primary DB IP before,currently the physical DB is used as a different IP or listener. If this is happened, they need to stop their application servers and re-configure their connection so the they coonect the new DB server, they cannot tolerate these workaround. 

 

Whether does oracle have the better solution for this so that the application can automatically know the role's transition and change to the new IP without re-confige any connection and shutdown their application?

Oracle support provides us the answer as following:

==================================================================

Applications connected to a primary database can transparently failover to the new primary database upon an Oracle Data Guard role transition. Integration with Fast Application Notification (FAN) provides fast failover for integrated clients.

 

After a failover, the broker publishes Fast Application Notification (FAN) events. These FAN events can be used in the following ways:

 

Applications can use FAN without programmatic changes if they use one of these Oracle integrated database clients: Oracle Database JDBC, Oracle Database Oracle Call Interface (OCI), and Oracle Data Provider for .NET ( ODP.NET). These clients can be configured for Fast Connection Failover (FCF) to automatically connect to a new primary database after a failover.

 

JAVA applications can use FAN programmatically by using the JDBC FAN application programming interface to subscribe to FAN events and to execute event handling actions upon the receipt of an event.

 

FAN server-side callouts can be configured on the database tier.

 

FAN events are published using Oracle Notification Services (ONS) and Oracle Streams Advanced Queuing (AQ).

=======================================================================================

 

Who has the experience and the related documentation or other solutions? we don't have the concept of about FAN.

 

Thank very much in advance.

  • 1. Re: How do the application servers connect the new database after failing over from primary DB to standby DB
    3c29ea41-203a-4131-808b-f45a28d3a980 Newbie
    Currently Being Moderated

    Currently we have 3 kinds of Oracle connection mechanism:

     

    1. Java JNDI;

    2. OCI;

    3. Oracle.DataAccess.Client

  • 2. Re: How do the application servers connect the new database after failing over from primary DB to standby DB
    mseberg Guru
    Currently Being Moderated

    Hello;

     

    Transparent Application Failover is a method you can use. Here's a setup example:

     

    transparent failover to application

     

    Best Regards

     

    mseberg

  • 3. Re: How do the application servers connect the new database after failing over from primary DB to standby DB
    3c29ea41-203a-4131-808b-f45a28d3a980 Newbie
    Currently Being Moderated

    Hi mesbeg,

     

    Thanks alot.

     

    For example, there is an application JBOSS server connecting the DB, we just added another datasource and put the standby IP into the configuration file except adding a service on DB side like this following:

     

            <subsystem xmlns="urn:jboss:domain:datasources:1.0">

            <datasources>

                    <datasource jta="false" jndi-name="java:/jdbc/idserverDatasource" pool-name="IDServerDataSource" enabled="true" use-java-context="true">

                        <connection-url>jdbc:oracle:thin:@<primay DB IP>:1521:testdb</connection-url>

                        <connection-url>jdbc:oracle:thin:@<standby DB IP>:1521:testdb</connection-url>

                        <driver>oracle</driver>

                        <pool>

                            <min-pool-size>2</min-pool-size>

                            <max-pool-size>10</max-pool-size>

                            <prefill>true</prefill>

                        </pool>

                        <security>

                            <user-name>TEST_USER</user-name>

                            <password>Password1</password>

                        </security>

                        <validation>

                            <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>

                            <validate-on-match>false</validate-on-match>

                            <background-validation>false</background-validation>

                            <use-fast-fail>false</use-fast-fail>

                            <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"/>

                            <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>

                        </validation>

                    </datasource>

                    <drivers>

                        <driver name="oracle" module="com.oracle.jdbc">

                            <xa-datasource-class>oracle.jdbc.OracleDriver</xa-datasource-class>

                        </driver>

                    </drivers>

                </datasources>

            </subsystem>

     

    If the failover is occurred, the JBOSS will automatically be pointed to the standby DB. Additional actions are not needed.

Legend

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