RAC之service——具体剖析

原文地址:http://blog.chinaunix.net/uid-25909722-id-3489826.html

在前一篇博文中 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:

  • A unique global name to identify the service. (全局唯一的服务名)

  • A Net Service name that a client uses to connect to the service.(网络服务名,在tnsnames.ora中用于客户端发起连接)

  • The preferred instances where you want the service to be enabled in a normal running environment.(提供service的首选实例)

  • The available instances where the service can be enabled if one of the preferred instances fails.(提供service的备用实例)

  • A service goal that determines whether connections are made to the service based on best service quality (how efficiently a single transaction completes) or best throughput (how efficiently a complete job or long-running query completes), as determined by the load balancing advisory.(load balancing advisory的使用的来进行负载均衡度量)

  • An indicator that determines whether the service is used for distributed transactions.(一个service是否可以进行分布式事物的标记)

  • An indicator that determines whether Oracle RAC high availability events are sent to OCI and ODP.NET clients that have registered to receive them through Advanced Queuing.(FAN是否可以使用AQ的标记)

  • The characteristics of session failovers such as whether failovers occur, whether sessions can use pre-existing connections on the failover instance, and whether failed over sessions can continue to process interrupted queries. The service definition can also define the number of times that a failed session attempts to reconnect to the service and how long it should wait between reconnection attempts. The service definition can also include a connection load balancing goal that informs the Listener how to balance connection requests across the instances that provide the service. (service中的failover相关的属性)

  • The method for load balancing connections for each service. This method is used by the Listener when Oracle creates connections. Connections are classified as LONG (such as connection pools and SQL*FORMS) which tells the Listener to use session based, or SHORT which tells the Listener to use CPU based. If load balancing advisory is enabled, its information will be use to balance connections otherwise CPU utilization is used.(service中的connection load balancing相关的属性)

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 environmentsBy 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 transactionsChoose one DTP service for one distributed transactionChoose 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.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值