Oracle Faq (Configuration of Oracle TAF) _php Tutorial

Source: Internet
Author: User
Tags failover taf
If you want to reprint, please specify the source! (Diao-Chan thanked him first ...) )
Configuration of Oracle Taf

TAF is transparent application failover abbreviation, the general application Taf is in the OPS/RAC environment. Starting from 8i has this function, the purpose and the idea are all very good, but at present the application is still very limited, this article will aim at the TAF related question to make a detailed discussion.

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

I. Description of relevant parameters

To be honest, Oracle. Several configuration parameters of the network are really too messy, many people can not understand what is going on, the common mistakes are:
"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 we need to get a few arguments:

Several parameters in the Initsid.ora:
Db_name---database name, which is provided when you build the databases.
Global_names---true/false, set whether to use the database domain name.
Db_domain---Database domain name, if global_names=true requires this parameter.
Service_names---service NAMES list, which can have multiple services names.

Instance_name---INSTANCE name, which is supported from 817, starting with the service_names, that is, starting from 817, you can separate databases, instances, and service names. The default instance_name value is the instance SID, which is the value of the environment variable ORACLE_SID. When there are no instance_name parameters before 817, different instance are distinguished by SID. According to oracle817 after the document explained: The SID is to distinguish the same host on the instance of the shared memory, not the only difference between instance, and instance_name is the difference between each instance.

Environment variables:
Oracle_sid---There are no instance_name parameters prior to 817, different instance are distinguished by SID (see the Initsid.ora parameter explanation above for a detailed explanation).

Several parameters in the Listener.ora:
Global_dbname---The global database name, uniquely identifying different databases in a distributed environment. Its value is the combination of db_name and db_domain in Initsid.ora, which is global_dbname=db_name. Db_domain, where db_domain is not needed if it is not set here. This parameter is explicitly specified in a distributed environment.
SERVICE_NAME---Service name, take Initsid.ora service_names list to one.
Sid_name---Corresponds to the value of the environment variable ORACLE_SID.
The instance_name---corresponds to the 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, can also be initialized parameter instance_name, when equal to instance_name and instance_name is not equal to Oracle_sid, Oracle automatically registers a listening 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 complex, but we do not use the fact that the October simple, the better.

Second, the relevant parameters set

Here I will give an example of the settings for the relevant 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 setting of TAF
In fact, TAF setup is simple, add failover=on in Tnsnames.ora, there are two different ways to set up:
1. Common one TNS name mode: ==================================================
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. Specify 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
You can generally instance the current connection down, the client side will not be disconnected, and automatically switch to the backup node. Instead, it will automatically switch back.

Of course, some people have proposed to test the TAF in a post_transaction way, in fact, this is sometimes not expected results, because Oracle connected to a instance, then it will first try to connect to the instance, When you disconnect, the client will automatically attempt to connect to the most recently connected instance, and if unsuccessful, attempt to connect to the backup instance.





http://www.bkjia.com/PHPjc/314196.html www.bkjia.com true http://www.bkjia.com/PHPjc/314196.html techarticle if you want to reprint, please specify the source! (Diao-Chan thanked him first ...) The configuration of Oracle Taf is TAF for transparent application failover, and the general application Taf is in the OPS/RAC environment. ...

  • 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.