7 Managing Database Workload Using Services

7 Managing Database Workload Using ServicesNote: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 DatabasesWhen 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 CalloutsFAN 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 applicationsRelocating low-priority services when high-priority services come onlineSending text or numeric messages to pagersExecuting shell scriptsThe 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 BalancingWhen 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 BalancingClient-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 BalancingWith 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参数.

,不要轻言放弃,否则对不起自己

7 Managing Database Workload Using Services

相关文章:

你感兴趣的文章:

标签云: