RAC之service——具体剖析

2540阅读 0评论2013-02-16 digdeep126
分类:Oracle

在前一篇博文中http://blog.chinaunix.net/uid-25909722-id-3489695.html,我们初略的描述了RAC的两大关键特性HA和LB,以及他们的各种配置方法。而且对service进行了总体的概述,并对service相关的connection load balancing, load balancing advisory, FAN等LB属性进行了学习。oracle推荐使用service来进行负载管理,使用service来配置HA和LB。本文主要来剖析service,学习service具有的所有属性。包括HA相关的属性,以及分布式事务相关属性

1. service属性具体剖析

When you create and administer services, you are dividing the work that your database performs into manageable units

When you create new services for your database, you should define each service's workload management characteristics. The characteristics of a service include:

service的具体属性如下:
The CREATE_SERVICE procedure adds a new service to the Oracle RAC database. 
In the CREATE_SERVICE syntax:
service_name is the unique, global service name, 
network_name is the TNS name for connections to the service, 
goal sets the workload management goal directive to service quality or throughput, 
dtp is the distributed transaction flag, 
aq_ha_notification is the flag to send Oracle RAC high availability events to registered OCI clients, failover_method is the TAF failover method for the service, 
failover_type is the TAF failover method for the service, 
failover_retries is the TAF connection retry count, 
failover_delay is the wait time between TAF connection retries, and 
clb_goal sets the connection load balancing goal. 
When using services with Oracle RAC, add the high availability properties, such as the PREFERRED and AVAILABLE placement, using Enterprise Manager, DBCA or SRVCTL.

service的这些属性可以分为几类:

1> service的两个名字,service_name和net_service_name;

2> service的LB相关的两个goal:connection load balancing和load balancing advisory

3> service的HA相关的4个failover属性;

4> service的HA相关的提供服务的实例:prefered instance和available instance;

5> dtp分布式属性;
You can create and administer services with Enterprise Manager, DBCA, and the DBMS_SERVICE PL/SQL package, and you can perform most service administration tasks with the SRVCTL utility. 

2. service之DTP(distributed transaction processing)

All tightly coupled branches of a distributed transaction running on an Oracle RAC database must run on the same instance. 

In addition, connection pools at the application server tier that load balance across multiple connections to an Oracle RAC database must ensure that all tightly-coupled branches of a global distributed transaction run on only one Oracle RAC instance. This is also true in distributed transaction environments using protocols such as X/Open Distributed Transaction Processing (DTP) or the Microsoft Distributed Transaction Coordinator (DTC).

To simplify the deployment of distributed transactions, you can use services to manage DTP environments. By defining the DTP property of a service, the service is guaranteed to run on one instance at a time in an Oracle RAC database. All global distributed transactions performed through the DTP service are ensured to have their tightly-coupled branches running on a single Oracle RAC instance. This preserves the integrity for distributed transactions.

To leverage all of the instances in a cluster, create one or more DTP services for each Oracle RAC instance that hosts distributed transactions. Choose one DTP service for one distributed transaction. Choose different DTP services for different distributed transactions to balance the workload among the Oracle RAC database instances. 

For services that you are going to use for distributed transaction processing, create the service using Enterprise Manager, DBCA, or SRVCTL and define only one instance as the preferred instance. You can have as many AVAILABLE instances as you want.

上一篇:RAC之service——负载均衡与高可用(LB和HA)
下一篇:ORA-16014错误一例