Oracle Faq (Configuration of Oracle TAF)

Source: Internet
Author: User
Tags failover connect taf domain domain name client backup
If you want to reprint Oracle, please specify the source! (Diao greedy first thanked ...) )


Oracle TAF configuration





TAF is the abbreviation for transparent application failover, and the general application Taf is in 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.





one, the correlation parameter explanation





tell the truth. Oracle about the network configuration parameters are really too messy, a lot of people are not clear 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"


essence is the same, to solve such problems need us to make a few parameters:




Several parameters in
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 variable:


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




Several parameters in
Listener.ora:


global_dbname---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 value of the corresponding environment variable ORACLE_SID.


instance_name---Corresponding initialization parameter instance_name.




Several parameters in
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.





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





two, related parameter setting





below I will give an example of the setting of the related 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))


)


)


)





three, TAF settings


In fact TAF setting is very simple, add failover=on in Tnsnames.ora, there are two different ways to set up:


1, common one TNS name way: ==================================================


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


typically instance down the current connection, the client side will not disconnect, and automatically switch to the backup node. Instead, it will automatically switch back.





of course, some people also proposed to test the TAF in a post_transaction way, in fact, this is sometimes not the expected result, because Oracle is connected to a instance after, it will first attempt to connect to the instance, 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.