The present invention is directed to a database maintenance technique that uses a novel parallel processing technique and dedicated object maintenance channels to minimize the time for maintenance processing while allowing for larger business processing windows even as the database grows in size and processing demand increases.
In the last 4 years, total data storage for SQL server databases has grown from 1.75 Petabytes (1015 bytes, or 1,000,000 Gigabytes) to 3.03 Petabytes, a growth of 73%. That equates to about 6 Terabytes of additional storage needed every week. As the data grows, database maintenance plays an increasingly vital role in maintaining the health and safety of the data in the databases and the underlining platforms that serves them. Maintenance takes away processing time and power from business tasks and requires more resources (e.g., larger and more expensive hardware) as the data grows. These elements directly impact business efficiency and overhead cost. The SQL (Structured Query Language) server maintenance framework often strains under the sheer volume and growth of data and a new technique is necessary to continue the high efficiency and availability of these data services, especially for business-focused processing.
The adaptive maintenance technique of the present invention leverages a parallel processing path and available computing to cut the maintenance processing window by greater than 50%, thus opening up additional time that can be used by the application for business-supporting processes while reducing the overall cost of system operation. This maintenance strategy is a holistic solution and encompasses elements from across the development lifecycle. The overall strategy constructs a universal maintenance implementation flexible and smart enough to supply a full range of SQL server capabilities, reduces the time necessary to conduct maintenance, and provides for future growth of these database systems.
Adaptive maintenance allows for maintenance on thousands of databases being managed without the necessary increase in human resources. Removing the human bottleneck through automation alone does not, however, remove the other bottlenecks that exist within the maintenance process: e.g., serial command execution. The serial execution of commands extends out the time necessary to complete maintenance (e.g., database consistency checks and index optimizations). In some instances, the time increases start to conflict with other business critical operations. When analyzing available server resources during maintenance processing, the servers' resources are not being leveraged to their full potential. The nature of traditional SQL server maintenance is serial (one task at a time), but it is possible to parallel out the work such that multiple processes could be executed simultaneously. It is this parallel processing that allows the leveraging of more platform resources for a given unit of time. Other benefits and features that could be provided by a parallel, asynchronous approach are:
The end result is a drastic cut in the required maintenance window (where business processes can't run) allowing for time for more and complex business processes to run in order to support strategic goals. Overall maintenance time in production is reduced by about 66% and the average server time (against the moving average) is reduced by about 75%. In one embodiment, the overall production maintenance time can be reduced from about 175,000 minutes a day to about 55,000 minutes a day, while average maintenance time on server on a per server basis is reduced from about 240 minutes a night to about 60 minutes a night. This provides more processing power and time to the business processes without any additional cost.
In one embodiment of the invention, the present invention allows a plurality of separate server processes to run simultaneously and in parallel (e.g., 10 dedicated server processes). At start there are 0 processes dedicated to the processing. The queue of the present invention is enabled and retrieves the first message in the queue, identifies the object group, instantiates a new process and hands (or assigns) that process to the identified object group for processing. This repeats until there are multiple processes (up to 10 in one example) running at the same time. As one of these dedicated server processes finishes all messages/commands associated with the assigned object group, the process completes and shuts down. The queue sees that there are only 9 dedicated processes, and instantiates a new process and assigns the next object group. Eventually there would be no more messages/commands and all the object groups are either assigned or completed, at which point no new processes would be instantiated.
In one embodiment of the invention, the invention is comprised of a method for adaptive maintenance of a database having database objects using dedicated logical channels, the method comprising the steps of: retrieving data describing maintenance details of the database; generating commands or messages from the data describing maintenance details of the database; storing the commands or messages at an intermediary command or message queue; grouping or categorizing the commands or messages stored at the intermediary command or message queue into a plurality of groups based on objects of the database being maintained, these plurality of groups being object groups; assigning or associating each of the plurality of object groups to one of a plurality of dedicated server processes to create a plurality of dedicated, parallel, processes for maintaining the database; retrieving the commands or messages stored at the intermediary command or message queue; executing the commands or messages from the plurality of object groups in a dedicated, parallel, fashion to perform database maintenance on the database; and suspending acquisition of commands or messages from the intermediary command or message queue by preventing queue command or message processing.
In one embodiment, the method of the present invention is also comprised of the steps of: grouping or categorizing the commands or messages stored at the intermediary command or message queue into a plurality of object groups by assigning a unique identification to all commands or messages associated with the same object group; and setting at least one window of time for database maintenance by starting and suspending maintenance at a predetermined period of time.
The foregoing and other features and advantages of the present invention will be apparent from the following more detailed description of the particular embodiments, as illustrated in the accompanying drawings.
In addition to the features mentioned above, other aspects of the present invention will be readily apparent from the following descriptions of the drawings and exemplary embodiments, wherein like reference numerals across the several views refer to identical or equivalent features, and wherein:
The following detailed description of the example embodiments refers to the accompanying figures that form a part thereof. The detailed description provides explanations by way of exemplary embodiments. It is to be understood that other embodiments may be used having mechanical and electrical changes that incorporate the scope of the present invention without departing from the spirit of the invention.
In one embodiment of the invention, the adaptive maintenance technique uses multiple simultaneous processes (e.g., server process ID (SPID) executions). The SPIDs are essentially sessions in SQL server processes. Every time an application connects to the SQL server, a new connection or dedicated server process (e.g., dedicated procedure instance or SPID) is initiated. Typically, the SPID has a defined scope and memory space and does not interact with other SPIDs.
Parallel execution according to the present invention provides logical channel isolation (preventing command conflicts). SQL Server maintenance has traditionally been a serial process; one table at a time and then only one sub-object (table or index) at a time. Adaptive maintenance of the present invention allows for multiple tables or objects to be worked on at the same time. The cost and limit is only capped by the amount of computing power that can be leveraged on the server itself.
Database maintenance plays a vital role in maintaining the health and safety of the data in a database and the underlining platform that serves it. Very large databases (VLDB's) have special concerns in relation to maintenance, especially in relation to the time and resources available. Traditional SQL server maintenance frameworks strain under the sheer volume and growth of data and a solution is necessary to continue the high efficiency and availability of these data services.
The maintenance strategy of the present invention is a holistic solution and encompasses elements from across the development life cycle. Each of these elements, alone or in combination, contribute to a more efficient solution:
1. properly structured (normalized) data;
2. efficient index plan and implementation;
3. server workload management;
4. proper infrastructure implementation and tuning;
5. maintenance execution mechanism.
The present invention provides a universal maintenance implementation flexible and smart enough to supply a full range of SQL server capabilities, reduces the time necessary to conduct maintenance, and provides for future growth of these database systems.
One of the traditional frameworks that provides maintenance is the Ola Hallengren scripts. This framework allows for automation of maintenance on thousands of databases without the necessary increase in human resources. Removing the human bottleneck through automation does not, however, remove the other bottlenecks that exist within the maintenance process such as serial command execution. The serial execution of commands extends out the time necessary to complete maintenance (database consistency checks and index optimizations). In some instances, the increase in time causes conflicts with other business critical operations.
When analyzing available server resources during maintenance processing in traditional systems, the servers' resources are not being leveraged to their full potential. The nature of the traditional database maintenance is serial (one task at a time). One aspect of the present invention relates to parallel processing of the work such that multiple processes could be executed simultaneously. Parallel processing allows the leveraging of more platform resources for a given unit of time.
Standard maintenance is conducted in the following sequence:
Maintenance is generally executed on the server that the database runs on. Depending on the size of the database and its configuration (stand-alone, cluster, AG, etc.), the database integrity checks (DBCC) and maintenance can be conducted outside of the primary server (on a backup clone, on a secondary of an AG, etc.).
Adaptive maintenance preferably has two separate steps, command generation and command execution:
Additionally, there are two additional control features that allow for operational flexibility.
Adaptive maintenance starts very much like the standard maintenance. Commands are generated based on the meta data, but instead of executing the commands directly routes them to a working queue:
Adaptive maintenance starts very much like the standard maintenance. Commands are generated based on the meta data, but instead of executing the commands directly routes them to a working queue:
Message Creation
Message Processing
While certain embodiments of the present invention are described in detail above, the scope of the invention is not to be considered limited by such disclosure, and modifications are possible without departing from the spirit of the invention as evidenced by the following claims:
This application is a continuation of non-provisional application Ser. No. 17/170,981, filed Feb. 9, 2021, the disclosure of which is hereby incorporated by reference in its entirety as if fully recited herein.
| Number | Date | Country | |
|---|---|---|---|
| Parent | 17170981 | Feb 2021 | US |
| Child | 17180934 | US |