Configuration of Oracle TAF

Source: Internet
Author: User
Tags taf
TAF is short for transparent application failover. Generally, the application TAF is in the OPS/RAC environment. The purpose and idea of this function from 8i are both good, but the current application is still very limited. This article will give a detailed discussion on TAF-related issues.

The test environment in this article is Tru64 v5.1 + oracle9.2.0.1 RAC.


1. Description of relevant parameters
To be honest, several network configuration parameters in Oracle are too messy. Many people cannot figure out what is going on. The common errors are:
"ORA-12514: TNS: Listener cocould not resolve SERVICE_NAME given in connect descriptor" and "ORA-12154: TNS: cocould not resolve service name" are essentially the same, to solve this problem, we need to clarify several parameters:

Several parameters in initsid. ora:
Db_name --- database name, that is, the name provided during database creation.
Global_names --- true/false, set whether to use the database domain name.
Db_domain --- database domain name. This parameter is required if global_names = true.
Service_names --- Service names list, which has multiple service names.

Instance_name --- Instance name, which is supported from 817 as service_names. That is, the names of databases, instances, and services can be separated from 817. The default instance_name value is the SID of the instance, that is, the value corresponding to the environment variable oracle_sid. When the instance_name parameter is not set before 817, different instances are distinguished by SID. According to the documents after oracle817, Sid is used to differentiate the shared memory of each instance on the same host. It is not the only difference between instances, but instance_name is used to differentiate instances.

Environment variable:
ORACLE_SID --- when the instance_name parameter is not set before 817, different instances are distinguished by SID (for details, see the initsid. ora parameter description above ).

Parameters in listener. ora:
GLOBAL_DBNAME --- global database name, which uniquely identifies different databases 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 required if it is not set here. We recommend that you specify this parameter in a distributed environment.

SERVICE_NAME --- Service name, which must be one of service_names lists in initsid. ora.
SID_NAME --- value of the corresponding environment variable ORACLE_SID.
INSTANCE_NAME --- corresponds to the initialization parameter instance_name.

Several parameters in tnsnames. ora:
Service_name --- Service name, which must be one of service_names lists in initsid. ora. Sid_name --- it can be abbreviated to sid, corresponding to ORACLE_SID, or the initialization parameter instance_name. When it is set to instance_name and instance_name is not set to ORACLE_SID, oracle automatically registers a listening process, this is used to differentiate different instances. Instance_name --- this new parameter can be used from 817, corresponding to the initialization parameter instance_name. In this way, the parameters are very complex, but we will not use them. Of course, the simpler the better.
 


Ii. related parameter settings
The following is an example of how to set 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 ))
)
)
)
 


3. TAF settings
In fact, the TAF setting is very simple. Add failover = on to tnsnames. ora. There are two different setting methods:

1. Public A 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. Specify the instance backup method:
======================================
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 ))
)
) ========================================

Iv. TAF Testing Method
Generally, the connected instance can be down, and the client will not be disconnected and automatically switch to the backup node. On the contrary, it will automatically switch back. Of course, some people have suggested using post_transaction to test TAF. In fact, this is sometimes not the expected result, because after Oracle connects to an instance, later, it will give priority to the connection to this instance. When you disconnect, the client automatically tries to connect to the instance with the latest connection as soon as there is a new request, if the connection fails, the system tries to connect to the backup instance.

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.