Zurück

Net8 Connect-Time Failover


Overview

You can use connect-time Net8 failover to cause clients to connect to a backup instance in cases where the primary instance cannot be reached. This makes the most sense in an OPS (Oracle Parallel Server) environment where multiple instances are all accessing the same database. However, it can be done in a non-OPS environment as well. If you are using Oracle's standby database feature, you can configure a net service name so that clients connect to the standby database whenever the primary database is unreachable. Similarly, you could connect to a backup database maintained using Oracle's replication features.

Another failover method is Transparent Application Failover (TAF) which comes into play after an application has connected to an instance. If the connection to the instance is lost while the application is running, Net8 will transparently reconnect the application to another instance accessing the same database.

Example

Consider the situation shown in the next figure, where a client connects to an instance named ARK1. Under some circumstances, if the ARK1 instance fails, Net8 can automatically connect the client to the backup instance named DIA3.

Dynamically registering global database names with your listeners

One important issue to be aware of is that connect-time failover only works if you are dynamically registering global database names with your listeners. If you are statically configuring global database names, then connect-time failover will not work in a consistent manner:

If you want to use Net8's connect-time failover feature, you need to delete the GLOBAL_DBNAME parameter and allow the database to register itself with the listener automatically. You can list the database in your SID_LIST; you just can't include the GLOBAL_DBNAME parameter.

Listener.ora on ARK1

LSNR817 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = arkum)(PORT = 1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = ARK1))
    )
  )

SID_LIST_LSNR817 =
  (SID_LIST =
    (SID_DESC =
      (ORACLE_HOME = D:\Oracle\Product\8.1.7)
      (SID_NAME = ARK1)
    )
  )

Listener.ora on DIA3

LSNRDIA3 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.138.21)(PORT = 1523))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = DIA3))
    )
  )

SID_LIST_LSNRDIA3 =
  (SID_LIST =
    (SID_DESC =
      (ORACLE_HOME = /opt/oracle/product/8.1.7)
      (SID_NAME = DIA3)
    )
  )

Failover Configuration in Tnsnames.ora on Net8 Client

PROD.WORLD =
  (DESCRIPTION_LIST =
    (FAILOVER = TRUE)
    (LOAD_BALANCE = FALSE)

    (DESCRIPTION =
    (ADDRESS =
      (PROTOCOL = TCP)
      (HOST = arkum)(PORT = 1521))
      (CONNECT_DATA =
        (SERVICE_NAME = ARK1)
        (SERVER = DEDICATED)
      )
    )

    (DESCRIPTION =
    (ADDRESS =
      (PROTOCOL = TCP)
      (HOST = diamond)(PORT = 1523))
      (CONNECT_DATA =
        (SERVICE_NAME = DIA3)
        (SERVER = DEDICATED)
      )
    )

  )

When you connect using the service name PROD, Net8 will first try to connect to the database service ARK1 on the host arkum. If that connection fails, Net8 will move on to the database service DIA3 on the host named diamond.

Notice that the description list contains both (FAILOVER = true) and (LOAD_BALANCE = false). (FAILOVER = true) still represents the default behavior. It's included here to make it clear that failover is being used. (LOAD_BALANCE = false), however, does not represent the default behavior in this case. It's included to disable client load balancing, which is enabled by default whenever multiple descriptions are being used. With client load balancing enabled, Net8 would randomly choose descriptions from the description list. By disabling client load balancing, you ensure that Net8 tries each DESCRIPTION in the order in which it appears in the list.