7 Managing Database Workload Using Services,managingworkload

來源:互聯網
上載者:User

7 Managing Database Workload Using Services,managingworkload
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參數.

相關文章

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.