PB8对Oracle8i的FailOver的支持

 
  
 
This document contains guidelines for setting the database parameter in the transaction object of a PowerBuilder application for Oracle 8i database failover and also for configuring the Oracle client TNSNAMES.ORA file for failover.

In PowerBuilder 8.0, the enhanced Oracle database interface driver "O84 Oracle8/8i (8.x.4+)" now supports PowerBuilder application failover when connecting to an Oracle8i database server (version 8.1.5 and higher). There are four new DBParms in PowerBuilder 8.0 for Oracle that allow you to customize failover behavior for Oracle 8i databases. These DBParms are set via the Network tab in the Oracle8i database profile.

Oracle Database profile:
        SQLCA.DBMS = "O84 Oracle8/8i (8.x.4+)"
        SQLCA.LogId = "scott"
        SQLCA.LogPass = "tiger"
        SQLCA.ServerName = "sales"
        SQLCA.DBParm = "SvrFailover='Yes',FoDialog='Yes',FoRetryCount=10,FoDelay=10"

SvrFailover:   Specifies whether you want PowerBuilder to recognize and participate in failover to a designated backup database server if the current database server goes down.

FoDialog:       Select to display runtime dialog when failing over. Specifies whether PowerBuilder displays a runtime dialog box indicating when a failover occurs.

FoRetryCount: Specifies the number of times you want PowerBuilder to try to fail over to an another database server if the current database server goes down.

FoDelay:       Specifies the amount of time (in milliseconds) you want PowerBuilder to wait between attempts to failover to another database server if the current database server goes down.

None of the above four database parameters can be set dynamically. These values used when establishing the database connection remain until disconnected from the database.

Oracle Connect-Time Failover:

The application database connect request is forwarded to a another listener if the first database listener is not responding. Connect-time failover is enabled by database instance registration, because the listener knows if an instance is up prior to attempting a connection.

When connect-time failover is enabled, Net8 is instructed at connect time to fail over to a different listener if the first listener fails when set to ON. The number of addresses in the list determines how many addresses are tried. When set to OFF, failover is Net8 tries one address. Connect-time failover is turned ON by default for multiple address lists (ADDRESS_LIST), connect descriptors (DESCRIPTION), and multiple connect descriptors (DESCRIPTION_LIST).

The TNSNAMES.ORA file need to be configured for connect-time failover listing each database address, in order, that should be tried until one succeeds:
sales=
    (description=
        (address_list=
            (failover=on)
                (address=(protocol=tcp)(host=sales-pc)(port=1521))
                (address=(protocol=tcp)(host=finance-pc)(port=1521))
        )
        (connect_data=(service_name=sales.com))
    )

If the client application database connection through one instance to the database is broken, you can write applications to automatically reconnect through a different instance. See Oracle8 Documentation:  Net8 Administrator's Guide - Configuring Multiple Address Options for more information.