Data migration method, device, electronic equipment and computer storage medium

By preprocessing and splitting the database, the problem of long data processing and transmission time in database migration is solved, and the effect of quickly completing cross-platform database migration is achieved.

CN113742317BActive Publication Date: 2025-03-14CHINA CONSTRUCTION BANK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111055161.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-09
Publication Date
2025-03-14
Estimated Expiration
2041-09-09

AI Technical Summary

Technical Problem

In the prior art, the data processing time and data transmission time are long during the database migration process, resulting in the inability to quickly complete the cross-platform migration of the database.

Method used

By determining the first and second devices that are migrated across platforms and preprocessing them, it is determined whether the cross-platform migration tablespace XTTS migration conditions are met. If satisfied, migrate the metadata in the first database to the second database, and divide the application table statistics, migrate it to the second database according to the preset migration rules, and finally verify the migrated data.

Benefits of technology

It reduces the time for data processing and data transmission, and realizes the rapid completion of cross-platform migration of databases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113742317B_ABST
    Figure CN113742317B_ABST
Patent Text Reader

Abstract

The present invention provides a data migration method, device, electronic device and computer storage medium, including determining a first device and a second device for cross-platform migration, and pre-processing the first device and the second device; based on the collected device information of the first device and the second device, determining whether the pre-processed first device and the second device meet the preset cross-platform migration table space XTTS migration conditions; if satisfied, after migrating the metadata in the first database to the second database, segmenting the application table statistical information exported from the first database, and presetting the migration rules to migrate the processed application table statistical information to the second database; verifying the data corresponding to the metadata and application table statistical information in the second database after migration; if the verification is passed, determining that the data migration is completed. The above method can not only reduce the time of data processing and data transmission, but also quickly complete the cross-platform migration of the database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of database migration data, and in particular to a data migration method, device, electronic equipment and computer storage medium. Background Art

[0002] At present, the traditional database migration uses the Cross Platform Transportable Tablespaces (XTTS) method to process the data of a single tablespace in the source database in sequence, and then move the processed data to the target database in sequence. Since the traditional method is used to process the data in sequence, the data processing time is long, and the data transmission time is also long, and thus the cross-platform migration of the database cannot be completed quickly. Summary of the invention

[0003] In view of this, an embodiment of the present invention provides a data migration method, device, electronic device and computer storage medium to solve the problem in the prior art that the data processing time is long and the data transmission time is also long, and thus the problem of being unable to quickly complete cross-platform migration of the database.

[0004] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0005] A first aspect of an embodiment of the present invention shows a data migration method, the method comprising:

[0006] Determine a first device and a second device for cross-platform migration, and pre-process the first device and the second device, wherein the first device includes a first database, and the second device includes a second database;

[0007] Based on the collected device information of the first device and the second device, determining whether the preprocessed first device and the second device meet a preset cross-platform migration tablespace XTTS migration condition;

[0008] If satisfied, after migrating the metadata in the first database to the second database, segmenting the application table statistics information exported from the first database, and migrating the processed application table statistics information to the second database according to a preset migration rule;

[0009] Verifying data corresponding to the metadata and the application table statistics in the second database after migration;

[0010] If the verification passes, the data migration is complete.

[0011] Optionally, before processing the application table statistical information exported from the first database and migrating the processed application table statistical information to the second database according to a preset migration rule, the method further includes:

[0012] Initializing the first database and the second database;

[0013] Performing incremental backup processing and incremental recovery processing on the first database and the second database;

[0014] The metadata is exported from the first database and imported into the second database.

[0015] Optionally, the segmenting of the application table statistical information exported from the first database, and migrating the processed application table statistical information to the second database according to a preset migration rule, includes:

[0016] Obtain application table statistical information exported from the first database;

[0017] According to the central processing unit CPU configuration information of the second database, the SQL statement corresponding to the application table statistical information is segmented to obtain N statement scripts, where N refers to the number of segments, and the value of N is a positive integer greater than or equal to 1;

[0018] The N statement scripts are migrated to the second database according to preset migration rules.

[0019] Optionally, the SQL statement corresponding to the application table statistical information is segmented according to the central processing unit CPU configuration information of the second database to obtain N statement scripts, including:

[0020] Collecting CPU configuration information of the second device;

[0021] Determine the number N of segments that can be split according to the central processing unit (CPU) configuration information of the second device;

[0022] The SQL statement corresponding to the application table statistical information is divided into N statement scripts based on the splittable number N.

[0023] Optionally, the data verification of the metadata and the application table statistical information in the migrated second database includes:

[0024] Determine whether the metadata and application table statistics of the second database corresponding to the first database after migration are consistent with the metadata and application table statistics of the first database;

[0025] If they are inconsistent, it is determined that there is an abnormality in the data migration;

[0026] If they are consistent, the data migration is complete.

[0027] A second aspect of an embodiment of the present invention shows a data migration device, the device comprising:

[0028] A first determining unit, configured to determine a first device and a second device for cross-platform migration, and pre-process the first device and the second device, wherein the first device includes a first database, and the second device includes a second database;

[0029] A second determination unit is used to determine whether the preprocessed first device and the second device meet a preset cross-platform migration tablespace XTTS migration condition based on the collected device information of the first device and the second device, and if so, execute a segmentation processing unit;

[0030] A segmentation processing unit, configured to segment the application table statistical information exported from the first database after migrating the metadata in the first database to the second database, and migrate the processed application table statistical information to the second database according to a preset migration rule;

[0031] A verification unit is used to verify the data corresponding to the metadata and the application table statistical information in the second database after migration; if the verification passes, it is determined that the data migration is completed.

[0032] Optionally, also include:

[0033] An initialization processing unit, used for performing initialization processing on the first database and the second database;

[0034] An incremental backup / restore unit, used for performing incremental backup processing and incremental restore processing on the first database and the second database;

[0035] The metadata migration unit is used to export metadata from the first database and import it into a second database.

[0036] Optionally, the segmentation processing unit includes:

[0037] An acquisition module, used for acquiring application table statistical information exported by the first database;

[0038] A segmentation module, used for segmenting the SQL statement corresponding to the application table statistical information according to the central processing unit CPU configuration information of the second database to obtain N statement scripts, wherein N refers to the number of segments, and the value of N is a positive integer greater than or equal to 1;

[0039] A migration module is used to migrate the N statement scripts to the second database according to a preset migration rule.

[0040] A third aspect of an embodiment of the present invention shows an electronic device, which is used to run a program, wherein the program executes the data migration method shown in the first aspect of the embodiment of the present invention when it is run.

[0041] A fourth aspect of an embodiment of the present invention shows a computer storage medium, which includes a storage program, wherein when the program is running, the device where the storage medium is located is controlled to execute the data migration method shown in the first aspect of the embodiment of the present invention.

[0042] Based on the above-mentioned embodiment of the present invention, a data migration method, device, electronic device and computer storage medium are provided. The method includes determining a first device and a second device for cross-platform migration, and pre-processing the first device and the second device, wherein the first device includes a first database and the second device includes a second database; based on the collected device information of the first device and the second device, determining whether the pre-processed first device and the second device meet the preset cross-platform migration table space XTTS migration conditions; if satisfied, after migrating the metadata in the first database to the second database, the application table statistical information exported from the first database is segmented, and the processed application table statistical information is migrated to the second database according to the preset migration rules; the data corresponding to the metadata and application table statistical information in the second database after migration is verified; if the verification is passed, it is determined that the data migration is completed. In the embodiment of the present invention, when it is determined that the first device and the second device meet the preset cross-platform migration table space XTTS migration conditions, the metadata in the first database is migrated to the second database; then the application table statistical information exported from the first database is segmented, and the processed application table statistical information is migrated to the second database according to the preset migration rules. The data of the migrated second database is verified, and when the verification is passed, it is determined that the migration is successful. The above method can not only reduce the time of data processing and data transmission, but also quickly complete the cross-platform migration of the database. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0044] Figure 1 A schematic diagram of a data migration method according to an embodiment of the present invention;

[0045] Figure 2A schematic diagram of a process for segmenting application table statistical information according to an embodiment of the present invention;

[0046] Figure 3 A schematic diagram of a flow chart of another data migration method according to an embodiment of the present invention;

[0047] Figure 4 A flowchart of data migration shown in an embodiment of the present invention;

[0048] Figure 5 A schematic diagram of the structure of a data migration device according to an embodiment of the present invention;

[0049] Figure 6 The present invention is a schematic diagram of another data migration device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0052] In an embodiment of the present invention, when it is determined that the first device and the second device meet the preset cross-platform migration table space XTTS migration conditions, the metadata in the first database is migrated to the second database; then the application table statistics information exported from the first database is segmented, and the processed application table statistics information is migrated to the second database according to the preset migration rules. The migrated second database is subjected to data verification, and when the verification passes, the migration is determined to be successful. The above method can not only reduce the time for data processing and data transmission, but also quickly complete the cross-platform migration of the database.

[0053] like Figure 1 FIG. 1 is a flow chart of a data migration method according to an embodiment of the present invention, and the method includes:

[0054] S101: Determine a first device and a second device to be migrated across platforms, and pre-process the first device and the second device.

[0055] In step S101 , the first device includes a first database, and the second device includes a second database.

[0056] In the process of implementing step S101, the first device and the second device are selected and preprocessed, specifically, the network access relationship between the first device and the second device, the shared nas, and the system table space are checked to see whether they are ready; when the first device and the second device can access each other, the first device and the second device are attached to the same shared nas, and the space size is ready, step S102 is executed.

[0057] It should be noted that the first device can be a source database, that is, a first database 11g version host (to be upgraded); the second can be a target database, that is, a second database 19c version host.

[0058] S102: Based on the collected device information of the first device and the second device, determine whether the preprocessed first database of the first device and the second database of the second device meet the preset cross-platform migration tablespace (Cross Platform Transportable Tablespaces, XTTS) migration conditions; if so, execute step S103; if either one does not meet the conditions, it needs to be modified and step S102 is re-executed.

[0059] In step S102, the device information includes information such as the disk group space size, compatibility parameters, deferred_segment_creation parameters, tablespace, and location of data files.

[0060] In the process of implementing step S103, the device information of the first device and the second device is first collected; then it is determined whether the compatibility parameter of the first database is greater than the first threshold, whether the deferred_segment_creation parameter of the first database is set to false; whether there is an advanced queue in the first database; whether there is an external table in the first database; whether the table space and data files of the first database are online; whether the first database is in archive mode; whether the application tables and data of the first database are stored in the system SYSTEM / system auxiliary SYSAUX / user USERS table space; whether the version of the second device is 19c; whether the database character sets of the first device and the second device are consistent. When the compatibility parameter of the first database is greater than the first threshold, the deferred_segment_creation parameter of the first database is set to false; there is no advanced queue in the first database; there is no external table in the first database; the table space and data files of the first database are all online; the first database is in archive mode; the application tables and data of the first database are not stored in the system SYSTEM / system auxiliary SYSAUX / user USERS table space; the version of the second device is 19c; the database character sets of the first device and the second device are consistent, then it indicates whether the first database of the first device and the second database of the second device meet the preset XTTS migration conditions, and execute step S103. If any one of them is not met, it needs to be modified and step S102 is re-executed.

[0061] It should be noted that the first threshold is set in advance by technicians based on experience, for example, it can be set to 10.2.

[0062] The disk group space of the second device is not less than the disk group space of the first device.

[0063] Optionally, when it is determined that the first database has an advanced queue and / or the first database has an external table, the first database needs to be processed separately, such as removing the external table and excluding it from the advanced queue.

[0064] Optionally, when it is determined that the table space and data files of the first database are not online, it is necessary to obtain the offline table space and data files.

[0065] S103: After the metadata in the first database is migrated to the second database, the application table statistical information exported from the first database is segmented, and the processed application table statistical information is migrated to the second database according to a preset migration rule.

[0066] In the specific implementation of step S103, Figure 2 As shown, the following steps are included:

[0067] S201: Obtain application table statistical information exported from the first database.

[0068] Optionally, the first device collects statistics on the application table data in the first database and generates corresponding application table statistical information.

[0069] In the specific implementation of step S201, the application table statistical information of the first database is exported.

[0070] S202: According to the central processing unit CPU configuration information of the second database, the SQL statement corresponding to the application table statistical information is divided to obtain N statement scripts.

[0071] In step S202, N refers to the number of segments, and the value of N is a positive integer greater than or equal to 1.

[0072] In the specific implementation process of step S202: collect the central processing unit CPU configuration information of the second device; determine the number N that can be split according to the central processing unit CPU configuration information of the second device; and split the SQL statement corresponding to the application table statistical information into N statement scripts based on the number N that can be split.

[0073] S203: Migrate the N statement scripts to the second database according to preset migration rules.

[0074] In step S203, the preset migration rule is set in advance according to actual conditions, for example, the preset migration rule can be set to be executed concurrently.

[0075] In the specific implementation of step S203 , the N statement scripts are executed concurrently through multiple processes to migrate the N statement scripts to the second database.

[0076] S104: Verify the data corresponding to the metadata and the application table statistical information in the migrated second database. If the verification passes, execute step S105; if the verification fails, execute step S106.

[0077] In the process of implementing step S104, it is determined whether the metadata and application table statistics of the first database in the second database after migration are consistent with the metadata and application table statistics of the first database. If they are consistent, step S105 is executed; if they are inconsistent, step S106 is executed.

[0078] S105: Determine that data migration is complete.

[0079] In the specific implementation of step S105, it is determined that the second database verification has passed.

[0080] S106: Determine that data migration is abnormal.

[0081] In an embodiment of the present invention, when it is determined that the first device and the second device meet the preset cross-platform migration table space XTTS migration conditions, the metadata in the first database is migrated to the second database; then the application table statistics information exported from the first database is segmented, and the processed application table statistics information is migrated to the second database according to the preset migration rules. The migrated second database is subjected to data verification, and when the verification passes, the migration is determined to be successful. The above method can not only reduce the time for data processing and data transmission, but also quickly complete the cross-platform migration of the database.

[0082] Based on the data migration method shown in the above embodiment of the present invention, the present invention also discloses a specific implementation process of the data migration method, such as Figure 3 As shown, the method includes:

[0083] S301: Determine a first device and a second device to be migrated across platforms, and pre-process the first device and the second device.

[0084] S302: Based on the collected device information of the first device and the second device, determine whether the preprocessed first database of the first device and the second database of the second device meet the preset XTTS migration conditions. If so, execute step S303. If either one does not meet the conditions, it needs to be modified and step S302 is executed again.

[0085] It should be noted that the specific implementation process of step S301 to step S302 is the same as the specific implementation process of step S101 to step S102 above, and they can refer to each other.

[0086] S303: Initialize the first database and the second database.

[0087] Optionally, before initializing the data file, initialization settings are required. Specifically, the migration script is sent to the second device; statistical information of the base table and data dictionary of the first database is collected; then the master file association tns file in the second database is modified to create a database link dblink; users and roles of the second device and the first device are compared; block tracking is turned on for the first database; an incremental directory and a data file directory are created; and node 2 of the second database is stopped.

[0088] In the specific implementation process of step S303, the first database generates a corresponding XTTS configuration file, and the second device initiates a full data file transfer to the first device; the first database exports the statistical information corresponding to its own data to be migrated; the second database imports the statistical information of the first database, and then upgrades it, and verifies the transmission effect, thereby realizing the transmission of the full database file from the first database to the second database.

[0089] S304: Perform incremental backup and incremental recovery on the initialized first database and the second database.

[0090] In the specific implementation of step S304, in order to shorten the data file gap between the first database and the second database, it is necessary to configure the incremental backup parallelism before the first device and the second device stop running; and perform the first incremental backup of the first database, and perform the first incremental recovery of the backed-up data to the second database, and mark the incremental backup starting point; then determine whether the first database is connected to other databases except the second database, and whether other processes are running; if not, perform the last incremental backup and incremental recovery of the first database and the second database. If so, execute step S305.

[0091] It should be noted that incremental backup is a type of backup, which means that after a full backup or the last incremental backup, each subsequent backup only needs to back up the files that have been added or modified compared to the previous one.

[0092] S305: Export metadata from the first database and import it into the second database.

[0093] In the specific implementation of step S305, the metadata is exported from the first database and then imported into the second database.

[0094] S306: Process the application table statistical information exported from the first database, and migrate the processed application table statistical information to the second database according to preset migration rules.

[0095] S307: Verify the data corresponding to the metadata and the application table statistical information in the migrated second database. If the verification passes, execute step S308; if the verification fails, execute step S309.

[0096] S308: Determine that data migration is complete.

[0097] S309: Determine that data migration is abnormal.

[0098] It should be noted that the specific implementation process of step S308 to step S309 is the same as the specific implementation process of step S105 to step S106 above, and they can refer to each other.

[0099] In the embodiment of the present invention, based on Figure 3 The flowchart of the data migration method shown in FIG. 1 is a flowchart of the data migration method shown in FIG. 1 . Correspondingly, the embodiment of the present invention also discloses a flowchart of the data migration, such as Figure 4 shown.

[0100] In an embodiment of the present invention, when it is determined that the first device and the second device meet the preset cross-platform migration table space XTTS migration conditions, the first database and the second database are initialized; the first database and the second database after the initialization process are incrementally backed up and incrementally restored. The metadata in the first database is then migrated to the second database; then the application table statistical information exported from the first database is segmented, and the processed application table statistical information is migrated to the second database according to the preset migration rules. The data of the migrated second database is verified, and when the verification passes, the migration is determined to be successful. The above method can not only reduce the time for data processing and data transmission, but also quickly complete the cross-platform migration of the database.

[0101] Based on the data migration method shown in the above embodiment of the present invention, the embodiment of the present invention also discloses a data migration device, such as Figure 5 The above is a schematic diagram of a data migration device according to an embodiment of the present invention, and the device includes:

[0102] The first determining unit 501 is used to determine a first device and a second device for cross-platform migration, and pre-process the first device and the second device, wherein the first device includes a first database, and the second device includes a second database.

[0103] The second determination unit 502 is used to determine whether the pre-processed first device and the second device meet the preset cross-platform migration table space XTTS migration conditions based on the collected device information of the first device and the second device, and if so, execute the segmentation processing unit 503.

[0104] The segmentation processing unit 503 is used to segment the application table statistical information exported from the first database after migrating the metadata in the first database to the second database, and migrate the processed application table statistical information to the second database according to preset migration rules.

[0105] The verification unit 504 is used to verify the data corresponding to the metadata and the application table statistical information in the second database after migration; if the verification passes, it is determined that the data migration is completed.

[0106] Optionally, the verification unit 504 is specifically used to: determine whether the metadata and application table statistical information corresponding to the first database in the second database after migration are consistent with the metadata and application table statistical information of the first database; if inconsistent, determine that there is an abnormality in the data migration; if consistent, determine that the data migration is completed.

[0107] It should be noted that the specific principles and execution processes of each unit in the data migration device disclosed in the above-mentioned embodiment of the present application are the same as the data migration method shown in the above-mentioned implementation of the present application. Please refer to the corresponding parts of the data migration method disclosed in the above-mentioned embodiment of the present application, and no further details will be given here.

[0108] In an embodiment of the present invention, when it is determined that the first device and the second device meet the preset cross-platform migration table space XTTS migration conditions, the metadata in the first database is migrated to the second database; then the application table statistics information exported from the first database is segmented, and the processed application table statistics information is migrated to the second database according to the preset migration rules. The migrated second database is subjected to data verification, and when the verification passes, the migration is determined to be successful. The above method can not only reduce the time for data processing and data transmission, but also quickly complete the cross-platform migration of the database.

[0109] Optionally, based on the data migration device shown in the above embodiment of the present invention, Figure 5 , see Figure 6 , the device further comprises:

[0110] The initialization processing unit 505 is used to perform initialization processing on the first database and the second database.

[0111] The incremental backup / restore unit 506 is used to perform incremental backup processing and incremental restore processing on the first database and the second database after the initialization processing.

[0112] The metadata migration unit 507 is used to export metadata from the first database and import it into the second database.

[0113] In an embodiment of the present invention, when it is determined that the first device and the second device meet the preset cross-platform migration table space XTTS migration conditions, the first database and the second database are initialized; the first database and the second database after the initialization process are incrementally backed up and incrementally restored. The metadata in the first database is then migrated to the second database; then the application table statistical information exported from the first database is segmented, and the processed application table statistical information is migrated to the second database according to the preset migration rules. The data of the migrated second database is verified, and when the verification passes, the migration is determined to be successful. The above method can not only reduce the time for data processing and data transmission, but also quickly complete the cross-platform migration of the database.

[0114] Optionally, based on the data migration device shown in the above embodiment of the present invention, the segmentation processing unit 503 includes:

[0115] An acquisition module is used to acquire application table statistical information exported from the first database.

[0116] A segmentation module is used to segment the SQL statements corresponding to the application table statistical information according to the central processing unit CPU configuration information of the second database to obtain N statement scripts, where N refers to the number of segments and the value of N is a positive integer greater than or equal to 1.

[0117] Optionally, a splitting module is specifically used to: collect the central processing unit CPU configuration information of the second device; determine the number N that can be split according to the central processing unit CPU configuration information of the second device; and split the SQL statement corresponding to the application table statistical information into N statement scripts based on the number N that can be split.

[0118] A migration module is used to migrate the N statement scripts to the second database according to a preset migration rule.

[0119] In an embodiment of the present invention, when it is determined that the first device and the second device meet the preset cross-platform migration table space XTTS migration conditions, the metadata in the first database is migrated to the second database; then the application table statistics information exported by the first database is obtained; according to the central processing unit CPU configuration information of the second database, the SQL statements corresponding to the application table statistics information are segmented to obtain N statement scripts; and then the N statement scripts are migrated to the second database according to the preset migration rules. The data of the migrated second database is verified, and when the verification passes, the migration is determined to be successful. The above method can not only reduce the time for data processing and data transmission, but also quickly complete the cross-platform migration of the database.

[0120] The embodiment of the present invention also discloses an electronic device, which is used to run a database storage process, wherein the above-mentioned Figure 1 , Figure 2 and Figure 3 Public data migration methods.

[0121] The embodiment of the present invention also discloses a computer storage medium, wherein the storage medium includes a storage database storage process, wherein when the database storage process is running, the device where the storage medium is located is controlled to execute the above Figure 1 , Figure 2 and Figure 3 Public data migration methods.

[0122] In the context of the present disclosure, a computer storage medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0123] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0124] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0125] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data migration method, characterized in that: The method comprises: Determine a first device and a second device for cross-platform migration, and pre-process the first device and the second device, wherein the first device includes a first database, and the second device includes a second database; Based on the collected device information of the first device and the second device, determining whether the preprocessed first device and the second device meet a preset cross-platform migration tablespace XTTS migration condition; If satisfied, after migrating the metadata in the first database to the second database, segmenting the application table statistics information exported from the first database, and migrating the processed application table statistics information to the second database according to a preset migration rule; Verifying data corresponding to the metadata and the application table statistics in the second database after migration; If the verification passes, the data migration is completed; The segmenting of the application table statistical information exported from the first database and migrating the processed application table statistical information to the second database according to a preset migration rule includes: Obtain application table statistical information exported from the first database; According to the central processing unit CPU configuration information of the second database, the SQL statement corresponding to the application table statistical information is segmented to obtain N statement scripts, where N refers to the number of segments, and the value of N is a positive integer greater than or equal to 1; The N statement scripts are migrated to the second database according to preset migration rules.

2. The method according to claim 1, characterized in that Before processing the application table statistical information exported from the first database and migrating the processed application table statistical information to the second database according to a preset migration rule, the method further includes: Initializing the first database and the second database; Performing incremental backup processing and incremental recovery processing on the first database and the second database; The metadata is exported from the first database and imported into the second database.

3. The method according to claim 1, characterized in that The method of dividing the SQL statements corresponding to the application table statistical information according to the central processing unit CPU configuration information of the second database to obtain N statement scripts includes: Collecting CPU configuration information of the second device; Determine the number N of segments that can be split according to the central processing unit (CPU) configuration information of the second device; The SQL statement corresponding to the application table statistical information is divided into N statement scripts based on the splittable number N.

4. The method according to claim 1, characterized in that: The data verification of the metadata and the application table statistical information corresponding to the migrated second database includes: Determine whether the metadata and application table statistics of the second database corresponding to the first database after migration are consistent with the metadata and application table statistics of the first database; If they are inconsistent, it is determined that there is an abnormality in the data migration; If they are consistent, the data migration is complete.

5. A data migration device, characterized in that: The device comprises: A first determining unit, configured to determine a first device and a second device for cross-platform migration, and pre-process the first device and the second device, wherein the first device includes a first database, and the second device includes a second database; A second determination unit is used to determine whether the preprocessed first device and the second device meet a preset cross-platform migration tablespace XTTS migration condition based on the collected device information of the first device and the second device, and if so, execute a segmentation processing unit; a segmentation processing unit, configured to segment the application table statistics information exported from the first database after migrating the metadata in the first database to the second database, and migrate the processed application table statistics information to the second database according to a preset migration rule; A verification unit, used to verify the data corresponding to the metadata and the application table statistical information in the second database after migration; if the verification passes, it is determined that the data migration is completed; Wherein, the segmentation processing unit includes: An acquisition module, used for acquiring application table statistical information exported by the first database; A segmentation module, used for segmenting the SQL statement corresponding to the application table statistical information according to the central processing unit CPU configuration information of the second database to obtain N statement scripts, wherein N refers to the number of segments, and the value of N is a positive integer greater than or equal to 1; A migration module is used to migrate the N statement scripts to the second database according to a preset migration rule.

6. The device according to claim 5, characterized in that Also includes: An initialization processing unit, used for performing initialization processing on the first database and the second database; An incremental backup / restore unit, used for performing incremental backup processing and incremental restore processing on the first database and the second database; The metadata migration unit is used to export metadata from the first database and import it into a second database.

7. An electronic device, characterized in that: The electronic device is used to run a program, wherein the program executes the data migration method as described in any one of claims 1 to 4 when running.

8. A computer storage medium, characterized in that: The storage medium includes a storage program, wherein when the program is running, the device where the storage medium is located is controlled to execute the data migration method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Cross-platform migrating method and system for Oracle database

    CN104899333A

  • Transmission table space automatic migration method and system based on Zabbix

    CN110019138A