Oracle RAC Failover Detailed

Source: Internet
Author: User
Tags failover taf

Oracle RAC has both ha (high availiablity) and lb (loadbalance). And the basis of its highly available Failover (fail over)  It means that the failure of any node in the cluster will not affect the user's use, the user connected to the failed node will be automatically transferred to the health node, from the user experience, is not feel the switch.

the Oracle 10g RAC failover can be divided into 3 types:

1. client-side Connect time Failover

2. TAF

3. service-side TAF

Note: You cannot set global_name in the Listener.ora file because this parameter disables Connect-time Failover and Transparent application Failover.

A. client-side Connect time Failover

client-side connect time failover meaning: If multiple addresses are configured in the client Tnsname, when a user initiates a connection request, it first attempts to connect to the first address in the Address table, and if the connection attempt fails, continue to attempt to use the second address, Until the connection is successful or all addresses are traversed.

This failover feature: only works at the moment the connection is established, that is, this failover mode only senses node failure when the connection is initiated, and if the node is unresponsive, the next address in the address list is automatically attempted. Once the connection is established, the node fails to do the processing, from the client's performance is the session is disconnected, the user program must re-establish the connection.

The way to enable this failover is to add the Failover=on entry in the client's Tnsnames.ora, which is on by default, so the client will gain this 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 will be added to the Hosts file, otherwise it may not resolve.

two. TAF (Transparent application Failover)

The configuration of this piece, refer to:

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

Most popular applications today, such as WebLogic, Jboss, start with a number of long connections to the database and reuse them throughout the lifetime of the application. The way Client-side connet time failover works is that it does not help the usability of the application much.

so from the Oracle 8.1.5 release, only the new failover mechanism-TAF is introduced. The so-called TAF, is the connection after the establishment of the application system during operation, if an instance fails, the user connected to the instance will be automatically migrated to other health instances. For applications, this migration process is transparent and does not require user intervention, and of course, this transparency is bootable because the user's uncommitted transaction is rolled back. Client-side Connect time failover User program interrupt, throw connection error, user must restart the application, TAF this way to improve HA has made great progress.

configuration of the TAF also very simple, you only need to add the Failover_mode configuration item in the client's Tnsnames.ora. This entry has 4 sub-items that need to be defined.

1. METHOD: The user defines when to create a connection to its instance, with basic and preconnect two selectable values.

BASIC: refers to a connection that is created to another instance when a node failure is perceived.

preconnect: A connection is established to all instances at the time the connection is initially established, and when a failure occurs, it is immediately possible to switch to the other link.

two ways to compare: Basic mode in failover time delay, Preconnect mode Although there is no time delay, but the establishment of multiple redundant connections will consume more resources, the two is to use time for resources and resources to change the time difference.

2. type: used to define how the completed SQL statement is handled when a failure occurs, with 2 types:session and select.

These 2 ways are automatically rolled back for uncommitted transactions, except for the processing of the SELECT statement, and for SELECT, the SELECT statement that the user is executing is transferred to the new instance, the subsequent result set continues to be returned on the new node, and the recordset that has been returned is discarded.

Assuming that the user is executing a query on Node 1, the entire result set has 100 records, now returns 10 records from Node 1, the node 1 is down, the user connection is transferred to Node 2, if the session mode, you need to re-execute the query statement; The remaining 90-day record continues to be returned from Node 2, and the 10 records that have been returned from Node 1 are not returned to the user repeatedly, and for the user, the switch is not felt.

obviously in order to implement the Select mode, Oracle must save more content for each session, including cursors, user contexts, etc., and require more resources to use resources for time-saving scenarios.

3. DELAY and retries: These 2 parameters represent the retry interval and the 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)

 )

      )

    )

Oracle RAC Failover Detailed

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.