Oracle Faq (Configuration of Oracle TAF) _php Basics

Source: Internet
Author: User
Tags failover taf

If you want to reprint, please specify the source! (Diao greedy first thanked ...) )
Configuration of Oracle Taf

TAF is the abbreviation for transparent application failover, the general application of TAF is in the OPS/RAC environment. Since the beginning of the 8i, this function, the purpose and ideas are very good, but the application is still very limited, this article will focus on TAF related issues for a detailed discussion.

The test environment for this article is Tru64 v5.1+ Oracle9.2.0.1 RAC.

I. Description of the relevant parameters

Honestly, Oracle. Several configuration parameters for the network really is too messy, a lot of people can not figure out what is going on, common mistakes:
"Ora-12514:tns:listener could not resolve service_name given in Connect descriptor" and
"Ora-12154:tns:could not resolve service name"
The essence is the same, to solve such problems need us to make a few parameters:

Several parameters in the Initsid.ora:
Db_name---database name, which is the name that is provided when you build it.
Global_names---true/false, set whether to use the database domain name.
Db_domain---The domain name of the database, if Global_names=true is required to provide this parameter.
Service_names---service NAMES list, services name, can have more than one.

Instance_name---INSTANCE name, which is supported from 817, starting with Service_names, where the database, instance, and service names can be separated from 817. The default instance_name value is the SID of the instance, which is the value of the environment variable ORACLE_SID. When there are no instance_name parameters before 817, the different instance are distinguished by SIDS. The following oracle817 documents explain: SID is to distinguish the shared memory of each instance on the same host, not the only distinguishing mark of instance, but instance_name is to distinguish each instance.

Environment variables:
Oracle_sid---when there are no instance_name parameters before 817, the different instance are distinguished by SIDS (see the Initsid.ora parameter explanation above for detailed instructions).

Several parameters in the Listener.ora:
Global_dbname---The global database name, uniquely identifying a different database in a distributed environment. Its value is the combination of db_name and db_domain in Initsid.ora, that is, Global_dbname=db_name. Db_domain, where db_domain is not needed if it is not set up here. This parameter is recommended for explicit designation in a distributed environment.
SERVICE_NAME---Service name, take Initsid.ora service_names list to one.
Sid_name---The oracle_sid value of the corresponding environment variable.
Instance_name---Corresponding initialization parameter instance_name.

Several parameters in the Tnsnames.ora:
SERVICE_NAME---Service name, take Initsid.ora service_names list to one.
Sid_name---can be written as: SID, corresponding to ORACLE_SID, or initialization parameter instance_name, when equal to instance_name and instance_name is not equal to Oracle_sid, Oracle automatically registers a listener process, which distinguishes between different instance.
Instance_name---Starting from 817 with this new parameter can be used, corresponding to the initialization parameter instance_name.

In this way, the parameters are very complicated, but we do not use the actual usage of course October is the better.

Second, the related parameter setting

I'll give you an example of how to set the parameters:
1. Environment variable: ORACLE_SID=RAC1/2

2, Initsid.ora:
Db_name=ora92
Service_names = Ora92
Instance_name=rac1/2
Global_names=false
Db_domain= ""

3, Listener.ora:
SID_LIST_RAC1 =
(Sid_list =
(Sid_desc =
(Global_dbname = ora92)
(Oracle_home =/oracle/oracle9/app/oracle/product/9.2.0)
(Service_name=ora92) (Sid_name = Rac1)
)
)

SID_LIST_RAC2 =
(Sid_list =
(Sid_desc =
(Global_dbname = ora92)
(Oracle_home =/oracle/oracle9/app/oracle/product/9.2.0)
(Service_name=ora92) (Sid_name = RAC2)
)
)

RAC1 =
(Description_list =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 10.1.3.1) (PORT = 1522))
)
)
)

RAC2 =
(Description_list =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 10.1.3.2) (PORT = 1522))
)
)
)

Third, the TAF setting
In fact, TAF setup is very simple, add failover=on in Tnsnames.ora, there are two different ways to set up:
1. Common one TNS name method: ==================================================
Myrac =
(description=
(Load_balance=on)
(Failover=on)
(Address= (PROTOCOL=TCP) (host=10.1.3.1) (port=1522))
(Address= (PROTOCOL=TCP) (host=10.1.3.2) (port=1522))
(Connect_data= (Service_name=ora92)
(Failover_mode= (Type=select) (Method=basic) (retries=20) (delay=20))
)
)
==========================================================================

2, indicating instance backup mode: ===============================================
Rac1 =
(description=
(Load_balance=on)
(Failover=on)
(Address= (PROTOCOL=TCP) (host=10.1.3.1) (port=1522))
(Connect_data= (Service_name=ora92)
(Failover_mode= (Type=select) (Method=basic)
(BACKUP=RAC2) (RETRIES=20) (DELAY=20))
)
)

RAC2 =
(description=
(Load_balance=on)
(Failover=on)
(Address= (PROTOCOL=TCP) (host=10.1.3.2) (port=1522))
(Connect_data= (Service_name=ora92)
(Failover_mode= (Type=select) (Method=basic)
(BACKUP=RAC1) (RETRIES=20) (DELAY=20))
)
)
==========================================================================

Four, TAF test method
The instance of the current connection can generally be down, the client side will not disconnect, and automatically switch to the backup node. Instead, it will automatically switch back.

Of course, some people propose to test the TAF in a post_transaction way, which is sometimes not expected, because Oracle is connected to a instance and thereafter it will give preference to the instance connection. When you disconnect, the client side will automatically attempt to connect to the nearest connected instance if a new request is made, and will attempt to connect to the backup instance if it is unsuccessful.





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.