7 Managing Database Workload Using Services, managingworkload

Source: Internet
Author: User
Tags failover

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 strongrong 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.
You can define a database service managed by policy-managed and administrator-managed at the same time.


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.
----- If you select the database as Administrator-managed, you can define the PREFERRED instance. If the PREFERRED instance fails, you can transfer it to another instance.


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.

----- Note: if the service fails on the active instance, the service cannot be automatically returned to the previous preferred instance. however, you can use FAN callout to automatically switch the service to its preferred instance !!!!

That is, the automatic switch service can be achieved through scripts.





About FAN Callouts


FAN callouts are server-side executable files that Oracle RAC runs immediately when high availability events occur. A callout is essential a shell script or precompiled executable written in any programming language. some examples of how you can use FAN callouts to automate the actions timed med 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.
----- The FAN callout script is placed under Grid_home/racg/usrco. If the subdirectory does not exist, you must create one with the same permissions and group as 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 shoshould 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.
------ If you use the service name to connect to the RAC database, you can use the connection replication balancing function. there are two types of server Load balancer: client-side and server-side. in the RAC database, there are two types of client connection
When you create an oracle database using DBCA, DBCA automatically configures and enables server-side server Load balancer by default.




About Client-Side Load Balancing
Client-side load balancing balances the connection requests ss the listeners. When the listener requests es 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 internal ss 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.
---- When you use DBCA to create a RAC database, DBCA automatically defines an example of Server Load balancer in tnsnames. ora.
Client-side load balancing between des 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 Server Load balancer contains the connected 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 specified SS 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 instances SS 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.
By default, any default service created through DBCA will use persistent connection Server Load balancer.


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.


Note: if you do not use the DBCA database or the listening port is not the default port (1521), you must configure the LOCAL_LISTENER and REMOTE_LISTENER parameters.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.