Detailed explanation of Oracle RAC failover

Source: Internet
Author: User
Tags failover taf

Oracle RAC also has ha (high availiablity) and lb (loadbalance). And its high availability is based on failover (failover). 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 this 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 the Global_name in the Listener.ora file because this parameter disables Connect-time Failover and transparent application.

One, client-side Connect time Failover

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

This failover feature: It works only at the moment when the connection is established, that is, the failover method only senses node failure when initiating a connection, and automatically tries the next address in the address list if the node does not respond. Once the connection is established, the node fails and the client behaves as if the session is disconnected and the user program must re-establish the connection.

The way to enable this failover is to add Failover=on entries to the client's Tnsnames.ora, which defaults to on, so that the client will gain this failover capability even if the 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 be added to the Hosts file, otherwise it may not be resolved.

Ii. TAF (Transparent application Failover)

Most popular application systems (e.g., WebLogic, Jboss) are now set up to establish several long connections to the database at startup, reusing these connections throughout the lifecycle of the application. The way Client-side connet time failover works is that it doesn't do much to the usability of the application.

So the Oracle 8.1.5 version only introduced a new failover mechanism-taf. The so-called Taf, that is, after the connection is established, the application system runs, 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 requires no user intervention, and of course, this transparency is bootable because the user's uncommitted transactions are rolled back. Client-side Connect time failover User program interruption, throw connection errors, users must restart the application, TAF this way in improving HA has made great progress.

TAF configuration is also simple, just add Failover_mode configuration entries to the client's Tnsnames.ora. This entry has 4 subprojects to define.

1. Method: When a user defines when a connection to its instance is created, it has basic and preconnect two optional values.

BASIC: Refers to creating a connection to another instance when a node failure is perceived.

Preconnect: A connection that establishes all instances at the same time when the connection is initially established, and can be switched to other links immediately when a failure occurs.

Comparison between the two methods: Basic mode in the failover will have time delay, Preconnect mode Although there is no time delay, but the establishment of multiple redundant connections will consume more resources, the two are the time to Exchange resources and use 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 methods are automatically rolled back for uncommitted transactions, which differ in the processing of the SELECT statement, where the SELECT statement that the user is executing is transferred to the new instance, the subsequent result set continues to return on the new node, and the returned recordset is discarded.

Assuming that the user is executing the query on Node 1, the entire result set has 100 records, and now returns 10 records from Node 1, when Node 1 is down, the user connection is transferred to Node 2, and if it is session mode, the query statement needs to be executed again; The remaining 90-day records will be returned from Node 2, and 10 records that have been returned from Node 1 will not be returned to the user repeatedly, and this switch is not felt for the user.

Obviously in order to implement the Select method, Oracle must save more content for each session, including cursors, user contexts, and so on, requiring more resources and resources in exchange for time.

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)

Third, Service-side TAF

Service-sidetaf can be seen as a variant of TAF, first Service-sidetaf is also TAF, all TAF features it has, and secondly this TAF is configured on the server, unlike Taf is configured on the client.

Client-side TAF is configured at the client to modify the Tnsnames.ora file, if a lot of clients use this database, then each smile adjustment will need to change all the computer, inefficient and error-prone. and Service-side TAF through the combination of service, in the database to save the Fail_mode configuration, all the TAF configuration in the data dictionary, thus eliminating the client configuration, now the client's TNS file does not need any TAF configuration options.

In terms of configuration parameters, Service-side TAF and Taf are more than one concept of instance role (instance roles). The so-called instance role is that when multiple instance participate in a service, you can configure which instance to use to provide service to the user. There are two optional roles for users.

This article URL address: http://www.bianceng.cn/database/Oracle/201410/45451.htm

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.