Oracle RAC Failover

Source: Internet
Author: User
Tags taf

Oracle RAC also has HA (High Availiablity) and LB (LoadBalance), and its High availability is based onFailover (Failover)It means that the failure of any node in the cluster will not affect the user's use, and the user connected to the faulty node will be automatically transferred to the healthy node. In terms of user experience, this switchover is not felt.

 

Oracle 10g RAC Failover can be divided into three types:

1.Client-Side Connect time Failover

2.TAF

3.Service-Side TAF

 

Note: GLOBAL_NAME cannot be set in the listener. ora file, because this parameter will disable Connect-time Failover and Transparent Application Failover.

 

I.Client-Side Connect Time Failover

Client-Side Connect Time Failover: if multiple addresses are configured in the Client tnsname, the user attempts to Connect to the first address in the address table when initiating a connection request, if the connection fails, continue to use the second address until the connection is successful or all the addresses are traversed.

This type of Failover features: it only works at the time when a connection is established. That is to say, this type of Failover detects node faults only when a connection is initiated. If the node does not respond, the next address in the address list is automatically attempted. Once the connection is established, the node will not be processed if it fails. The client shows that the session is disconnected and the user program must re-establish the connection.

To enable this type of Failover, add the FAILOVER = ON entry to tnsnames. ora of the client. This parameter is ON by default. Therefore, the client can obtain the Failover capability even if this entry is not added.

 

Example:

RAC =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = rac1-vip) (PORT = 1521 ))

(ADDRESS = (PROTOCOL = TCP) (HOST = rac2-vip) (PORT = 1521 ))

(LOAD_BALANCE = YES)

(

CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = RAC)

)

)

Note: rac1-vip, rac2-vip to add to hosts file, otherwise it may not parse.

 

II.TAF (Transparent Application Failover)

 

 

For more information about this configuration, see:

10g & 11g Configuration of TAF (Transparent Application Failover) and Load Balancing [ID 453293.1]

Most popular application systems (such as weblogic and Jboss) have established several persistent connections to the database at startup, and reuse these connections throughout the application lifecycle. The Client-Side Connet Time Failover works in a way that it does not greatly help application availability.

Therefore, in Oracle 8.1.5, only the new Failover mechanism-TAF is introduced. The so-called TAF means that after the connection is established, when the application system runs, if an instance fails, the user connected to the instance will be automatically migrated to other healthy instances. For applications, this migration process is transparent and does not require user intervention. Of course, this transparency should be guided because your uncommitted transactions will be rolled back. The user program with Client-Side Connect Time Failover is interrupted and a connection error is thrown. the user must restart the application. This method of TAF has greatly improved the HA.

TAF ConfigurationIt is also very simple,You only need to add the FAILOVER_MODE configuration item in tnsnames. ora of the client.This entry has four sub-projects to be defined.

1.METHOD:You can define when to create a connection to your instance. There are two optional values: BASIC and PRECONNECT.

BASIC:A connection is created to another instance only when a node fault is detected.

PRECONNECT:The connection is established to all instances at the same time when the connection is initially established. When a fault occurs, the connection can be switched to another link immediately.

Comparison of the two methods: the BASIC method has a time delay when Failover is used. Although the PRECONNECT method has no time delay, establishing multiple redundant connections consumes more resources, the two are the differences between changing resources by time and changing resources by time.

2.TYPE:Defines how to handle the completed SQL statement when a fault occurs. There are two types:Session and select.

These two methods will automatically roll back uncommitted transactions. The difference lies in the processing of the select statement. For the select statement, the select statement that the user is executing will be transferred to the new instance, the subsequent result set is returned on the new node, while the returned record set is discarded.

Assume that the user is performing a query on node 1, and there are a total of 100 records in the result set. Now 10 records have been returned from node 1, and node 1 is down, the user connection is transferred to node 2. In session mode, the query statement needs to be re-executed. In select mode, the remaining 90 days of records will be returned from node 2, 10 records that have been returned from node 1 will not be returned to the user again. For the user, the switch cannot be felt.

Obviously, in order to implement the select method, Oracle must save more content for each session, including the cursor and user context. More resources are required to change the time of resources.

3. DELAY and RETRIES:These two parameters represent the Retry Interval and number of retries respectively.

Example:

RAC =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = rac1-vip) (PORT = 1521 ))

(ADDRESS = (PROTOCOL = TCP) (HOST = rac2-vip) (PORT = 1521 ))

(LOAD_BALANCE = YES)

(

CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = RAC)

(

FAILOVER_MODE =

(TYPE = session)

(METHOD = basic)

(RETRIES = 180)

(DELAY = 5)

)

)

)

  • 1
  • 2
  • 3
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.