Partition maintenance method and device of database
A technology for maintaining devices and databases, applied in the field of data processing, can solve the problems of inability to create new partitions, partition creation failures, etc., and achieve the effect of avoiding partition creation failures
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0036] In this embodiment, a parameter n needs to be set at first, and this parameter n represents the maximum number of partitions that can be created in the table space;
[0037] Such as Figure 2A As shown, the specific implementation process of regularly deleting tablespaces is as follows:
[0038] Step 201: regularly judge whether there is a partition that needs to be deleted; if so, then go to step 202, otherwise, go to step 205;
[0039] In this step, it can be determined whether the storage time of the data in each partition exceeds the validity period, if so, the partition needs to be deleted, otherwise, the partition does not need to be deleted;
[0040] Step 202: delete the partition that needs to be deleted in the previous step;
[0041] Step 203: determine whether the table space where the deleted partition is located does not contain any partitions, if so, go to step 204, otherwise, go to step 205;
[0042] Step 204: delete the table space that does not contai...
Embodiment 2
[0053] In order to enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below by taking a database table storing user log data of a certain website as an example. In the method for regularly maintaining partitions in this embodiment, table spaces are created and deleted regularly, and the process will be described in detail below. The partition key value of the database table is the operation time, and a partition is created every hour to store the log data within that hour.
[0054] In this embodiment, it is first necessary to set the maximum number of partitions that can be stored in the table space. For example, setting the number to 100 means that the upper limit of the number of partitions in each table space is 100. When the number of partitions in the table space reaches the upper limit, no new partitions can be created in this table space .
[0055] Step 1: The timing scheduler judges at...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 