Oracle Training Oracle Support
Oracle Training
SQL Tuning Consulting
Oracle Tuning Consulting
Data Warehouse Consulting
Oracle Project Management
Oracle Security Assessment
Unix Consulting
Burleson Books
Burleson Articles
Burleson Web Courses
Burleson Qualifications
Oracle Internals Magazine
Oracle Links
Oracle Monitoring
Remote Support Benefits
Remote Plans & Prices
Our Automation Strategy
What We Monitor
Oracle Apps Support
Print Our Brochure
Contact Us (e-mail)
Oracle Job Opportunities
Oracle Consulting Prices
 

Free Oracle Tips


 
HTML Text AOL
 
 

Examples of TAF Configurations

October 23,  2003
Don Burleson

 

The following is a list of several examples of TAF configurations:

·        Connect-Time Failover with Client Load Balancing

·        Retry of connections

·        Pre-established failover connections

TAF with Connect-Time Failover and Client Load Balancing

To implement TAF with connect-time failover and client load balancing for multiple addresses, configure the tnsnames.orafiles as shown below. Oracle Net connects randomly to one of the protocol addresses on aultlinux1 or aultlinux2. If the instance were to fail after the connection, the TAF application fails over to the other node's listener, reissuing any select statements in flight.

 

ault=

 (DESCRIPTION=

  (LOAD_BALANCE=on)

  (FAILOVER=on)

  (ADDRESS=

       (PROTOCOL=tcp) 

       (HOST=aultlinux1) 

       (PORT=1521))

  (ADDRESS=

       (PROTOCOL=tcp) 

       (HOST=aultlinux2) 

       (PORT=1521))

  (CONNECT_DATA=

     (SERVICE_NAME=ault)

     (FAILOVER_MODE=

       (TYPE=select)

       (METHOD=basic))))

Configuring TAF to Retry a Connection

With a proper configuration, TAF will automatically retry connecting if the first connection attempt fails. The tnsnames.orafile is configured with the retries and delay parameters. In the example shown below, Oracle Net tries to reconnect to the listener on the aultlinux1 server. If the failover connection fails, Oracle Net waits 10 seconds before trying to reconnect again. Using this tnsnames.ora file Oracle Net attempts to reconnect up to 10 times.

 

ault=

 (DESCRIPTION=

  (ADDRESS=

       (PROTOCOL=tcp) 

       (HOST=aultlinux1) 

       (PORT=1521))

  (CONNECT_DATA=

     (SERVICE_NAME=ault)

     (FAILOVER_MODE=

       (TYPE=select)

       (METHOD=basic)

       (RETRIES=10)

       (DELAY=10))))

Configuring TAF for Pre-Establishing Connections

TAF can be configured to create pre-established connections to a second instance. The initial and backup connections are explicitly specified. In the example below, clients that use net service name ault1 to connect to the listener on aultlinux1 are also pre-connected to aultlinux2. If the aultlinux1 fails after the connection, Oracle Net automatically fails over to aultlinux2, reissuing any select statements in progress. In this reciprocal setup, Oracle Net pre-connects to aultlinux1 for those clients that use ault2 to connect to the listener on aultlinux2.

 

ault1 =

 (DESCRIPTION=

  (ADDRESS=

       (PROTOCOL=tcp) 

       (HOST=aultlinux1) 

       (PORT=1521))

  (CONNECT_DATA=

     (SERVICE_NAME=ault)

     (INSTANCE_NAME=ault1)

     (FAILOVER_MODE=

       (BACKUP=ault2)

       (TYPE=select)

       (METHOD=preconnect))))

ault2=

 (DESCRIPTION=

  (ADDRESS=

       (PROTOCOL=tcp) 

       (HOST=ault2) 

       (PORT=1521))

  (CONNECT_DATA=

     (SERVICE_NAME=ault)

     (INSTANCE_NAME=ault2)

     (FAILOVER_MODE=

       (BACKUP=ault1)

       (TYPE=select)

       (METHOD=preconnect))))

 

Verifying TAF Configurations

The v$sessionview contains the failover_type, failover_method, and failed_over columns. These columns are used to monitor connected clients and the TAF status. An example select against this view is shown below.

 

SELECT MACHINE, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER, COUNT(*)

FROM V$SESSION

GROUP BY MACHINE, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER;

 

The output before failover of the aultlinux1 server resembles the following:

 

MACHINE        FAILOVER_TYPE FAILOVER_M FAI   COUNT(*)

-------------- ------------- ---------- --- ----------

aultlinux1     NONE          NONE       NO          11

aultlinux2     select        PRECONNECT NO           1

 

The output after a failover from the aultlinux1 server is:

 

MACHINE          FAILOVER_TYPE FAILOVER_M FAI COUNT(*)

---------------- ------------- ---------- --- --------

aultlinux2       NONE          NONE       NO        10

aultlinux2       select        PRECONNECT YES        1

 

If you like Oracle tuning, check out my latest book
"Oracle Tuning: The Definitive Reference". 

It's 980 pages of hard-core tuning insights, tips and scripts, and you can buy it direct from the publisher for 30%-off. 

 

 
 

 

 

   

Copyright © 1996 -  2011 by Burleson Enterprises. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.