Title of Invention

ON DEMAND NODE AND SERVER INSTANCE ALLOCATION AND DE-ALLOCATION

Abstract An approach efficiently and dynamically allocates and de-allocates database instances and nodes between databases. The approach performs this function in a way that accounts for the users of and services hosted by multiple databases.
Full Text ON DEMAND NODE AND SERVER INSTANCE ALLOCATION AND DE-ALLOCATION
RELATED APPLICATIONS
[0001] The present application claims priority to U.S. Provisional Application No.
60/495,368, Computer Resource Provisioning, filed on August 14, 2003, which is
incorporated herein by reference; the present application claims priority to U.S.
Provisional Application No. 60/500,096, Service Based Workload Management and
Measurement in a Distributed System, filed on September 3, 2003, which is incorporated
herein by reference; the present application claims priority to U.S. Provisional
Application No. 60/500,050, Automatic And Dynamic Provisioning Of Databases, filed
on September 3, 2003, which is incorporated herein by reference.
[0002] The present application is related to the following U.S. Applications:
[0003] U.S. Application No. XX/XXX,XXX, On Demand Node and Server Instance
Allocation and De-Allocation (Attorney Docket No. 50277-2413), filed by
Lakshminarayan Chidambaran, et al. on August 12, 2004 and incorporated herein by
reference;
[0004] U.S. Application No. 10/718,747, Automatic and Dynamic Provisioning of
Databases (Attorney Docket No. 50277-2343), filed on 11/21/2003, which is incorporated
herein by reference;
[0005] U.S. Application No. XX/XXX,XXX, Hierarchical Management of the
Dynamic Allocation of Resources in a Multi-Node System (Attorney Docket No. 50277-
2382), filed by Benny Souder, et al. on August 12, 2004, and incorporated herein by
reference;
[0006] U.S. Application No. XX/XXX,XXX, Transparent Session Migration Across
Servers (Attorney Docket No. 50277-2383), filed by Sanjay Kaluskar, et al. on August 12,
2004, and incorporated herein by reference;
50277-2595 (OID 2003-323-01-PCT)

([0007] U.S. Application No. XX/XXX,XXX, Calculation of Service Performance Grades in a Multi-Node Environment That Hosts the Services (Attorney Docket No. 50277-2410), filed by Lakshminarayanan Chidambaran, et al. on August 12, 2004, and incorporated herein by reference;
[0008] U.S. Application No. XX/XXX,XXX, Incremental Run-Time Session Balancing in a Multi-Node System (Attorney Docket No. 50277-2411) filed by Lakshminarayanan Chidambaran, et al. on August 12, 2004, and incorporated herein by reference;
[0009] U.S. Application No. XX/XXX,XXX, Service Placement for Enforcing Performance and Availability Levels in a Multi-Node System (Attorney Docket No. 50277-2412), filed by Lakshminarayanan Chidambaran, et al. on August 12, 2004, and incorporated herein by reference;
[0010] U.S. Application No. XX/XXX,XXX, Recoverable Asynchronous Message Driven Processing in a Multi-Node System (Attorney Docket No. 50277-2414), filed by Lakshminarayanan Chidambaran, et al. on August 12, 2004, and incorporated herein by reference; and
[0011] U.S. Application No. XX/XXX,XXX, Managing Workload by Service (Attorney Docket No. 50277-2337), filed by Carol Colrain, et al. on August 12, 2004, and incorporated herein by reference.
[0012] The present application is related to the following International Applications: [0013] International Application No. PCT/XXXX/XXXXX, entitled Automatic and Dynamic Provisioning of Databases (Attorney Docket No. 50277-2571), filed on August 9, 2004 by Oracle International Corporation at the United States Receiving Office and which is incorporated herein by reference;
50277-2595 (OID 2003-323-01 -PCT)

, [0014] International Application No. PCT/XXXX/XXXXX, Hierarchical Management of the Dynamic Allocation of Resources in a Multi-Node System (Attorney Docket No. 50277-2592), filed on August 13, 2004 by Oracle International Corporation at the United States Receiving Office and which is incorporated herein by reference; [0015] International Application No. PCT/XXXX/XXXXX, Transparent Session Migration Across Servers (Attorney Docket No. 50277-2593), filed on August 13, 2004 by Oracle International Corporation at the United States Receiving Office and which is incorporated herein by reference; and
[0016] INTERNATIONAL Application No. PCT/XXXX/XXXXX, Transparent Migration of Stateless Sessions Across Servers (Attorney Docket No. 50277-2594), filed on August 13, 2004 by Oracle International Corporation at the United States Receiving Office and which is incorporated herein by reference.
FIELD OF THE INVENTION
[0017] The present invention relates to work load management, and in particular,
work load management within a multi-node computer system.
BACKGROUND OF THE INVENTION
[0018] Enterprises are looking at ways of reducing costs and increasing efficiencies of their data processing system. A typical enterprise data processing system allocates individual resources for each of the enterprise's applications. Enough resources are acquired for each application to handle the estimated peak load of the application. Each application has different load characteristics; some applications are busy during the day; some others during the night; some reports are run once a week and some others once a month. As a result, there is a lot of resource capacity that is left unutilized. Grid
50277-2595 (OID 2003-323-01-PCT)

computing enables the utilization or elimination of this unutilized capacity. In fact, grid computing is poised to drastically change the economics of computing. [0019] A grid is a collection of computing elements that provide processing and some degree of shared storage; the resources of a grid are allocated dynamically to meet the computational needs and priorities of its clients. Grid computing can dramatically lower the cost of computing, extend the availability of computing resources, and deliver higher productivity and higher quality. The basic idea of grid computing is the notion of computing as a utility, analogous to the electric power grid or the telephone network. A client of the grid does not care where its data is or where the computation is performed. All a client wants is to have computation done and have the information delivered to the client when it wants.
[0020] This is analogous to the way electric utilities work; a customer does not know where the generator is, or how the electric grid is wired. The customer just asks for electricity and gets it. The goal is to make computing a utility — a ubiquitous commodity. Hence it has the name, the grid.
[0021] This view of grid computing as a utility is, of course, a client side view. From the server side, or behind the scenes, the grid is about resource allocation, information sharing, and high availability. Resource allocation ensures that all those that need or request resources are getting what they need. Resources are not standing idle while requests are left unserviced. Information sharing makes sure that the information clients and applications need is available where and when it is needed. High availability ensures that all the data and computation must always be there — just as a utility company must always provide electric power.
Grid Computing for Databases
50277-2595 (OID 2003-323-01-PCT)

[0022] One area of computer technology that can benefit from grid computing is database technology. A grid can support multiple databases and dynamically allocate and reallocate resources as needed to support the current demand for each database. As the demand for a database increases, more resources are allocated for that database, while other resources are deallocated from another database. For example, on an enterprise grid, a database is being serviced by one database server running on one server blade on the grid. The number of users requesting data from the database increases. In response to this increase in the demand for the database, a database server for another database is removed from one server blade and a database server for the database experiencing increased user requests is provisioned to the server blade.
[0023] Grid computing for databases can require allocation and management of resources at different levels. At a level corresponding to a single database, the performance and availability of resources provided to the users of the database must be monitored and resources of the database allocated between the users to ensure performance and resource availability goals for each of the users are met. Between databases, the allocation of a grid's resources must be managed to ensure that performance and resource availability goals for users of all the databases are met. The work to manage allocation of resources at these different levels and the information needed to perform such management is very complex. Therefore, there is a need for a mechanism that simplifies and efficiently handles the management of resources in a grid computing system for database systems as well as other types of systems that allocate resources at different levels within a grid.
[0024] One such mechanism is the system described in Hierarchical Management of the Dynamic Allocation of Resources in a Multi-Node System (50277-2382), which uses a hierarchy of directors to manage resources at different levels. One type of director, a
50277-2595 (OID 2003-323-01-PCT)

database director, manages resources allocated to a database among users of the database. For example, a grid may host a group of database servers for a database. Each database server in the group is referred to as a database instance. Each database instance hosts a number of database sessions for users and one or more services. The database director manages the allocation of resources available to a database among users and services. [0025] A service is work of a particular type or category that is hosted for the benefit of one or more clients. The work performed as part of a service includes any use or expenditure of computer resources, including, for example, CPU processing time, storing and accessing data in volatile memory, reads and writes from and to persistent storage (i.e. disk space), and use of network or bus bandwidth. A service may be, for example, work that is performed for a particular application on a client of a database server. [0026] For a database, a subset of the group of database instances is allocated to provide a particular service. A database instance allocated to provide the service is referred to herein as hosting the service. A database instance may host more than one service. A service hosted by a database instance of a database is referred to herein as being hosted by the database.
[0027] The performance and availability of resources realized by a service hosted by a database may at times not meet requirements for performance and availability of resources. When this situation occurs, another database instance and a node to host the database instance may be allocated within the grid to the database. Often, the only pool of nodes available to allocate to the database are already being used for other databases and services. Allocating the node to the database thus requires de-allocating the node from another database, which impacts the performance and availability of resources realized by the services hosted on the other database.
50277-2595 (OID 2003-323-01-PCT)

[0028] Based on the foregoing, it is desirable to have an approach that de-allocates a node from a pool of nodes already allocated to a set of databases in a way that accounts for and accommodates the performance and resource availability for the users of services hosted by the set of databases.
[0029] Approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.

BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The present invention is illustrated by way of example, and not by way of
limitation, in the figures of the accompanying drawings and in which like reference
numerals refer to similar elements and in which:
[0031] FIG. 1 is a block diagram showing a multi-node computer system on which an
embodiment of the present invention may be implemented.
[0032] FIG. 2 is a flow chart showing a procedure managing the escalation of
remedies employed to resolve violations of service-level agreements.
[0033] FIG. 3 is a flow chart showing a procedure for responding to a request to get
another database instance for a database according to an embodiment of the present
invention.
[0034] FIG. 4 is a flow chart showing a procedure for shutting down and bringing up
another database instance on a node according to an embodiment of the present invention.
[0035] FIG. 5 is a flow chart depicting a procedure for determining whether to
volunteer a database instance for quiescing according an embodiment of the present
invention.
[0036] FIG. 6 is a flow chart depicting a procedure used for quiescing a database
instance according to an embodiment of the present invention.
[0037] FIG. 7 is a block diagram of a computer system that may be used in an
embodiment of the present invention.

DETAILED DESCRIPTION OF THE INVENTION
[0038] A method and apparatus for managing the allocation of resources in a multi-node environment is described. In the following description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present invention. It will be apparent, however, that the present invention may be practiced without these specific details. In other instances, well-known structures and devices are shown in block diagram form in order to avoid unnecessarily obscuring the present invention.
[0039] Described herein is an approach for efficiently and dynamically allocating and de-allocating database instances and nodes between databases. The approach performs this function in a way that accounts for the users of and services hosted by multiple databases.
[0040] FIG. 1 shows a multi-node computer system that may be used to implement an embodiment of the present invention. Referring to Fig. 1, it shows cluster farm 101. A cluster farm is a set of nodes that is organized into groups of nodes, referred to as clusters. Clusters provide some degree of shared storage (e.g. shared access to a set of disk drives) between the nodes in the cluster. Cluster farm 101 includes clusters 110, 170, and 180. Each of the clusters hosts one or more multi-node database servers that provide and manage access to databases.
[0041] The nodes in a cluster farm may be in the form of computers (e.g. work stations, personal computers) interconnected via a network. Alternately, the nodes may be the nodes of a grid. A grid is composed of nodes in the form of server blades interconnected with other server blades on a rack. Each server blade is an inclusive computer system, with processor, memory, network connections, and associated electronics on a single motherboard. Typically, server blades do not include onboard
50277-2595 (OID 2003-323-01 -PCT)

storage (other than volatile memory), and they share storage units (e.g. shared disks) along with a power supply, cooling system, and cabling within a rack. [0042] A defining characteristic of a cluster in a cluster farm is that the cluster's nodes may be automatically transferred between clusters within the farm through software control without the need to physically reconnect the node from one cluster to another. A cluster farm is controlled and managed by software utilities referred to herein as clusterware. Clusterware may be executed to remove a node from a cluster and to provision the node to a cluster. Clusterware provides a command line interface that accepts requests from a human administrator, allowing the administrator to enter commands to provision and remove a node from a cluster. The interfaces may also take the form of Application Program Interfaces ("APIs"), which may be called by other software being executed within the cluster farm. Clusterware uses and maintains metadata that defines the configuration of a cluster within a farm, including cluster configuration metadata, which defines the topology of a cluster in a farm, including which particular nodes are in the cluster. The metadata is modified to reflect changes made to a cluster in a cluster farm by the clusterware. An example of clusterware is software developed by Oracle™, such as Oracle9i Real Application Clusters or Oracle Real Application Clusters 10g. Oracle9i Real Application Clusters is described in Oracle9i RAC: Oracle Real Application Clusters Configuration and Internals, by Mike Ault and Madhu Tumma, 2nd edition (August 2, 2003).
Clusters and Multi-node Database Servers
[0043] Clusters 110, 170, and 180 host one or more multi-node database servers. Cluster 110 hosts a multi-node database server for database 150, the multi-node database server comprising database instances 123, 125, and 127, which are hosted on nodes 122, 124, and 126, respectively. Cluster 110 also hosts a multi-node database server for
50277-2595 (OID 2003-323-01 -PCT)

database 160, the multi-node database server comprising database instances 133, 135, and 137 hosted on nodes 132, 134, and 136, respectively.
[0044] A server, such as a database server, is a combination of integrated software components and an allocation of computational resources, such as memory, a node, and processes on the node for executing the integrated software components on a processor, the combination of the software and computational resources being dedicated to performing a particular function on behalf of one or more clients. Among other functions of database management, a database server governs and facilitates access to a particular database, processing requests by clients to access the database. [0045] Resources from multiple nodes in a multi-node computer system can be allocated to running a particular server's software. Each combination of the software and allocation of the resources from a node is a server that is referred to herein as a "server instance" or "instance". Thus, a multi-node server comprises multiple server instances that can run on multiple nodes. Several instances of a multi-node server can even run on the same node. A multi-node database server comprises multiple "database instances", each database instance running on a node, and governing and facilitating access to a particular database. Database instances 123, 125, and 127 are instances of the same multi-node database server.
Services
[0046] As mentioned before, a service is work of a particular type or category that is hosted for the benefit of one or more clients. One type of service is a database service. Cluster 110 provides a database service for accessing database 150 and a database service for accessing database 160. In general, a database service is work that is performed by a database server for a client, work that typically includes processing queries that require access to a particular database.
50277-2595 (OID 2003-323-01 -PCT)

[0047] Like any service, a database service may be further categorized. Database services for database 150 are further categorized into the FIN service and PAY service. The FIN service is the database service performed by database instances 123 and 125 for the FIN application. Typically, this service involves accessing database objects on database 150 that store database data for FIN applications. The PAY services are database services performed by database instances 125 and 127 for the PAY application. Typically, this service involves accessing database objects on database 150 that store database data for PAY applications.
Sessions
[0048] In order for a client to interact with a database server on cluster 110, a session is established for the client. A session, such as a database session, is a particular connection established for a client to a server, such as a database instance, through which the client issues a series of requests (requests for execution of database statements). For each database session established on a database instance, session state data is maintained that reflects the current state of a database session. Such information contains, for example, the identity of the client for which the session is established, and temporary variable values generated by processes executing software within the database session. [0049] A client establishes a database session by transmitting a database connection request to cluster 110. A listener, such as listener 190, receives the database connection request. Listener 190 is a process running on cluster 110 that receives client database connection requests and directs them to a database instance within cluster 110. The client connection requests received are associated with a service (e.g. service FIN and PAY). The client request is directed to a database instance hosting the service, where a database session is established for the client. Listener 190 directs the request to the particular database instance and/or node in a way that is transparent to the client. Listener 190 may
50277-2595 (OID 2003-323-01-PCT)

Be running on any node within cluster 110. Once the database session is established for the client, the client may issue additional requests, which may be in the form of function or remote procedure invocations, and which include requests to begin execution of a transaction, to execute queries, to perform updates and other types of transaction operations, to commit or otherwise terminate a transaction, and to terminate a database session.
Monitoring Workload
[0050] Resources are allocated and re-allocated to meet levels of performance and cardinality constraints on the resources. Levels of performance and resource availability established for a particular service are referred to herein as service-level agreements. Levels of performance and cardinality constraints on resources that apply to a multi-node system in general and not necessarily to a particular service are referred to herein as policies. For example, a service-level agreement for service FIN may require as a level of performance that the average transaction time for service FIN be no more than a given threshold, and as an availability requirement that at least two instances host service FIN. A policy may require that the CPU utilization of any node should not exceed 80%. [0051] Policies may also be referred to herein as backend policies because they are used by backend administrators to manage overall system performance and to allocate resources between a set of services when it is deemed there are insufficient resources to meet service-level agreements of all the set of services. For example, a policy assigns a higher priority to a database relative to another database. When there are insufficient resources to meet service-level agreements of services of both databases, the database with the higher priority, and the services that use the database, will be favored when allocating resources.
50277-2595 (OID 2003-323-01-PCT

[0052] To meet service-level agreements, a mechanism is needed to monitor and measure workload placed on various resources. These measures of workload are used to determine whether service-level agreements are being met and to adjust the allocation of resources as needed to meet the service-level agreements.
(0053] According to an embodiment of the present invention, a workload monitor is hosted on each database instance and generates "performance metrics". Performance metrics is data that indicates the level of performance for one or more resources or services based on performance measures. Approaches for performing these functions are described in Measuring Workload by Service (50277-2337). The information generated is accessible by various components within multi-node database server 222 that are responsible for managing the allocation of resources to meet service-level agreements, as shall be described in greater detail later.
[0054] A performance metric of a particular type that can be used to gauge a characteristic or condition that indicates a level of performance or workload is referred to herein as a performance measure. A performance measure includes for example, transaction execution time or percent of CPU utilization. In general, service-level agreements that involve levels of performance can be defined by thresholds and criteria that are based on performance measures.
[0055] For example, execution time of a transaction is a performance measure. A service-level agreement based on this measure is that a transaction for service FIN should execute within 300 milliseconds. Yet another performance measure is percentage CPU utilization of a node. A backend policy based on this measure is that a node experience no more than 80% utilization.
[0056] Performance metrics can indicate the performance of a cluster, the performance of a service running on a cluster, a node in the cluster, or a particular
50277-2595 (OID2003-323-01-PCT)

Database instance. A performance metric or measure particular to a service is referred to herein as a service performance metric or measure. For example, a service performance measure for service FIN is the transaction time for transactions executed for service FIN. [0057] According to an embodiment, service-level agreements and backend policies are based on the following.
[0058] Service or Database Cardinality A service-level agreement or backend policy can restrict the number of resources that can be allocated for a particular use. Such constraints are referred as a cardinality constraint. A service cardinality constraint requires that a minimum and/or maximum number of database instances host a service; a database cardinality constraint requires that a minimum and/or maximum number of database instances for a database be running. Cardinality constraints can also limit the number of nodes in a cluster.
[0059] Service or Database Priority Some services or databases may be designated as having a higher priority than others. Preference is given to higher priority services or databases when allocating resources, particularly when there are insufficient resources to meet service-level agreements of all of a set of services or databases. Priority information may be supplied by database administrators.
[0060] Ncpu Percent CPU utilization of a node. Percent CPU utilization may be calculated by summing the percent CPU utilization of services hosted on a database instance residing on a node.
[0061] Xcpu A policy in the form of a threshold CPU utilization for a node. For purposes of illustration, Xcpu is constant for all nodes in a cluster. However, it may be variable, depending on various factors, such as the number of database instances running for a database.

[0062] CPUavai This is the available unused CPU utilization on a node, which is defined as the difference between [0063] Availability Availability is a subcategory of cardinality in that it is the minimum number of resources that should be available for a particular use. For example, a service availability requirement requires that a service be hosted by at least a minimum number of database instances.
[0064] Availability is monitored by daemon processes referred to as availability monitors. Availability monitors, such as availability monitor 192, are daemons that detect when a node or database instance becomes unavailable due to an unavailability event, such as a system crash. When detecting that a node or database instance has become unavailable, an availability monitor informs a database director and/or cluster director of the affected services and nodes. The directors initiate actions to achieve compliance to availability requirements. For example, an availability requirement requires that PAY be hosted on at least two database instances. Availability monitor 192 detects that instance 125 has gone down and informs database director 152. In response, database director 152 initiates service expansion to expand service PAY to a second running database instance, database instance 123.
Hierarchy Of Directors
[0065] A hierarchy of directors, such as that described in Hierarchical Management of the Dynamic Allocation of Resources in a Multi-Node System (50277-2382), is used to dynamically adjust the allocation of resources within cluster farm 101 to meet service-level agreements. Cluster farm 101 includes a database director for each database managed by a database server on cluster farm 101, a cluster director for each cluster within cluster farm 101, and a farm director for cluster farm 101.

[0066] A database director, such as database director 152 and 162, dynamically manages and adjusts the allocation of resources of a database between services hosted by the database instances of the database. One measure a database director uses to perform this responsibility is to perform incremental runtime session balancing between the database instances of a database as described in Incremental Run-Time Session Balancing in a Multi-Node System (50277-2411). Incremental runtime session balancing migrates the database sessions of a service between databases instances hosting the service. Another measure that can be undertaken by a database director is service expansion. Under service expansion, another database instance is allocated to host a service, as described in Service Placement for Enforcing Performance and Availability Levels in a Multi-Node System (50277-2412).
[0067] A cluster director, such as cluster director 112, manages and adjusts allocation of resources between databases. One measure a cluster director undertakes to perform this responsibility is to add or remove a database instance for a database to or from an existing node within a cluster, as described herein in greater detail.
[0068] A farm director, such as farm director 102, manages and adjusts allocation of resources between clusters. One measure a farm director undertakes to perform this responsibility is to add or remove a node to or from a cluster.
[0069] The directors detect violations of service-level agreements, herein referred to as service-level violations. For example, database director 152 periodically analyzes performance metrics and determines that the average transaction time for FIN on instance 125 violates the service-level agreement for this measure or determines that the percent CPU utilization on node 124 for service FIN violates the policy for CPU utilization.

Escalating Remedies To Resolve Violations of Service-level agreements
[0070] According to an embodiment, a database director remedies a service-level violation it detects by initially making adjustments to resource allocations that are less disruptive and costly before resorting to more disruptive and costly resource allocations. Migrating database sessions of a service between the database instances of a database that are hosting the service is in general less disruptive and costly than expanding the service to another database instance; expanding a service to another database is in general less disruptive and costly than provisioning a database instance to another node or adding another node to a cluster.
[0071] FIG. 2 shows a procedure that may be used to manage the escalation of remedies employed to resolve service-level violations. The procedure is initiated by a database director in response to detecting a resource alert for a service on a "source" database instance of a "source" database. A resource alert is the detection of a condition or event that triggers attention to resource allocation within a multi-node computer system. Resource alerts include, in particular, detection of service-level violations. For example, a resource alert can be detecting that the average transaction time for service FIN on source database instance 125 exceeds the service-level agreement for this measure.
[0072] Referring to FIG. 2, at step 210, the database director first determines whether to attempt run-time session balancing. This determination is made by determining whether there are any candidate services on the source database instance for which session balancing can be performed. If it is determined that session balancing should be performed, then at step 215 session balancing is performed, such as that described in Incremental Run-Time Session Balancing In A Multi-Node System (50277-2411).

[0073] At step 205, a determination is made of whether the resource alert persists. If a remedy invoked in an iteration of the procedure, such as session balancing at step 215, resolves the root cause of the resource alert, then the resource alert may no longer persist. Execution of the procedure ends.
[0074] If, however, the resource alert persists, another iteration of the procedure is performed to undertake another remedy. Step 205 is performed after each iteration to assess whether a remedy taken in the iteration has resolved the resource alert or whether another iteration of the procedure should be performed.
[0075] If, at step 210, the determination is that run-time session balancing should not be attempted, then the procedure determines at step 220 whether service expansion should be attempted. This determination is made by determining whether there are any candidate services on a source database instance that can be expanded, as explained in greater detail in Service Placement for Enforcing Performance and Availability Levels in a Multi-Node System (50277-2412). If the determination is that service expansion should be performed, then at step 225, service expansion is performed, and the procedure returns to step 205. [0076] If the determination is that service expansion cannot be performed, then the database director determines whether the resolution of the resource alert should be escalated to the cluster director to implement more costly remedies, such as allocating another database instance for the database, and if needed, adding a node to the cluster. [0077] At step 230, the database director determines whether there is a pending "NEED-INSTANCE" request being processed for the database director by the cluster director. A NEED-INSTANCE request is a request for another database instance on another node. A pending NEED-INSTANCE request is a NEED-INSTANCE request that is currently being processed by, for example, the cluster director. Such processing can include (as described in later detail) finding a node for a database instance or removing a
50277-2595 (OID 2003-323-01-PCT)

Database instance from a node so that another database instance may be provisioned to the node. If there is a pending NEED-INSTANCE request, then at step 235 the database director waits and then proceeds to step 205. If the resource alert persists, then the database director performs a subsequent iteration. A new database instance may have been allocated to the database as a result of the pending NEED-INSTANCE request. In the subsequent iteration, the database director may expand a service to the newly allocated database instance and alleviate or remedy the resource alert. [0078] If the determination at step 230 is that there is no pending NEED-INSTANCE request being processed for the database director by the cluster director, then at step 240 the database director determines whether allocating another database instance would violate a maximum cardinality for the database. If the database director determines that adding another database instance would violate the maximum cardinality for the database, then execution proceeds to step 235, where the database director waits until proceeding to possibly perform another iteration of the procedure shown in FIG. 2. [0079] If at step 240, the database director determines that adding another database instance would not violate a maximum cardinality for the database, then at step 245 the database director escalates resolution of the resource alert to the cluster director by transmitting a NEED-INSTANCE request.
[0080] While performing the various steps in the procedure, the database director delegates various actions to an asynchronous job and then waits for the results of various actions performed by the job. For example, the database director may be waiting for the result of an asynchronous job it issued to expand a service (see Service Placement for Enforcing Performance and Availability Levels in a Multi-Node System (50277-2412)) or to migrate sessions (see Incremental Run-Time Session Balancing in a Multi-Node System (50277-2411)). In addition, the database director may wait for the result of a NEED-
50277-2595 (OID2003-323-01-PCT)

INSTANCE request issued to a cluster director. While waiting in these cases, the database director does not in fact lay idle. Instead, it concurrently processes other resource alerts by performing the procedure depicted in FIG. 2. [0081] When processing another resource alert for another service, the database director at step 230 may determine that the pending NEED-INSTANCE request is pending. The pending NEED-INSTANCE request may have been requested by the database director for another resource alert in a previous iteration.
Initiating Allocation of Database Instance and Node to a Database
[0082] FIG. 3 shows a procedure followed by a cluster director to initiate allocation of a node to a database in response to processing a NEED-INSTANCE request made by a "requesting database director."
[0083] Referring to FIG. 3, at step 305, the cluster director determines whether there is a free node, within the cluster the cluster director is responsible for, to which an instance may be provisioned. In an embodiment, a node is free if a database instance does not reside on the node, and the cluster director is not in the process of allocating the node to another database instance (e.g. allocating a node in response to a NEED-INSTANCE request generated for another database), or the node is reserved for some other purpose by the clusterware. The cluster director may invoke an API of the clusterware to determine what nodes are in the cluster and whether any database instance resides on them or has been reserved for some other purpose by the clusterware.
[0084] If, at step 305, the cluster director determines that a node is free, then, at step 310, the cluster director invokes an API function of the clusterware to start a database instance for the database on the free node. Next, the cluster director sends a message to the requesting database director informing the database director that a database instance for the database has been provisioned to the node.
50277-2595 (OID2003-323-01-PCT)

[0085] If, at step 305, the cluster director determines that a node is not free, then the cluster director attempts to obtain a node that is allocated to another database ("database victim") within the cluster.
[0086] At step 315, the cluster director locates database victim candidates. According to an embodiment of the present invention, the cluster director generates an ordered list of databases nested within the cluster, referred to as the victim candidate list, which is ordered according to database priority. Databases with lower priority are located at the beginning of the list while those with higher priority are located at the end of the list. [0087] The locating of database victim candidates can be performed by invoking a function. The function returns one or more candidate victims according to a policy implemented in the function. The functions could implement a variety of approaches and policies for determining a list of database victim candidates. Furthermore, such a function could be user-supplied, that is, could be a function that is not part of the native software of a database server but is registered with a database server to be invoked for the purpose of determining a list of database candidate victims.
[0088] At step 320, the cluster director solicits the database directors of the victim list for a volunteer to quiesce a database instance and selects a volunteer from among the one or more database directors who volunteered.
[0089] The term quiesce refers to disabling a use of a server by a set of clients of the server. Quiescing a database instance of a database refers to disabling the use of the database instance by clients to access to the database. Quiescing a service refers to disabling the use of a database instance for that service. As described in greater detail, quiescing a database instance can entail preventing new connections to the database instance and transferring work being performed for clients to another database instance via, for example, session migration.
50277-2595 (OID 2003-323-01-PCT)

[0096] At step 335, the cluster director issues an asynchronous job. The job transmits to the victim's database director a "QUIESCE-INITIATE" request to request that the database director quiesce a database instance. [0097] Execution of the steps in FIG. 3 ends.
[0098] Subsequently, the cluster director receives an "IDLE-INSTANCE" message from the victim's database director, to which the cluster director responds by shutting down the quiesced instance. Meanwhile, the cluster director processes other requests, including other NEED-INSTANCE requests.
Responding To Idle-Instance Message
[0099] FIG. 4 shows a procedure followed by the cluster director to respond to an IDLE-INSTANCE request according to an embodiment of the present invention. At step 405, the cluster director receives an IDLE-INSTANCE message. The IDLE-INSTANCE message includes the identity of the "victim database instance" quiesced by the victim's database director and the node on which the victim database instance is hosted. [0100] At step 410, the cluster director verifies the validity of the IDLE-INSTANCE message, that is, verifies that the victim database is running and can be shut down. It is possible that after the victim database director has quiesced a victim database instance, that the victim database instance was shut down (i.e. made not to run anymore) and another database instance was started to respond to, for example, a high availability event. In this case, the cluster director does not shut down the other database instance. To determine the identity of the database instance running on the node on which the victim database instance quiesced, the cluster director invokes an API of the clusterware. If that identity is the same as that of the victim database instance's, the IDLE-INSTANCE message is valid and execution proceeds to step 415. Otherwise, execution of the steps ends.
50277-2595 (OID 2003-323-01-PCT)

[0090] Step 320 may be accomplished in various ways.
[0091] The cluster director may poll the database directors of the candidates in the
victim candidate list one-by-one in order. To poll a database director of a candidate, the
cluster director transmits a "QUIESCE-VOLUNTEER" request to the database director,
which responds by transmitting a message specifying whether the database director
volunteers to quiesce. If the polled candidate volunteers, the cluster director selects the
candidate as the victim.
[0092] Alternately, the cluster director broadcasts the quiesce requests to all the
database directors of the candidates in the victim candidate list. Then, the cluster director
selects a victim database among those whose director volunteered, i.e. transmitted a
message specifying that the database director volunteers.
[0093] The messages transmitted by the volunteering database directors may include
data indicating a quiescing cost, as explained later in greater detail. Quiescing cost is the
amount of work needed to quiesce a database instance.
[0094] The selection of a victim database can be based on a database priority,
quiescing cost, or a combination of these factors. For example, the cluster director can
select a database associated with the lowest quiescing cost or the lowest database priority.
If selecting based on database priority, and multiple databases have the lowest priority,
then the cluster director selects from among the multiple databases the one associated
with the lowest quiescing cost.
[0095] At step 325, a determination is made of whether a victim was selected. If no
victim was selected, then at step 330, a victim database is selected by choosing a lowest
priority database from the candidate victim list that has at least two database instances.
Execution proceeds to step 335.
50277-2595 (OID 2003-323-01-PCT)

[0101] At step 415, the cluster director shuts down the victim database instance. At step 418, the cluster director determines the highest priority database director waiting for a new node (i.e. the highest priority database whose director is waiting for a new node). At step 420, the cluster director starts the requested database instance for the highest priority waiting database, which may be different from the database that originally submitted the NEED-INSTANCE message to the cluster director. This procedure allows higher priority requests that arrive later to pre-empt a lower priority request that may have initiated the quiesce of an instance. Both steps 415 and 420 are performed by invoking APIs of the clusterware.
Responding to QUIESCE-VOLUNTEER Request
[0102] FIG. 5 shows a procedure for determining whether a database director may volunteer to quiesce a database instance for the database of the database director. The procedure is performed in response to a "QUIESCE-VOLUNTEER" request sent by a "requesting cluster director."
[0103] Referring to FIG. 5, at step 505, the database director determines whether the minimum database cardinality constraint for the database would be violated by allocating one less database instance for the database. It is possible that the database director may be in the process of quiescing another database instance. If so, the database director determines whether the minimum database cardinality constraint would be violated by allocating one less database instance plus any database instance that may be in the process of being quiesced. If the database director determines that the minimum database cardinality constraint would be violated, then execution proceeds to step 530, where the database director sends a message to the requesting cluster director specifying that the database director is not volunteering to quiesce a database instance. Otherwise, if the
50277-2595 (OID 2003-323-01-PCT)

database director determines that the minimum database cardinality constraint would not be violated, then execution proceeds to step 510.
[0104] At step 510, the database director determines whether the minimum service cardinality of any of the services hosted on the database would be violated by allocating one less database instance for the database. The minimum cardinality of instances of a database that there can be without violating the service cardinality constraint of any of the services hosted on the database is the largest minimum service cardinality of any of the services hosted on the database. For example, among the databases hosted on database 150, the minimum cardinality constraint for service FIN and PAY is 1 and 2, respectively. The largest minimum cardinality constraint of any the hosted services is therefore 2. There are three database instances for database 150. Removing a database instance for database 150 leaves 2, and therefore no minimum service cardinality is violated, and execution proceeds to step 515. If, on the other hand, the minimum cardinality constraint for service PAY is 3, then the largest minimum service cardinality of any of the services is 3, and removing a database instance for database 150 violates a minimum service cardinality of at least one service hosted on database 150, and execution proceeds to step 530, where the database director sends a message to the requesting cluster director specifying that database director is not volunteering to quiesce. [0105] At step 515, the total available CPU utilization is calculated for the nodes hosting the database, i.e. the nodes hosting the database instances of the database. According to an embodiment, this is determined by summing the CPUaval of each of the nodes hosting the database. The total available CPU utilization is an indication of the ability of the set of nodes hosting a database to handle their current workload with one less node. For example, CPUaval for nodes 122, and 124, and 126 is greater than 80 percent. If the total available CPU utilization is greater than Xcpu, then there is enough
50277-2595 (OID 2003-323-01-PCT)

total available CPU utilization to handle the workload with one less node without
violating the threshold.
[0106] At step 520, it is determined whether there is sufficient total available CPU
utilization available. If total available CPU utilization is greater than Xcpu plus a factor of
Xcpu, then there is sufficient total available CPU utilization available.
[0107] The total available CPU utilization calculated is only an estimate of the ability
of the nodes hosting a database to handle current workload with one less node without
violating service-level agreements and policies for CPU utilization. Because this estimate
may not be accurate, the factor is added to Xcpu to avoid overloading the remaining nodes.
The factor could be, for example, 5% of Xcpu.
[0108] If, at step 520, it is determined that there is not sufficient total available CPU
utilization available, then execution proceeds to step 530, where the database director
sends a message specifying that it is not volunteering. Otherwise, at step 525, the
database director sends a message acknowledging that it is volunteering.
[0109] A message acknowledging that the database director is volunteering can also
contain data indicating the cost of quiescing a database instance for the database. Such
data includes the minimum number of database sessions on any database instance, the
minimum percent CPU utilization of any node hosting the database, and/or the total
available CPU utilization for the database. Generally, a higher number of database
sessions on a database instance indicates a higher cost of quiescing the instance. A higher
total available CPU utilization indicates a lower cost of quiescing the instance. A lower
CPU utilization on a node indicates a lower cost of quiescing a database instance.
[0110] Execution of the procedure of FIG. 5 ends.
50277-2595 (OID 2003-323-01-PCT)

Processing Quiesce-Initiate Request
[0111] FIG. 6 shows a procedure performed by a database director for a database to select and quiesce a database instance from among database instances of the database. The procedure is performed by the database director in response to a QUIESCE-INITIATE request sent by a cluster director to quiesce a database instance. [0112] Referring to FIG. 6, at step 605, the database director selects a database instance as a candidate victim, making the selection in an order based on percent CPU utilization. A database instance with lower CPU utilization is selected before one with higher CPU utilization.
[0113] At step 610, the database director sends a "BLOCK-INSTANCE" message to the candidate victim's listener. The message instructs the listener to stop directing database connection requests to the selected candidate. Accordingly, the listener directs database connection requests for any service to another database instance hosting the service.
[0114] At step 615, the database director determines whether the database sessions are migratable, i.e., whether the database sessions can be migrated to another database instance. For example, a database session may not be migratable when the session state includes a file descriptor of an open file. The file descriptor contains information that is only valid for a session on the source instance but not the destination instance. Other ways of determining whether the database sessions can be migrated are described in Transparent Session Migration Across Servers (50277-2383). If the sessions are not migratable, an "UNBLOCK-INSTANCE" message is sent to the listener at step 630, informing the listener that it may direct connection requests to the candidate victim. Another candidate victim is selected at step 605.
50277-2595 (OID 2003-323-01-PCT)

[0115] If the sessions can be migrated, then execution proceeds to step 620. At this stage the candidate victim becomes the victim.
[0116] At step 620, the sessions are migrated from the victim to the other database instances of the database. The sessions may be migrated in a way similar to that described in Incremental Run-Time Session Balancing in a Multi-Node System (50277-2411). As described therein, sessions are migrated to other database instances in response to a resource alert caused by a service-level violation. Sessions on the database instance for a service are migrated to other database instances until the resource alert no longer persists. [0117] A similar procedure may be used for step 620. Database sessions are migrated to database instances other than the victim. The resource alert, rather than applying to one service, applies to all services on the victim, and persists until all the database sessions are migrated from the victim for all services hosted by the victim, or until the database director decides to abort its attempt to migrate database sessions. In the latter case, execution proceeds to step 630, where the database director sends an UNBLOCK-INSTANCE message to the listener. The procedure in FIG. 6 is performed again, except that the victim is not selected as a victim again. Finally, while the session migration from the victim is being performed, all attempts to migrate sessions to the victim are prevented. [0118] At step 625, the database director sends the cluster director an IDLE-INSTANCE message.
[0119] It is possible that all instances of the victim database have unmigratable database sessions. In this case, the database director selects an instance as a victim and migrates the migratable database sessions. With respect to the unmigratable database sessions, the database director waits until they terminate or become migratable and are migrated, or the they may be forcibly terminated based on a policy specified by the administrator and/or priority for the service for which the new node is required.
50277-2595 (OID 2003-323-01-PCT)

Examples of Alternate Embodiments
[0120] An embodiment of the present invention has been illustrated by dynamically allocating the resources of a multi-node system among database services and subcategories of database services. However, the present invention is not so limited. [0121] For example, an embodiment of the present invention may be used to allocate computer resources of a multi-node system that hosts an application server among services provided by the application server. An application server is part of, for example, a three tier architecture in which an application server sits between clients and a database server. The application server is used primarily for storing, providing access to, and executing application code, while a database server is used primarily for storing and providing access to a database for the application server. The application server transmits requests for data to the database server. The requests may be generated by an application server in response to executing the application code stored on the application server. An example of an application server is Oracle 9i Application Server or Oracle 10g Application Server. Similar to examples of a multi-node server described herein, an application server may be distributed as multiple server instances executing on multiple nodes, the server instances hosting multiple sessions that may be migrated between the server instances.
[0122] The present invention is also not limited to homogenous multi-node servers comprised only of server instances that execute copies of the same software product or same version of a software product. For example, a multi-node database server may be comprised of several groups of server instances, each group executing a different database server software from a different vendor, or executing a different version of database server software from the same vendor.
50277-2595 (OID 2003-323-01-PCT)

HARDWARE OVERVIEW
[0123] Figure 7 is a block diagram that illustrates a computer system 700 upon which an embodiment of the invention may be implemented. Computer system 700 includes a bus 702 or other communication mechanism for communicating information, and a processor 704 coupled with bus 702 for processing information. Computer system 700 also includes a main memory 706, such as a random access memory (RAM) or other dynamic storage device, coupled to bus 702 for storing information and instructions to be executed by processor 704. Main memory 706 also may be used for storing temporary variables or other intermediate information during execution of instructions to be executed by processor 704. Computer system 700 further includes a read only memory (ROM) 708 or other static storage device coupled to bus 702 for storing static information and instructions for processor 704. A storage device 710, such as a magnetic disk or optical disk, is provided and coupled to bus 702 for storing information and instructions. [0124] Computer system 700 may be coupled via bus 702 to a display 712, such as a cathode ray tube (CRT), for displaying information to a computer user. An input device 714, including alphanumeric and other keys, is coupled to bus 702 for communicating information and command selections to processor 704. Another type of user input device is cursor control 716, such as a mouse, a trackball, or cursor direction keys for communicating direction information and command selections to processor 704 and for controlling cursor movement on display 712. This input device typically has two degrees of freedom in two axes, a first axis (e.g., x) and a second axis (e.g., y), that allows the device to specify positions in a plane.
[0125] The invention is related to the use of computer system 700 for implementing the techniques described herein. According to one embodiment of the invention, those techniques are performed by computer system 700 in response to processor 704 executing
50277-2595 (OID 2003-323-01 -PCT)

one or more sequences of one or more instructions contained in main memory 706. Such instructions may be read into main memory 706 from another computer-readable medium, such as storage device 710. Execution of the sequences of instructions contained in main memory 706 causes processor 704 to perform the process steps described herein. In alternative embodiments, hard-wired circuitry may be used in place of or in combination with software instructions to implement the invention. Thus, embodiments of the invention are not limited to any specific combination of hardware circuitry and software.
[0126] The term "computer-readable medium" as used herein refers to any medium that participates in providing instructions to processor 704 for execution. Such a medium may take many forms, including but not limited to, non-volatile media, volatile media, and transmission media. Non-volatile media includes, for example, optical or magnetic disks, such as storage device 710. Volatile media includes dynamic memory, such as main memory 706. Transmission media includes coaxial cables, copper wire and fiber optics, including the wires that comprise bus 702. Transmission media can also take the form of acoustic or light waves, such as those generated during radio-wave and infra-red data communications.
[0127] Common forms of computer-readable media include, for example, a floppy disk, a flexible disk, hard disk, magnetic tape, or any other magnetic medium, a CD-ROM, any other optical medium, punchcards, papertape, any other physical medium with patterns of holes, a RAM, a PROM, and EPROM, a FLASH-EPROM, any other memory chip or cartridge, a carrier wave as described hereinafter, or any other medium from which a computer can read.
[0128] Various forms of computer readable media may be involved in carrying one or more sequences of one or more instructions to processor 704 for execution. For example,
50277-2595 (OID 2003-323-01 -PCT)

the instructions may initially be carried on a magnetic disk of a remote computer. The remote computer can load the instructions into its dynamic memory and send the instructions over a telephone line using a modem. A modem local to computer system 700 can receive the data on the telephone line and use an infra-red transmitter to convert the data to an infra-red signal. An infra-red detector can receive the data carried in the infra-red signal and appropriate circuitry can place the data on bus 702. Bus 702 carries the data to main memory 706, from which processor 704 retrieves and executes the instructions. The instructions received by main memory 706 may optionally be stored on storage device 710 either before or after execution by processor 704. [0129] Computer system 700 also includes a communication interface 718 coupled to bus 702. Communication interface 718 provides a two-way data communication coupling to a network link 720 that is connected to a local network 722. For example, communication interface 718 may be an integrated services digital network (ISDN) card or a modem to provide a data communication connection to a corresponding type of telephone line. As another example, communication interface 718 may be a local area network (LAN) card to provide a data communication connection to a compatible LAN. Wireless links may also be implemented. In any such implementation, communication interface 718 sends and receives electrical, electromagnetic or optical signals that carry digital data streams representing various types of information.
[0130] Network link 720 typically provides data communication through one or more networks to other data devices. For example, network link 720 may provide a connection through local network 722 to a host computer 724 or to data equipment operated by an Internet Service Provider (ISP) 726. ISP 726 in turn provides data communication services through the world wide packet data communication network now commonly referred to as the "Internet" 728. Local network 722 and Internet 728 both use electrical,
50277-2595 (OID 2003-323-01 -PCT)

Electromagnetic or optical signals that carry digital data streams. The signals through the various networks and the signals on network link 720 and through communication interface 718, which carry the digital data to and from computer system 700, are exemplary forms of carrier waves transporting the information.
[0131] Computer system 700 can send messages and receive data, including program code, through the network(s), network link 720 and communication interface 718. In the Internet example, a server 730 might transmit a requested code for an application program through Internet 728, ISP 726, local network 722 and communication interface 718. [0132] The received code may be executed by processor 704 as it is received, and/or stored in storage device 710, or other non-volatile storage for later execution. In this manner, computer system 700 may obtain application code in the form of a carrier wave. [0133] In the foregoing specification, embodiments of the invention have been described with reference to numerous specific details that may vary from implementation to implementation. Thus, the sole and exclusive indicator of what is the invention, and is intended by the applicants to be the invention, is the set of claims that issue from this application, in the specific form in which such claims issue, including any subsequent correction. Any definitions expressly set forth herein for terms contained in such claims shall govern the meaning of such terms as used in the claims. Hence, no limitation, element, property, feature, advantage or attribute that is not expressly recited in a claim should limit the scope of such claim in any way. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.
50277-2595 (OID2003-323-01-PCT)

Documents:

550-chenp-2006 form-1 13-12-2010.pdf

550-chenp-2006 form-13 13-12-2010.pdf

550-chenp-2006 form-3 13-12-2010.pdf

550-chenp-2006 form-5 13-12-2010.pdf

550-chenp-2006 amended claims 13-12-2010.pdf

550-chenp-2006 amended pages of specification 13-12-2010.pdf

550-CHENP-2006 CORRESPONDENCE OTHERS 16-08-2011.pdf

550-chenp-2006 examination report reply recieved 13-12-2010.pdf

550-chenp-2006 correspondence others 07-12-2010.pdf

550-CHENP-2006 CORRESPONDENCE OTHERS 29-12-2010.pdf

550-chenp-2006 form-1 07-12-2010.pdf

550-chenp-2006 form-1 10-05-2010.pdf

550-chenp-2006 form-13 07-12-2010.pdf

550-CHENP-2006 FORM-13 23-07-2007.pdf

550-CHENP-2006 FORM-13 10-05-2010.pdf

550-chenp-2006 form-18 23-07-2007.pdf

550-chenp-2006 power of attorney 13-12-2010.pdf

550-CHENP-2006 POWER OF ATTORNEY 10-05-2010.pdf

550-chenp-2006- pct.pdf

550-chenp-2006-abstract.pdf

550-chenp-2006-claims.pdf

550-chenp-2006-correspodence-others.pdf

550-chenp-2006-description-complete.pdf

550-chenp-2006-drawings.pdf

550-chenp-2006-form 1.pdf

550-chenp-2006-form 3.pdf

550-chenp-2006-form 5.pdf


Patent Number 256727
Indian Patent Application Number 550/CHENP/2006
PG Journal Number 30/2013
Publication Date 26-Jul-2013
Grant Date 23-Jul-2013
Date of Filing 14-Feb-2006
Name of Patentee M/S. ORACLE INTERNATIONAL CORPORATION
Applicant Address 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
Inventors:
# Inventor's Name Inventor's Address
1 SHRI. CHIDAMBARAN, Lakshminarayanan 34542 Felix Terrace, Fremont, CA 64555 (US).
2 STAMOS, James, W. 13361 Argonne Drive, Saratoga, CA 95070 (US).
3 PINGTE, Rajendra 460 Nantucket Street, Foster City, CA 94404 (US).
4 LU, Edwina P.O. Box 61043, Palo Alto, CA 94306 (US).
PCT International Classification Number G06F 9/40
PCT International Application Number PCT/EP04/26405
PCT International Filing date 2004-08-13
PCT Conventions:
# PCT Application Number Date of Convention Priority Country
1 10/718.747 2003-11-21 U.S.A.