CN114880409A - Data table filing method and related device - Google Patents
Data table filing method and related device Download PDFInfo
- Publication number
- CN114880409A CN114880409A CN202210675099.XA CN202210675099A CN114880409A CN 114880409 A CN114880409 A CN 114880409A CN 202210675099 A CN202210675099 A CN 202210675099A CN 114880409 A CN114880409 A CN 114880409A
- Authority
- CN
- China
- Prior art keywords
- processing
- information
- original
- filing
- constraint
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 55
- 238000012545 processing Methods 0.000 claims abstract description 127
- 238000005192 partition Methods 0.000 claims abstract description 40
- 230000008569 process Effects 0.000 claims abstract description 18
- 238000012217 deletion Methods 0.000 claims abstract description 10
- 230000037430 deletion Effects 0.000 claims abstract description 10
- 238000013500 data storage Methods 0.000 claims description 12
- 238000010200 validation analysis Methods 0.000 claims description 8
- 238000012423 maintenance Methods 0.000 claims description 7
- 230000000694 effects Effects 0.000 claims description 4
- 230000006870 function Effects 0.000 claims description 4
- 238000004891 communication Methods 0.000 claims description 3
- 230000009471 action Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000013524 data verification Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a data table filing method and a related device, which can obtain the information of an original table to be filed from a configuration table and obtain the original table and a filing table; creating an intermediate table of the archived data in the original table according to the information of the original table, wherein the intermediate table synchronizes table name annotations, column name annotations and default values of columns of the original table; performing deletion main key processing, failure index processing, failure constraint processing and newly-added partition processing on the filing table; storing the archival data to a newly added partition of the archival table; and performing reconstruction main key processing, reconstruction index processing and effective constraint processing on the filing table in a parallel mode. The invention can realize corresponding data archiving without rewriting a writing program by modifying the configuration table, has higher efficiency, and can adopt a parallel mode in the data archiving process to further improve the efficiency of the invention.
Description
Technical Field
The invention relates to the field of databases, in particular to a data table filing method and a related device.
Background
In an online transaction system using a relational database, the amount of data generated in transaction data gradually increases with the passage of time, and the transaction data needs to be periodically filed. In this way, for the newly added original table to be filed, the corresponding filing program needs to be written, so that the newly added original table to be filed can be filed, which is troublesome and inefficient.
Disclosure of Invention
In view of the above, the present invention provides a data table archiving method and related apparatus that overcome or at least partially solve the above-mentioned problems.
In a first aspect, a method for archiving a data table includes:
obtaining information of an original table to be archived from a configuration table, and obtaining the original table and an archiving table;
creating an intermediate table of the archived data in the original table according to the information of the original table, wherein the intermediate table synchronizes table name annotations, column name annotations and default values of columns of the original table;
performing main key deletion processing, failure index processing, failure constraint processing and newly-added partition processing on the filing table;
storing the archival data to a newly added partition of the archival table;
and performing reconstruction main key processing, reconstruction index processing and effective constraint processing on the filing table in a parallel mode.
With reference to the first aspect, in some optional embodiments, after the creating an intermediate table of archive data in the original table according to the information of the original table, the method further includes:
storing the non-archived data in the original table to the intermediate table;
acquiring index information and constraint information of the original table from a data dictionary corresponding to the original table;
and according to the index information of the original table and the constraint information of the original table, performing corresponding primary key establishment processing, index establishment processing and effective constraint processing on the intermediate table in a parallel mode.
With reference to the previous embodiment, in some optional embodiments, after the performing, in the parallel manner, corresponding primary key establishment processing, index establishment processing, and effective constraint processing on the intermediate table according to the index information of the original table and the constraint information of the original table, the method further includes:
and deleting the original table, and maintaining the intermediate table as a new original table.
Optionally, in some optional embodiments, the performing, according to the index information of the original table and the constraint information of the original table, corresponding primary key establishment processing, index establishment processing, and effective constraint processing on the intermediate table in the parallel manner includes:
establishing an index of the intermediate table according to the index information of the original table;
according to the constraint information of the original table, taking effect of the unique constraint of the primary key of the intermediate table and other constraints of the intermediate table;
and establishing a main key of the intermediate table according to the index information of the original table and the constraint information of the original table.
With reference to the first aspect, in some optional embodiments, the performing, on the archive table, a primary key deletion process, an index invalidation process, a constraint invalidation process, and a partition addition process includes:
deleting the primary key in the archive table;
setting indexes of the filing table to be in an invisible state;
setting all constraints of the filing table to be in an invisible state;
and if the filing table is a partition table, calling a partition maintenance function, and establishing a new newly-added partition in the filing table.
With reference to the first aspect, in some optional embodiments, the performing, in a parallel manner, reconstruction of the primary key, reconstruction of the index, and validation constraint on the archive table includes:
acquiring unique constraint information of a primary key of the original table from a data dictionary corresponding to the original table, and acquiring index information of the filing table and other constraint information of the filing table from a data dictionary corresponding to the filing table;
according to the index information of the filing table, reconstructing the indexes of the filing table in parallel in batch;
validating the unique constraint of the primary key of the filing table according to the unique constraint information of the primary key and validating other constraints of the filing table according to other constraint information of the filing table;
and according to the index information of the filing table and the unique constraint information of the primary key, reconstructing the primary key of the filing table in parallel in batches.
In a second aspect, a data table archive apparatus includes: the device comprises a data obtaining unit, an intermediate table creating unit, a first filing table processing unit, a data storage unit and a second filing table processing unit;
the data obtaining unit is used for obtaining information of an original table to be archived from a configuration table and obtaining the original table and the archival table;
the intermediate table creating unit is used for creating an intermediate table of the archived data in the original table according to the information of the original table, wherein the intermediate table synchronizes the table name annotation, the column name annotation and the default value of the column of the original table;
the first filing table processing unit is used for performing deletion primary key processing, failure index processing, failure constraint processing and newly-added partition processing on the filing table;
the data storage unit is used for storing the archiving data into the newly added partition of the archiving table;
and the second filing table processing unit is used for performing reconstruction main key processing, reconstruction index processing and effective constraint processing on the filing table in a parallel mode.
In combination with the second aspect, in certain alternative embodiments, the apparatus further comprises: the device comprises a first data storage unit, a first information acquisition unit and an intermediate table processing unit;
the first data storage unit is used for storing non-archived data in the original table into an intermediate table after the intermediate table of the archived data in the original table is created according to the information of the original table;
the first information obtaining unit is used for obtaining the index information and the constraint information of the original table from the data dictionary corresponding to the original table;
and the intermediate table processing unit is used for performing corresponding main key establishment processing, index establishment processing and effective constraint processing on the intermediate table in a parallel mode according to the index information of the original table and the constraint information of the original table.
In a third aspect, a computer-readable storage medium has stored thereon a program which, when executed by a processor, implements the data table archiving method of any of the above.
In a fourth aspect, an electronic device includes at least one processor, and at least one memory, a bus, connected to the processor; the processor and the memory complete mutual communication through the bus; the processor is configured to call program instructions in the memory to perform any of the above data table archiving methods.
By means of the technical scheme, the data table archiving method and the related device can obtain the original table and the archiving table by obtaining the information of the original table to be archived from the configuration table; creating an intermediate table of the archived data in the original table according to the information of the original table, wherein the intermediate table synchronizes table name annotations, column name annotations and default values of columns of the original table; performing deletion main key processing, failure index processing, failure constraint processing and newly-added partition processing on the filing table; storing the archival data to a newly added partition of the archival table; and performing reconstruction main key processing, reconstruction index processing and effective constraint processing on the filing table in a parallel mode. Therefore, the invention can realize corresponding data archiving without rewriting the writing program by modifying the configuration table, has higher efficiency, and can adopt a parallel mode in the data archiving process to further improve the efficiency of the invention.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flow chart of a first data table archiving method provided by the present invention;
FIG. 2 is a flow chart of a second data table archiving method provided by the present invention;
FIG. 3 is a flow chart of a third data table archiving method provided by the present invention;
FIG. 4 is a flow chart illustrating a fourth method for archiving data tables according to the present invention;
FIG. 5 is a flow chart of a fifth data table archiving method provided by the present invention;
FIG. 6 is a flowchart illustrating a sixth method for archiving data tables according to the present invention;
FIG. 7 is a schematic structural diagram of a data table archiving apparatus provided in the present invention;
fig. 8 shows a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
As shown in fig. 1, the present invention provides a data table archiving method, including: s100, S200, S300, S400, and S500;
s100, obtaining information of an original table to be archived from a configuration table, and obtaining the original table and an archiving table;
optionally, the original table is a table to be archived, that is, some data in the original table needs to be archived in the subsequent archived table, which is not limited by the present invention.
Optionally, the archive table mentioned in the present invention is a table for storing archive data, that is, the present invention aims to archive the data in the original table into the archive table, and the present invention does not limit this.
Optionally, the present invention may obtain information of the original table, and may also obtain information of a table name of the intermediate table, a table name of the filing table, whether the filing table is a partition table, and the like, from the configuration table, which is not limited in this respect.
S200, creating an intermediate table of the archived data in the original table according to the information of the original table;
the intermediate table synchronizes the table name annotation, the column name annotation and the default value of the column of the original table;
optionally, the data table in the relational database is composed of a plurality of columns, each column has a column name, called column name, and the column name has corresponding annotation information and default value, which is not limited in the present invention.
Optionally, there may be a part of the data in the original table that is already archived and a part that is not already archived (archived data), the present invention may create a corresponding intermediate table only for the archived data, and the table name of the intermediate table may be obtained from the configuration table in S100, which is not limited by the present invention.
As shown in fig. 2 in conjunction with the embodiment shown in fig. 1, in some optional embodiments, after S200, the method further includes: 210. s220 and S230;
s210, storing the non-archived data in the original table to the intermediate table;
optionally, as described above, the archived data in the original table is subsequently archived to the archived table, and for data security, the non-archived data in the original table may be stored in the intermediate table, so as to facilitate subsequent deletion of the original table, which is not limited in the present invention.
S220, obtaining the index information and the constraint information of the original table from the data dictionary corresponding to the original table;
optionally, the index information and the constraint information are concepts known in the art, and details of the present invention are not repeated here, for which, please refer to related descriptions in the art. It should be noted that: the index is an independent storage structure, is established based on one or more columns of a data table, and points to a logic pointer of a data page with a column value, similar to a directory of a book; constraints refer to the rule requirements for the values of the columns in the data table.
The index information can be information of index types with different structures supported in databases such as B-tree index, HASH index, full-text index, bitmap index and the like.
The constraint information may include: non-null constraints, unique constraints, primary key constraints, foreign key constraints, default constraints, and check constraints.
And S230, according to the index information of the original table and the constraint information of the original table, performing corresponding primary key establishment processing, index establishment processing and effective constraint processing on the intermediate table in a parallel mode.
Optionally, the present invention may perform corresponding processing of establishing a primary key, processing of establishing an index, and processing of taking effect constraint in parallel by synchronously starting a plurality of processes, which is not limited in the present invention.
Optionally, the present invention does not limit the process of establishing the primary key, the process of establishing the index, and the process of validating the constraint.
For example, as shown in fig. 3, in some alternative embodiments, the S230 includes: s231, S232, and S233;
s231, establishing an index of the intermediate table according to the index information of the original table;
s232, according to the constraint information of the original table, taking effect of the unique constraint of the primary key of the intermediate table and other constraints of the intermediate table;
alternatively, validating the unique constraint and the other constraint may be understood as setting the unique constraint and the other constraint to a visible state, and the invention is not limited in this regard.
And S233, establishing a primary key of the intermediate table according to the index information of the original table and the constraint information of the original table.
Specifically, the present invention may combine the index and the unique constraint to obtain the primary key, which is not limited by the present invention.
Optionally, the unique constraint of the primary key of the original table is consistent with the unique constraint of the primary key of the intermediate table, which is not limited by the present invention.
Optionally, as shown in fig. 4 in combination with the previous embodiment, in some optional embodiments, after S233, the method further includes: s240;
s240, deleting the original table, and maintaining the intermediate table as a new original table.
S300, performing deletion primary key processing, failure index processing, failure constraint processing and newly-added partition processing on the filing table;
optionally, the present invention does not limit the processing of deleting the primary key, the processing of invalidating the index, the processing of invalidating the constraint, and the processing of newly adding the partition.
For example, as shown in fig. 5, in combination with the embodiment shown in fig. 1, in some alternative embodiments, the S300 includes: s310, S320, S330 and S340;
s310, deleting the primary key in the filing table;
optionally, deleting the primary key may reduce maintenance of the primary key index when the archive table inserts data, and improve efficiency of inserting the archive data.
S320, setting all indexes of the filing table to be in an invisible state;
optionally, the index is set to be in an invisible state, so that the index is unavailable, and therefore when data is inserted, data verification is not needed, index maintenance of a single record is not needed, and data archiving efficiency is improved.
S330, setting all the constraints of the filing table to be invisible;
optionally, the constraint is set to an invisible state, so that the constraint is unavailable, and therefore, when data is inserted, constraint maintenance of a single record is not needed, and data archiving efficiency is improved.
S340, if the filing table is a partition table, calling a partition maintenance function, and establishing a new newly-added partition in the filing table.
Optionally, as described above, the present invention may determine whether the archive table is the partition table based on the information such as whether the archive table obtained in S100 is the partition table, which is not limited in this respect.
It should be noted that: the partition is to divide the data in the data table into smaller subsets according to the corresponding keywords, and the partition table is a table divided into a plurality of subsets, which is not limited in the present invention.
Optionally, there is no necessary sequential execution order among S310, S320, S330, and S340, and the present invention is not limited thereto specifically, and any feasible manner falls within the protection scope of the present invention.
S400, storing the archiving data to the newly added partition of the archiving table;
optionally, in the actual storage process, the newly added partition may adaptively change according to the data amount of the archived data, that is, the size of the newly added partition is adaptively adjusted according to the data amount of the archived data, which is not limited in this respect.
S500, performing reconstruction main key processing, reconstruction index processing and effective constraint processing on the filing table in a parallel mode.
Optionally, as described above, the present invention may perform, in parallel, the primary key reconstruction processing, the index reconstruction processing, and the effective constraint processing on the archive table in a manner of synchronously starting a plurality of processes, which is not limited in this respect.
Optionally, the present invention does not limit the ways of the primary key reconstruction processing, index reconstruction processing, and constraint validation processing.
For example, as shown in fig. 6, in combination with the embodiment shown in fig. 1, in some alternative embodiments, the S500 includes: s510, S520, S530, and S540;
s510, obtaining the unique constraint information of the primary key of the original table from the data dictionary corresponding to the original table, and obtaining the index information of the filing table and other constraint information of the filing table from the data dictionary corresponding to the filing table;
s520, reconstructing the indexes of the filing table in parallel in batch according to the index information of the filing table;
s530, the unique constraint of the primary key of the filing table is validated according to the unique constraint information of the primary key, and other constraints of the filing table are validated according to other constraint information of the filing table;
s540, according to the index information of the filing table and the unique constraint information of the primary key, reconstructing the primary key of the filing table in parallel in batch.
Specifically, the present invention may combine the index of the archive table and the unique constraint of the archive table to obtain the primary key of the archive table, which is not limited by the present invention.
As shown in fig. 7, the present invention provides a data table archiving apparatus, including: a data obtaining unit 100, an intermediate table creating unit 200, a first archival table processing unit 300, a data storage unit 400, and a second archival table processing unit 500;
the data obtaining unit 100 is configured to obtain information of an original table to be archived from a configuration table, and obtain the original table and an archived table;
the intermediate table creating unit 200 is configured to create an intermediate table of the archived data in the original table according to the information of the original table, where the intermediate table synchronizes a table name annotation, a column name annotation, and a default value of a column of the original table;
the first archive table processing unit 300 is configured to perform primary key deletion processing, invalidation index processing, invalidation constraint processing, and partition addition processing on the archive table;
the data storage unit 400 is used for storing the archival data into the newly added partition of the archival table;
the second archive table processing unit 500 is configured to perform primary key reconstruction processing, index reconstruction processing, and constraint validation processing on the archive tables in a parallel manner.
In some alternative embodiments, in combination with the embodiment shown in fig. 7, the apparatus further comprises: the device comprises a first data storage unit, a first information acquisition unit and an intermediate table processing unit;
the first data storage unit is used for storing non-archived data in the original table into an intermediate table after the intermediate table of the archived data in the original table is created according to the information of the original table;
the first information obtaining unit is used for obtaining the index information and the constraint information of the original table from the data dictionary corresponding to the original table;
and the intermediate table processing unit is used for performing corresponding main key establishment processing, index establishment processing and effective constraint processing on the intermediate table in a parallel mode according to the index information of the original table and the constraint information of the original table.
In combination with the above embodiment, in some optional embodiments, the apparatus further comprises: an original table deleting unit;
and the original table deleting unit is used for deleting the original table and maintaining the intermediate table as a new original table after the intermediate table is correspondingly subjected to primary key establishment processing, index establishment processing and effective constraint processing in a parallel mode according to the index information of the original table and the constraint information of the original table.
Optionally, in some optional embodiments, the intermediate table processing unit includes: the device comprises an intermediate table index establishing unit, an intermediate table constraint validation unit and an intermediate table main key establishing unit;
the intermediate table index establishing unit is used for establishing an index of the intermediate table according to the index information of the original table;
the intermediate table constraint validation unit is used for validating the unique constraint of the main key of the intermediate table and other constraints of the intermediate table according to the constraint information of the original table;
and the intermediate table primary key establishing unit is used for establishing the primary key of the intermediate table according to the index information of the original table and the constraint information of the original table.
In some optional embodiments, in combination with the embodiment shown in fig. 7, the first archive table processing unit 300 includes: the device comprises a filing table primary key deleting unit, a filing table index failure unit, a filing table constraint failure unit and a filing table newly-added partition unit;
the primary key deleting unit of the filing table is used for deleting the primary key in the filing table;
the filing table index failure unit is used for setting all indexes of the filing table to be in an invisible state;
the archive table constraint invalidation unit is used for setting all constraints of the archive table to be in an invisible state;
and the filing table newly-added partition unit is used for calling a partition maintenance function and establishing a new newly-added partition in the filing table if the filing table is a partition table.
In some optional embodiments, in combination with the embodiment shown in fig. 7, the second archive table processing unit 500 includes: the device comprises a second information acquisition unit, an archiving table index reconstruction unit, an archiving table constraint validation unit and an archiving table primary key reconstruction unit;
the second information obtaining unit is used for obtaining the unique constraint information of the primary key of the original table from the data dictionary corresponding to the original table, and obtaining the index information of the filing table and other constraint information of the filing table from the data dictionary corresponding to the filing table;
the archiving table index reconstruction unit is used for reconstructing the indexes of the archiving table in parallel in batch according to the index information of the archiving table;
the archive table constraint validation unit is used for validating the unique constraint of the primary key of the archive table according to the unique constraint information of the primary key and validating other constraints of the archive table according to other constraint information of the archive table;
and the primary key reconstruction unit of the filing table is used for reconstructing the primary keys of the filing table in parallel in batches according to the index information of the filing table and the unique constraint information of the primary keys.
The present invention provides a computer-readable storage medium having stored thereon a program which, when executed by a processor, implements any of the above-described data table archiving methods.
As shown in fig. 8, the present invention provides an electronic device 70, wherein the electronic device 70 includes at least one processor 701, at least one memory 702 connected to the processor 701, and a bus 703; the processor 701 and the memory 702 complete communication with each other through the bus 703; the processor 701 is configured to call the program instructions in the memory 702 to execute any of the above data table archiving methods.
In the present invention, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (10)
1. A data table archiving method, characterized by comprising:
obtaining information of an original table to be archived from a configuration table, and obtaining the original table and an archiving table;
creating an intermediate table of the archived data in the original table according to the information of the original table, wherein the intermediate table synchronizes table name annotations, column name annotations and default values of columns of the original table;
performing deletion main key processing, failure index processing, failure constraint processing and newly-added partition processing on the filing table;
storing the archival data to a newly added partition of the archival table;
and performing reconstruction main key processing, reconstruction index processing and effective constraint processing on the filing table in a parallel mode.
2. The method of claim 1, wherein after creating the intermediate table of archived data in the original table according to the information of the original table, the method further comprises:
storing the non-archived data in the original table to the intermediate table;
acquiring index information and constraint information of the original table from a data dictionary corresponding to the original table;
and according to the index information of the original table and the constraint information of the original table, performing corresponding primary key establishment processing, index establishment processing and effective constraint processing on the intermediate table in a parallel mode.
3. The method according to claim 2, wherein after performing the corresponding primary key establishment process, index establishment process and effective constraint process on the intermediate table in the parallel manner according to the index information of the original table and the constraint information of the original table, the method further comprises:
and deleting the original table, and maintaining the intermediate table as a new original table.
4. The method according to claim 2, wherein the performing, in the parallel manner, corresponding primary key establishment processing, index establishment processing, and effective constraint processing on the intermediate table according to the index information of the original table and the constraint information of the original table comprises:
establishing an index of the intermediate table according to the index information of the original table;
according to the constraint information of the original table, taking effect of the unique constraint of the primary key of the intermediate table and other constraints of the intermediate table;
and establishing a main key of the intermediate table according to the index information of the original table and the constraint information of the original table.
5. The method of claim 1, wherein the performing of delete primary key processing, invalidation index processing, invalidation constraint processing, and new partition processing on the archive table comprises:
deleting a primary key in the archive table;
setting indexes of the filing table to be in an invisible state;
setting all constraints of the filing table to be in an invisible state;
and if the filing table is a partition table, calling a partition maintenance function, and establishing a new newly-added partition in the filing table.
6. The method according to claim 1, wherein the performing, in a parallel manner, the rebuilding primary key processing, the rebuilding index processing and the validation constraint processing on the archive table comprises:
acquiring unique constraint information of a primary key of the original table from a data dictionary corresponding to the original table, and acquiring index information of the filing table and other constraint information of the filing table from a data dictionary corresponding to the filing table;
according to the index information of the filing table, parallelly reconstructing the indexes of the filing table in batch;
validating the unique constraint of the primary key of the filing table according to the unique constraint information of the primary key and validating other constraints of the filing table according to other constraint information of the filing table;
and according to the index information of the filing table and the unique constraint information of the primary key, reconstructing the primary key of the filing table in parallel in batches.
7. A data table archiving apparatus, comprising: the device comprises a data obtaining unit, an intermediate table creating unit, a first filing table processing unit, a data storage unit and a second filing table processing unit;
the data obtaining unit is used for obtaining information of an original table to be archived from a configuration table and obtaining the original table and the archival table;
the intermediate table creating unit is used for creating an intermediate table of the archived data in the original table according to the information of the original table, wherein the intermediate table synchronizes the table name annotation, the column name annotation and the default value of the column of the original table;
the first filing table processing unit is used for performing deletion primary key processing, failure index processing, failure constraint processing and newly-added partition processing on the filing table;
the data storage unit is used for storing the archival data into a newly added partition of the archival table;
and the second filing table processing unit is used for performing reconstruction main key processing, reconstruction index processing and effective constraint processing on the filing table in a parallel mode.
8. The apparatus of claim 7, further comprising: the device comprises a first data storage unit, a first information acquisition unit and an intermediate table processing unit;
the first data storage unit is used for storing non-archived data in the original table into an intermediate table after the intermediate table of the archived data in the original table is created according to the information of the original table;
the first information obtaining unit is used for obtaining the index information and the constraint information of the original table from the data dictionary corresponding to the original table;
and the intermediate table processing unit is used for performing corresponding main key establishment processing, index establishment processing and effective constraint processing on the intermediate table in a parallel mode according to the index information of the original table and the constraint information of the original table.
9. A computer-readable storage medium on which a program is stored, the program, when being executed by a processor, implementing the data table archiving method according to any one of claims 1 to 6.
10. An electronic device comprising at least one processor, and at least one memory, bus connected to the processor; the processor and the memory complete mutual communication through the bus; the processor is configured to call program instructions in the memory to perform the data table archiving method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210675099.XA CN114880409A (en) | 2022-06-15 | 2022-06-15 | Data table filing method and related device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210675099.XA CN114880409A (en) | 2022-06-15 | 2022-06-15 | Data table filing method and related device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114880409A true CN114880409A (en) | 2022-08-09 |
Family
ID=82681224
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210675099.XA Pending CN114880409A (en) | 2022-06-15 | 2022-06-15 | Data table filing method and related device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114880409A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116204534A (en) * | 2023-05-06 | 2023-06-02 | 深圳市华磊迅拓科技有限公司 | Data archiving method, device, equipment and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106682002A (en) * | 2015-11-05 | 2017-05-17 | 中兴通讯股份有限公司 | Database synchronization method and system, source data and target data synchronization device |
CN108255909A (en) * | 2017-07-27 | 2018-07-06 | 平安科技(深圳)有限公司 | Tables of data backup method and server based on oracle database |
CN108470045A (en) * | 2018-03-06 | 2018-08-31 | 平安科技(深圳)有限公司 | The method and storage medium that electronic device, data chain type are filed |
CN110489426A (en) * | 2019-08-26 | 2019-11-22 | 杭州安恒信息技术股份有限公司 | A kind of automation partition method, device and the equipment of database table |
CN110928883A (en) * | 2018-08-31 | 2020-03-27 | 上海汽车集团股份有限公司 | Data archiving method and device |
CN112181945A (en) * | 2020-09-28 | 2021-01-05 | 中国平安人寿保险股份有限公司 | Data archiving processing method and device, computer equipment and storage medium |
CN112395296A (en) * | 2020-12-03 | 2021-02-23 | 平安消费金融有限公司 | Big data archiving method, device, equipment and storage medium |
CN114003558A (en) * | 2021-11-09 | 2022-02-01 | 中国建设银行股份有限公司 | Data archiving method, device, equipment and storage medium |
-
2022
- 2022-06-15 CN CN202210675099.XA patent/CN114880409A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106682002A (en) * | 2015-11-05 | 2017-05-17 | 中兴通讯股份有限公司 | Database synchronization method and system, source data and target data synchronization device |
CN108255909A (en) * | 2017-07-27 | 2018-07-06 | 平安科技(深圳)有限公司 | Tables of data backup method and server based on oracle database |
CN108470045A (en) * | 2018-03-06 | 2018-08-31 | 平安科技(深圳)有限公司 | The method and storage medium that electronic device, data chain type are filed |
CN110928883A (en) * | 2018-08-31 | 2020-03-27 | 上海汽车集团股份有限公司 | Data archiving method and device |
CN110489426A (en) * | 2019-08-26 | 2019-11-22 | 杭州安恒信息技术股份有限公司 | A kind of automation partition method, device and the equipment of database table |
CN112181945A (en) * | 2020-09-28 | 2021-01-05 | 中国平安人寿保险股份有限公司 | Data archiving processing method and device, computer equipment and storage medium |
CN112395296A (en) * | 2020-12-03 | 2021-02-23 | 平安消费金融有限公司 | Big data archiving method, device, equipment and storage medium |
CN114003558A (en) * | 2021-11-09 | 2022-02-01 | 中国建设银行股份有限公司 | Data archiving method, device, equipment and storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116204534A (en) * | 2023-05-06 | 2023-06-02 | 深圳市华磊迅拓科技有限公司 | Data archiving method, device, equipment and storage medium |
CN116204534B (en) * | 2023-05-06 | 2023-07-07 | 深圳市华磊迅拓科技有限公司 | Data archiving method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3692054B2 (en) | Document structure conversion method, document structure conversion apparatus, and program | |
KR101246996B1 (en) | Electronic data snapshot generator | |
US8768970B2 (en) | Providing alternatives within a family tree systems and methods | |
US7634632B2 (en) | Aggregating data from different sources | |
US20150302111A1 (en) | Method and Apparatus for Constructing File System in Key-Value Storage System, and Electronic Device | |
US10776345B2 (en) | Efficiently updating a secondary index associated with a log-structured merge-tree database | |
US8315978B2 (en) | Synchronization adapter for synchronizing data to applications that do not directly support synchronization | |
JPWO2007083371A1 (en) | Data integration apparatus, data integration method, and computer-readable recording medium recording data integration program | |
CN109739828B (en) | Data processing method and device and computer readable storage medium | |
CN109684270B (en) | Database archiving method, device, system, equipment and readable storage medium | |
CN114880409A (en) | Data table filing method and related device | |
US20220253413A1 (en) | Application and database migration to a block chain data lake system | |
US20220083507A1 (en) | Trust chain for official data and documents | |
KR20060111253A (en) | Identity system for use in a computing environment | |
CN110334333B (en) | Information modification method and related device | |
US20080294632A1 (en) | Method and System for Sorting/Searching File and Record Media Therefor | |
CN116821133A (en) | Data processing method and device | |
CN106649556A (en) | Method and device for deleting multiple layered repetitive data based on distributed file system | |
CN105608103A (en) | Transforming method and device of data storing structure | |
US20220035792A1 (en) | Determining metadata of a dataset | |
JP3649472B2 (en) | Information retrieval device | |
WO2008128185A1 (en) | Keyword-based content management | |
US20190114371A1 (en) | System and method for managing contact names that identify the same person | |
CN117131023B (en) | Data table processing method, device, computer equipment and readable storage medium | |
US20180225318A1 (en) | Data storing method using multi-version based data structure |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |