Oracle FAQ (Oracle TAF configuration)

Source: Internet
Author: User
Tags failover taf


If you need to reprint it, please indicate the source! (Thank you first ......)
Configuration of Oracle 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"
The essence is the same. To solve this problem, we need to consider 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. If db_domain is not set here, it is unnecessary. We recommend that you specify this parameter in a distributed environment.
SERVICE_NAME --- Service name, which must be set to service_names list 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 set to service_names list 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 complicated, but we will not actually use them. Of course, October is as simple as possible.

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.

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.