Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 

 

 

Verifying TAF Configurations

Oracle RAC Cluster Tips by Burleson Consulting

 

Also see: Overview of Transparent Application Failover (TAF)

The v$session view 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

Using Instance Role for Configuring the Primary and Secondary Instance

The parameter instance_role, is optional and when used is placed in the connect_data section of the instance connect descriptor. It specifies a connection to the primary or secondary instance of Oracle Database 10g Real Application Clusters and Oracle Database 10g Real Application Clusters Guard configurations. The concept of the primary and secondary instance will be covered elsewhere in this book.

The instance_role parameter is used to explicitly connect to a primary or secondary instance. Of course, since it should be obvious that the default is the primary instance, TAF should only be used to preconnect only to a secondary instance.

instance_role can have the following values:

* primary:  Specifies to make this connection to the primary instance

* secondary:  Specifies to make this connection to the secondary instance

* any:  Allows a user connection to whichever instance has the lowest load, regardless of whether the instance has a primary or secondary role

A useful package is called dbms_libcache.. This package is used to transfer information in the library cache of the primary instance to the library cache of the secondary instance, which is also referred to as warming the library cache.

Connection to Instance Role Type

In the script below, the net service name ault_primary allows users to connect to the designated primary instance, and net second service name, ault_secondary allows user connection to the designated secondary instance.

ault_primary=
 (DESCRIPTION=
  (ADDRESS=
       (PROTOCOL=tcp) 
       (HOST=aultlinux1) 
       (PORT=1521))
  (ADDRESS=
       (PROTOCOL=tcp) 
       (HOST=aultlinux2) 
       (PORT=1521))
  (CONNECT_DATA=
     (SERVICE_NAME=ault)
     (INSTANCE_ROLE=primary)))
ault_secondary=
 (DESCRIPTION=
  (ADDRESS=
       (PROTOCOL=tcp) 
       (HOST=aultlinux1) 
       (PORT=1521))
  (ADDRESS=
       (PROTOCOL=tcp) 
       (HOST=aultlinux2) 
       (PORT=1521))
  (CONNECT_DATA=
     (SERVICE_NAME=ault)
     (INSTANCE_ROLE=secondary)))

Establishing a Connection to a Specific Instance

There are times when the Oracle Enterprise Manager (OEM) and other system management products need to connect to a specific instance, regardless of their role, to perform administrative tasks. For specific instance connections, (instance_name=instance_name) and (instance_role=any) would be configured to connect to a specific instance regardless of its primary or secondary role.

In the following script, the net service name ault1 allows user connections to the instance on aultlinux1, and ault2 allows user connections to the instance on aultlinux2. The setting (SERVER=dedicated) is used when the goal is to force a dedicated server connection even when shared server (MTS) is being used.

ault1=
 (DESCRIPTION=
  (ADDRESS=
       (PROTOCOL=tcp) 
       (HOST=aultlinux1) 
       (PORT=1521))
  (CONNECT_DATA=
     (SERVICE_NAME=ault)
     (INSTANCE_ROLE=any)
     (INSTANCE_NAME=ault1)
     (SERVER=dedicated)))
ault2=
 (DESCRIPTION=
  (ADDRESS=
       (PROTOCOL=tcp) 
       (HOST=aultlinux2) 
       (PORT=1521))
  (CONNECT_DATA=
     (SERVICE_NAME=ault)
     (INSTANCE_ROLE=any)
     (INSTANCE_NAME=ault2)
     (SERVER=dedicated)))

Using BACKUP with TAF Pre-Establishing a Connection

When Transparent Application Failover (TAF) is utilized, it is easy to specify a backup connection to the secondary instance. When this is done, the initial and backup connections must be explicitly specified. In the next example, Oracle Net connects to the listener on aultlinux1 and preconnects to aultlinux2, the secondary instance. If aultlinux1 fails after the connection, the TAF application fails over to aultlinux2, the secondary instance, automatically preserving any SELECT statements in progress due to the (TYPE=select) setting. The following script shows an example of this configuration.

Ault1=
 (DESCRIPTION=
  (ADDRESS=
       (PROTOCOL=tcp) 
       (HOST=aultlinux1) 
       (PORT=1521))
  (CONNECT_DATA=
     (SERVICE_NAME=ault)
     (INSTANCE_ROLE=primary)
     (FAILOVER_MODE=
       (BACKUP=ault2)
       (TYPE=select)
       (METHOD=preconnect))))
ault2=
 (DESCRIPTION=
  (ADDRESS=
       (PROTOCOL=tcp) 
       (HOST=aultlinux2) 
       (PORT=1521))
  (CONNECT_DATA=
     (SERVICE_NAME=ault)
     (INSTANCE_ROLE=secondary)))

Here is another example of a working istener.ora file using TAF:

TATA_DB1=
(DESCRIPTION=
(FAILOVER = true)
(LOAD_BALANCE = true)
(ADDRESS=
(PROTOCOL=tcp)
(HOST=NY_SERVER1)
(PORT=1521))
(ADDRESS=
(PROTOCOL=tcp)
(HOST=NY_SERVER2)
(PORT=1521))
(ADDRESS=
(PROTOCOL=tcp)
(HOST=LA_SERVER1)
(PORT=1521))
(ADDRESS=
(PROTOCOL=tcp)
(HOST=LA_SERVER2)
(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=TATADB)
(INSTANCE_NAME=TATADB)
(FAILOVER_MODE=
(BACKUP=TATA_DB1)
(TYPE=select)
(METHOD=basic)
(RETRIES=20)
(DELAY=3))))

 
   
Oracle Grid and Real Application Clusters

See working examples of Oracle Grid and RAC in the book Oracle Grid and Real Application Clusters.

Order directly from Rampant and save 30%. 
 


 

 
��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational