7 Managing Database Workload Using Services
Note:
A database service can only be offered on a single network.
Caution:
By default, any named user may create a server pool. To restrict the operating system users that have this privilege, Oracle strongly recommends that you add specific users to the CRS Administrators list. See Oracle Clusterware Administration and Deployment Guide for more information about adding users to the CRS Administrators list.
You can define services for both policy-managed and administrator-managed databases.
你可以同时定义一个policy-managed和administrator-managed管理的数据库服务.
Policy-managed database: When you define services for a policy-managed database, you assign the service to a server pool where the database is running. You can define the service as either uniform (running on all instances in the server pool) or singleton (running on only one instance in the server pool).
Administrator-managed database: When you define a service for an administrator-managed database, you define which instances normally support that service.These are known as the PREFERRED instances. You can also define other instances to support a service if the preferred instance fails. These are known as AVAILABLE instances.
-----如果选择为Administrator-managed的数据库,可以定义首选(PREFERRED)实例,如果首选实例失败,可以转移到其他实例上.
About Service Failover in Administrator-Managed Databases
When you specify a preferred instance for a service, the service runs on that instance during normal operation. Oracle Clusterware attempts to ensure that the service always runs on all the preferred instances that have been configured for a service. If the instance fails, then the service is relocated to an available instance. You can also manually relocate the service to an available instance.
If a service fails over to an available instance, then the service is not moved back to its preferred instance automatically. However, you can automate the relocation of a service to its preferred instance by using a callout.
-----注意:如果在活动的实例上服务失败,服务不能够自动返回到先前的首选实例.但是,你可以通过FAN callout自动的切换服务到他的首选实例!!!!
也就是所要通过脚本才能实现自动切换的服务.
About FAN Callouts
FAN callouts are server-side executable files that Oracle RAC runs immediately when high availability events occur. A callout is essentially a shell script or precompiled executable written in any programming language. Some examples of how you can use FAN callouts to automate the actions performed when events occur in a cluster configuration are as follows:
Starting and stopping server-side applications
Relocating low-priority services when high-priority services come online
Sending text or numeric messages to pagers
Executing shell scripts
The executable files for FAN callouts are stored in the Grid_home/racg/usrco subdirectory. If this subdirectory does not exist in your Grid home, then you must create this directory with the same permissions and ownership as the Grid_home/racg/tmp subdirectory.
-----FAN callout的脚本放在Grid_home/racg/usrco下面.如果子目录不存在,你必须要建立一个相同权限和属组的,和Grid_home/racg/tmp一样.
About Connection Load Balancing
When the client connects to the cluster database using a service, you can use the Oracle Net connection load balancing feature to spread user connections across all the instances that are supporting that service. There are two types of load balancing that you can implement: client-side and server-side load balancing. In an Oracle RAC database, client connections should use both types of connection load balancing. When you create an Oracle RAC database using Oracle Database Configuration Assistant (DBCA), DBCA configures and enables server-side load balancing by default.
------如果使用服务名连接到RAC数据库,就可以使用连接复制均衡的功能.有两种类型的负载均衡:client-side和server-side.在RAC数据库中,客户端连接应该使用两种类型
的连接负载均衡.当你使用DBCA创建了一个oracle数据库,DBCA默认会自动配置并启用server-side的负载均衡.
About Client-Side Load Balancing
Client-side load balancing balances the connection requests across the listeners. When the listener receives the connection request, the listener connects the user to an instance that the listener knows provides the requested service.
Client-side load balancing is defined in your client connection definition by setting the parameter LOAD_BALANCE=yes in the tnsnames.ora file. When you set this parameter to yes, the Oracle client randomly selects an address from the address list, and connects to that node‘s listener. This balances client connections across the available listeners in the cluster.
When you create an Oracle RAC database using DBCA, the assistant creates a sample load balancing connection definition in the tnsnames.ora file.
----当你使用DBCA创建了一个RAC数据库,DBCA会自动在tnsnames.ora定义一个负载均衡的例子.
Client-side load balancing includes connection failover. With connection failover, if an error is returned from the chosen address, then Oracle Net Services tries the next address in the address list until either a successful connection is made or it has exhausted all the addresses in the list.
-----client-side负载均衡包含了连接的failover.
About Server-Side Load Balancing
With server-side load balancing, the listener directs a connection request to the best instance currently providing the service by using information from the Load Balancing Advisory.
For each service, you can define the method the listener uses for load balancing by setting the connection load balancing goal. You can use a goal of either long or short for connection load balancing. These goals have the following characteristics:
Short—Connections are distributed across instances based on the amount of time that the service is used. Use the Short connection load balancing goal for applications that have connections of brief duration.
Long—Connections are distributed across instances based on the number of sessions in each instance, for each instance that supports the service. Use the Long connection load balancing goal for applications that have connections of long duration. This is typical for connection pools and SQL*Forms sessions. Long is the default connection load balancing goal.
Any services created by using DBCA use the Long connection load balancing goal by default.
默认情况下任何通过DBCA创建的默认的服务都会使用长连接负载均衡
Note:
If you did not use DBCA to create your database, or if you are using listener ports other than the default of 1521, then you must configure the LOCAL_LISTENER and REMOTE_LISTENER database initialization parameters for your cluster database to point to SCAN:port.
注意:如果你不是使用DBCA建库或者监听端口为非默认端口(1521),就必须要配置LOCAL_LISTENER,REMOTE_LISTENER参数.
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。