Database migration method and device from oracle to gaussdb

CN116775609BActive Publication Date: 2026-09-18INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310761938.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-26
Publication Date
2026-09-18
Estimated Expiration
2043-06-26

AI Technical Summary

Technical Problem

[0004]上述常规技术方案的缺点是:数据转换过程情况复杂,易产生数据转换错误

Benefits of technology

[0025]In this embodiment of the invention, data interaction with system application servers related to the Oracle and GaussDB databases is stopped, and the anchor point at which data interaction stops is recorded. A GaussDB database version is deployed. Full data synchronization from the Oracle database to the GaussDB database is performed using the DRS tool. Incremental data within the time period from the cessation of data interaction to full data synchronization is obtained, and incremental data synchronization is performed using the DRS tool with the anchor point. The system application servers are started. The GaussDB database workflow is initiated. Business verification of the migrated GaussDB database is performed using the recording and playback group component. Compared with the existing technology that exports data from the original database, organizes the data according to the target database data format to form a script or migration text, and then imports it into the target database to complete the data migration, this method records the anchor point at which data interaction stops after stopping data interaction; after full data synchronization is completed, incremental data synchronization is performed using the DRS tool with the anchor point, avoiding missed incremental data migration; and the automated migration process is less prone to data conversion errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116775609B_ABST
    Figure CN116775609B_ABST
Patent Text Reader

Abstract

The application discloses an Oracle-to-GaussDB database migration method and device, relates to the technical field of databases, and can be applied to the field of financial technologies, and the method comprises the following steps: stopping data interaction of a system application server related to an Oracle database and a GaussDB database, recording an anchor point of the interaction stop; deploying a GaussDB database version; performing full-amount data synchronization from the Oracle database to the GaussDB database through a DRS tool; obtaining incremental data in a time period from the data interaction stop to the full-amount data synchronization, and performing incremental data synchronization through the DRS tool by taking the anchor point as a reference; starting the system application server; starting a workflow of the GaussDB database; and performing business verification on the GaussDB database after migration through a recording playback group component. The application can realize reliable and efficient Oracle-to-GaussDB database migration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database technology and can be used in the financial technology field, particularly to a database migration method and apparatus from Oracle to GaussDB. Background Technology

[0002] This section is intended to provide background or context for the embodiments of the invention set forth in the claims. The description herein is not an admission that it is prior art simply because it is included in this section.

[0003] The system built using a centralized dual-cluster deployment scheme of GaussDB distributed database, designed to support the migration of Oracle databases from large business systems, lacks a mature technical solution. The conventional approach involves exporting data from the original database, formatting it according to the target database's data format to create a script or migration text file, and then importing it into the target database to complete the data migration.

[0004] The disadvantages of the above-mentioned conventional technical solutions are: the data conversion process is complex and prone to errors; the migration cycle is long; and incremental data is prone to being missed during migration.

[0005] Therefore, a reliable and effective database migration solution from Oracle to GaussDB is particularly important. Summary of the Invention

[0006] This invention provides a method for migrating databases from Oracle to GaussDB, enabling reliable and efficient database migration from Oracle to GaussDB. The method includes:

[0007] Stop data interaction with system application servers related to Oracle database and GaussDB database, and record the anchor point at which data interaction stops;

[0008] Deploy the GaussDB database version;

[0009] Perform full data synchronization from Oracle database to GaussDB database using the DRS tool;

[0010] Obtain incremental data within the time period from the cessation of data interaction to full data synchronization, and use the anchor point to perform incremental data synchronization through the DRS tool;

[0011] Start the system application server;

[0012] Start the workflow for the GaussDB database;

[0013] The GaussDB database was used for business verification after migration by recording and replaying the data.

[0014] This invention also provides an Oracle to GaussDB database migration apparatus and a method for Oracle to GaussDB database migration, to achieve reliable and efficient Oracle to GaussDB database migration. The apparatus includes:

[0015] The stop module is used to stop data interaction with system application servers related to Oracle databases and GaussDB databases, and to record the anchor point at which data interaction stops.

[0016] The deployment module is used to deploy the GaussDB database version;

[0017] The full data synchronization module is used to perform full data synchronization from an Oracle database to a GaussDB database using the DRS tool.

[0018] The incremental data synchronization module is used to obtain incremental data during the time period from the cessation of data interaction to the full data synchronization, and to perform incremental data synchronization through the DRS tool using the anchor point.

[0019] The system application server startup module is used to start the system application server;

[0020] The workflow startup module is used to start workflows for the GaussDB database.

[0021] The business verification module is used to perform post-migration business verification of the GaussDB database through the recording and playback group component.

[0022] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the above-described Oracle to GaussDB database migration method.

[0023] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described Oracle to GaussDB database migration method.

[0024] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described Oracle to GaussDB database migration method.

[0025] In this embodiment of the invention, data interaction with system application servers related to the Oracle and GaussDB databases is stopped, and the anchor point at which data interaction stops is recorded. A GaussDB database version is deployed. Full data synchronization from the Oracle database to the GaussDB database is performed using the DRS tool. Incremental data within the time period from the cessation of data interaction to full data synchronization is obtained, and incremental data synchronization is performed using the DRS tool with the anchor point. The system application servers are started. The GaussDB database workflow is initiated. Business verification of the migrated GaussDB database is performed using the recording and playback group component. Compared with the existing technology that exports data from the original database, organizes the data according to the target database data format to form a script or migration text, and then imports it into the target database to complete the data migration, this method records the anchor point at which data interaction stops after stopping data interaction; after full data synchronization is completed, incremental data synchronization is performed using the DRS tool with the anchor point, avoiding missed incremental data migration; and the automated migration process is less prone to data conversion errors. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:

[0027] Figure 1 This is a flowchart of the database migration method from Oracle to GaussDB in an embodiment of the present invention;

[0028] Figure 2 This is another flowchart of the database migration method from Oracle to GaussDB in this embodiment of the invention;

[0029] Figure 3 This is a flowchart illustrating the process of stopping data interaction between the system application server and the Oracle database and GaussDB database in this embodiment of the invention.

[0030] Figure 4 This is a flowchart illustrating the full data synchronization from an Oracle database to a GaussDB database using the DRS tool in an embodiment of the present invention.

[0031] Figure 5 This is another flowchart illustrating the full data synchronization from an Oracle database to a GaussDB database using the DRS tool in this embodiment of the invention.

[0032] Figure 6This is a flowchart illustrating the database migration rollback in an embodiment of the present invention;

[0033] Figure 7 This is a schematic diagram of a database migration device from Oracle to GaussDB in an embodiment of the present invention;

[0034] Figure 8 This is a schematic diagram of a computer device in an embodiment of the present invention. Detailed Implementation

[0035] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0036] This invention relates to a deployment scheme for a dual-cluster mode of the GaussDB distributed database. By leveraging the technical features of storage-compute separation and centralized storage combined with hardware and software, it further enhances the high availability and database performance of GaussDB, supporting the transformation of large-scale business systems from Oracle databases.

[0037] The GaussDB dual-cluster solution is as follows:

[0038] Based on the multi-Region deployment feature, an independent database cluster is built within a general Region, constructing a high-availability architecture of dual clusters within the same city and disaster recovery in different locations, thereby improving high availability capabilities.

[0039] Based on the storage-compute separation feature and the adoption of the Dorado centralized storage high-availability solution in the same city, the storage layer breaks through the storage limitations of local disks. On the other hand, Dorado centralized storage has the advantages of strong read and write capabilities and low latency of disk-level data synchronization between clusters, which can further improve database performance.

[0040] The GaussDB database kernel is compatible with the RoCE network solution. Since the RoCE network does not have the capability of the SCSI protocol, it cannot avoid the risk of data inconsistency caused by multiple nodes writing to the shared log file at the same time in the network partition scenario. Therefore, an NFS shared volume accessed by IP network is introduced to manage the lock information for accessing the shared log file.

[0041] Figure 1 The flowchart of the database migration method from Oracle to GaussDB in this embodiment of the invention includes:

[0042] Step 101: Stop data interaction with the system application servers related to the Oracle database and GaussDB database, and record the anchor point where data interaction stops;

[0043] Step 102: Deploy the GaussDB database version;

[0044] Step 103: Perform full data synchronization from the Oracle database to the GaussDB database using the DRS tool;

[0045] Step 104: Obtain incremental data during the time period from the cessation of data interaction to full data synchronization, and use the anchor point to perform incremental data synchronization through the DRS tool;

[0046] Step 105: Start the system application server;

[0047] Step 106: Start the GaussDB database workflow;

[0048] Step 107: Perform business verification of the migrated GaussDB database using the recording and playback group component.

[0049] Compared with the existing technology that exports data from the original database, organizes the data according to the target database data format to form a script or text file, and then imports it into the target database to complete the data migration, this method records the anchor point where data interaction stops after the data interaction stops; after the full data synchronization is completed, incremental data synchronization is performed using the DRS tool based on the anchor point, avoiding the omission of incremental data migration; the automated migration process is less prone to data conversion errors.

[0050] Each step is described in detail below.

[0051] In step 101, stop data interaction with the system application servers related to the Oracle database and GaussDB database, and record the anchor point where data interaction stops;

[0052] CDC is an Oracle database real-time data synchronization tool, and DRS is a Gaussian database real-time data synchronization tool. During database migration, a common approach is to immobilize both databases (isolating them from external data interaction), migrate all data to the target database, and then directly initiate the synchronization mechanism with the external data. However, because there are two synchronization mechanisms, the time difference between stopping and starting can lead to the loss of incremental data. This problem is easily overlooked. This invention provides two methods to solve this problem:

[0053] One method is the anchoring method, which records the anchor point (bookmark) where data interaction stops. In step 104, incremental data synchronization is performed using the DRS tool based on the anchor point to ensure that the data synchronization between the old and new databases is continuous.

[0054] The second method is the quadratic full recovery method, see [link to documentation]. Figure 2Another process for migrating databases from Oracle to GaussDB includes:

[0055] Step 101: Stop data interaction with system application servers related to Oracle database and GaussDB database;

[0056] Step 102: Deploy the GaussDB database version;

[0057] Step 103: Perform full data synchronization from the Oracle database to the GaussDB database using the DRS tool;

[0058] Step 105: Start the system application server;

[0059] Step 106: Start the GaussDB database workflow;

[0060] Step 201: Perform a data consistency comparison between the Oracle database and the GaussDB database, obtain the difference data, and reply the difference data to the GaussDB database.

[0061] Step 107: Perform business verification of the migrated GaussDB database using the recording and playback group component.

[0062] In the above steps, after the database migration is completed, the synchronization mechanism between the old and new databases is restarted. Once the data synchronization progress is consistent, the data differences in the relevant synchronization tables are compared, and the data in the new database is restored after the difference data is sorted out.

[0063] See Figure 3 Stop data interaction with system application servers related to Oracle and GaussDB databases, including:

[0064] Step 301: Stop the external service functions of the system application server that interacts with the Oracle database and GaussDB database respectively;

[0065] Step 302: Stop the data synchronization operation of the Oracle database and record the anchor point where data interaction stops;

[0066] Step 303: Stop the availability monitoring of the system application server.

[0067] In step 102, deploy the GaussDB database version. The functions implemented after the GaussDB database migration are deployed through version implementation.

[0068] In step 103, a full data synchronization from the Oracle database to the GaussDB database is performed using the DRS tool. Data Replication Service (DRS) is an easy-to-use, stable, and efficient cloud service for real-time database migration and synchronization. DRS, centered around cloud databases, reduces the complexity of data flow between databases and effectively helps reduce data transfer costs. It can quickly resolve data flow issues between databases in various scenarios to meet data transfer business needs.

[0069] When performing full data synchronization using the DRS tool, the following problems may occur: 1. Because triggers are in the active state, all data is considered to have changed, causing redundant data and unnecessary task execution operations in the trigger mechanism. For example, based on trigger-based data supply, all data will be provided to downstream systems as changed data. 2. Because full data synchronization has an order, for tables with foreign keys, there may be a situation where the data import from the master table and slave table is not synchronized, resulting in data synchronization errors. 3. Because the sequence numbers generated by the built-in sequence generation methods of the old and new databases are inconsistent, it will cause duplicate sequences in the newly generated data after data migration, thus causing functional problems.

[0070] The following sections will explain how to solve the above problems.

[0071] See Figure 4 Perform full data synchronization from Oracle database to GaussDB database using the DRS tool, including:

[0072] Step 401: Disable all triggers and foreign keys in the GaussDB database;

[0073] Step 402: Analyze and process tables without primary keys;

[0074] Step 403: Start full data synchronization using the DRS tool;

[0075] Step 404: Number each table in the Gaussdb database;

[0076] Step 405: Activate full triggers and foreign keys for GaussDB data.

[0077] In steps 401 and 405 above, turning off the full trigger before data synchronization and turning it on after synchronization is one way to solve the trigger problem; turning off the foreign key before data synchronization and turning it on after synchronization is another way to solve the foreign key problem. Step 201 above is the second way to solve the foreign key problem, which is to perform incremental synchronization again.

[0078] See Figure 5 Perform full data synchronization from Oracle database to GaussDB database using the DRS tool, including:

[0079] Step 501: Disable foreign keys in the GaussDB database;

[0080] Step 502: Analyze and process tables without primary keys;

[0081] Step 503: Start full data synchronization using the DRS tool;

[0082] Step 504: Number each table in the Gaussdb database;

[0083] Step 505: Enable foreign keys for GaussDB data;

[0084] Step 506: Clean up the records generated by the full trigger.

[0085] Step 506 above is the second method to solve the trigger problem.

[0086] In one embodiment, disabling full triggers and foreign keys in the GaussDB database includes:

[0087] Query the preset tables (adm_triggers, pg_trigger) in GaussDB to obtain the tables that have full triggers and the tables that have foreign keys;

[0088] Turn off full triggers in tables that contain full triggers;

[0089] Disable foreign keys in tables that contain foreign keys;

[0090] Enable full triggers and foreign keys for GaussDB data, including:

[0091] Activate the full trigger in the table where a full trigger exists;

[0092] Enable foreign keys in tables that contain foreign keys.

[0093] Analyze and process tables without primary keys, including:

[0094] For each table without a primary key, determine whether the data in the table matches the pre-set technical purpose keyword;

[0095] If so, retain the table without a primary key;

[0096] If not, delete the table without a primary key.

[0097] In one embodiment, numbering each table in the Gaussdb database includes:

[0098] Number the data in each table of the Gaussdb database starting from zero (Solution 1 to the Sequence generation problem);

[0099] Alternatively, obtain the last number of the data in each table of the Oracle database, and determine the initial number of each table in the Gaussdb database as the last number of the corresponding table in the Oracle database plus 1 (Solution 2 to the Sequence generation problem).

[0100] In step 104, incremental data is obtained during the time period from the cessation of data interaction to full data synchronization, and incremental data synchronization is performed using the DRS tool with the anchor point.

[0101] In step 105, the system application server is started;

[0102] In step 106, the workflow for the GaussDB database is started;

[0103] In step 107, the GaussDB database is used for post-migration business verification through the recording and playback group component.

[0104] During business verification, a recording and playback component is used. After the migration is completed, business transactions are still based on the old external services. The recording and playback component records the transaction information, and the transactions are played back in the new database. The consistency between the old and new databases is compared to complete the technical and business verification.

[0105] The method proposed in this invention supports rapid rollback after system startup following a data switchover. In practice, the rollback scheme assumes that the Oracle database is retained after the data switchover and continuously synchronized with the Gauss database as a backup. (Considering resource consumption, real-time synchronization may not be necessary for tables without primary keys.)

[0106] See Figure 6 In one embodiment, the method further includes:

[0107] Step 601: After switching data from the Oracle database to the GaussDB database, the Oracle database is retained and used as a standby database to continuously synchronize data with the GaussDB database. If there is a rollback requirement, the rollback is performed as follows:

[0108] Step 602: Stop data interaction with system application servers related to Oracle database and GaussDB database, record the anchor point where data interaction stops, and wait for incremental data synchronization from Oracle database to GaussDB database to complete.

[0109] Step 603: Perform full data synchronization from GaussDB database to Oracle database using the DRS tool;

[0110] Step 604: Switch the system application server that interacts with the GaussDB database to the system application server that interacts with the Oracle database.

[0111] Step 605: Start the Oracle database workflow;

[0112] Step 606: Perform business verification on the Oracle database using the recording and playback group component.

[0113] In summary, the method proposed in this embodiment of the invention involves: stopping data interaction with the system application servers related to the Oracle and GaussDB databases and recording the anchor point at which data interaction ceases; deploying the GaussDB database version; performing full data synchronization from the Oracle database to the GaussDB database using the DRS tool; obtaining incremental data during the time period from the cessation of data interaction to full data synchronization, and using the anchor point to perform incremental data synchronization using the DRS tool; starting the system application servers; starting the GaussDB database workflow; and performing post-migration business verification of the GaussDB database using the recording and playback group component. Compared with the existing technology that exports data from the original database, organizes the data according to the target database data format to form a script or migration text, and then imports it into the target database to complete the data migration, this method records the anchor point at which data interaction ceases after stopping data interaction; performs incremental data synchronization using the DRS tool after full data synchronization is completed, avoiding missed incremental data migration; automating the migration process reduces the likelihood of data conversion errors; and supports rapid rollback after system startup.

[0114] This invention also provides a database migration device from Oracle to GaussDB, as described in the following embodiments. Since the principle by which this device solves the problem is similar to the database migration method from Oracle to GaussDB, the implementation of this device can refer to the implementation of the database migration method from Oracle to GaussDB, and repeated details will not be elaborated further.

[0115] Figure 7 This is a schematic diagram of a database migration device from Oracle to GaussDB according to an embodiment of the present invention, including:

[0116] Stop module 701 is used to stop data interaction with system application servers related to Oracle database and GaussDB database, and to record the anchor point at which data interaction stops.

[0117] Deployment module 702 is used to deploy the GaussDB database version;

[0118] The full data synchronization module 703 is used to perform full data synchronization from an Oracle database to a GaussDB database using the DRS tool.

[0119] The incremental data synchronization module 704 is used to obtain incremental data during the time period from the cessation of data interaction to the full data synchronization, and to perform incremental data synchronization through the DRS tool using the anchor point.

[0120] The system application server startup module 705 is used to start the system application server;

[0121] Workflow startup module 706 is used to start the workflow of the GaussDB database.

[0122] The business verification module 707 is used to perform post-migration business verification of the GaussDB database through the recording and playback group component.

[0123] In one embodiment, the stop module is specifically used for:

[0124] Stop the external service functions of the system application server that interacts with the Oracle database and GaussDB database respectively;

[0125] Stop the data synchronization operation of the Oracle database and record the anchor point at which data interaction stops;

[0126] Stop monitoring the availability of the system application server.

[0127] In one embodiment, the full data synchronization module is specifically used for:

[0128] Disable full triggers and foreign keys in the GaussDB database;

[0129] Analyze and process tables without primary keys;

[0130] Initiate full data synchronization using the DRS tool;

[0131] Number each table in the Gaussdb database;

[0132] Start full triggers and foreign keys for GaussDB data.

[0133] In one embodiment, the full data synchronization module is specifically used for:

[0134] Query the GaussDB tables to find the tables that have full triggers and the tables that have foreign keys;

[0135] Turn off full triggers in tables that contain full triggers;

[0136] Disable foreign keys in tables that contain foreign keys;

[0137] Activate the full trigger in the table where a full trigger exists;

[0138] Enable foreign keys in tables that contain foreign keys.

[0139] In one embodiment, the full data synchronization module is specifically used for:

[0140] For each table without a primary key, determine whether the data in the table matches the pre-set technical purpose keyword;

[0141] If so, retain the table without a primary key;

[0142] If not, delete the table without a primary key.

[0143] In one embodiment, the full data synchronization module is specifically used for:

[0144] The data in each table of the Gaussdb database is numbered starting from zero;

[0145] Alternatively, obtain the last number of the data in each table of the Oracle database, and determine the initial number of each table in the Gaussdb database as the last number of the corresponding table in the Oracle database plus 1.

[0146] In one embodiment, the full data synchronization module is specifically used for:

[0147] Disable foreign keys in the GaussDB database;

[0148] Analyze and process tables without primary keys;

[0149] Initiate full data synchronization using the DRS tool;

[0150] Number each table in the Gaussdb database;

[0151] Enable foreign keys in GaussDB data;

[0152] Clean up the records generated by the full trigger.

[0153] In one embodiment, the workflow initiation module is further configured to:

[0154] After starting the batch workflow for the GaussDB database, perform a data consistency comparison between the Oracle database and the GaussDB database, obtain the discrepancies, and then restore the discrepancies to the GaussDB database.

[0155] In one embodiment, the device further includes a rollback module 708, for:

[0156] If you have migrated data from an Oracle database to a GaussDB database but still retain the Oracle database as a standby database that is constantly synchronizing with the data in the GaussDB database, and there is a rollback requirement, follow these steps to perform the rollback:

[0157] Call the stop module to stop data interaction with system application servers related to Oracle database and GaussDB database, record the anchor point where data interaction stops, and wait for incremental data synchronization from Oracle database to GaussDB database to complete.

[0158] Call the deployment module to deploy the GaussDB database version;

[0159] The full data synchronization module is invoked, and the DRS tool is used to perform a full data synchronization from the GaussDB database to the Oracle database.

[0160] The system application server startup module is invoked to switch the system application server that interacts with the GaussDB database to the system application server that interacts with the Oracle database.

[0161] Invoke the workflow startup module to start the Oracle database workflow;

[0162] The business verification module is invoked, and the Oracle database is verified through the recording and playback group component.

[0163] In summary, the apparatus proposed in this embodiment of the invention stops data interaction with system application servers related to the Oracle and GaussDB databases and records the anchor point where data interaction stops; deploys the GaussDB database version; performs full data synchronization from the Oracle database to the GaussDB database using the DRS tool; obtains incremental data during the time period from the cessation of data interaction to full data synchronization, and performs incremental data synchronization using the DRS tool with the anchor point; starts the system application servers; starts the GaussDB database workflow; and performs post-migration business verification of the GaussDB database using the recording and playback group component. Compared with the existing technology that exports data from the original database, organizes the data according to the target database data format to form a script or migration text, and then imports it into the target database to complete the data migration, this invention records the anchor point where data interaction stops after stopping data interaction; performs incremental data synchronization using the DRS tool with the anchor point after full data synchronization is completed, avoiding missed incremental data migration; and automates the migration process, reducing the likelihood of data conversion errors. Furthermore, it supports rapid rollback after system startup.

[0164] This invention also provides a computer device. Figure 8 This is a schematic diagram of a computer device in an embodiment of the present invention. The computer device 800 includes a memory 810, a processor 820, and a computer program 830 stored in the memory 810 and executable on the processor 820. When the processor 820 executes the computer program 830, it implements the above-described Oracle to GaussDB database migration method.

[0165] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described Oracle to GaussDB database migration method.

[0166] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0167] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0168] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0169] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0170] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A database migration method from Oracle to GaussDB, characterized in that, include: Stop data interaction with system application servers related to Oracle database and GaussDB database, and record the anchor point at which data interaction stops; Deploy the GaussDB database version; Full data synchronization from Oracle database to GaussDB database is performed using the DRS tool. This includes: disabling full triggers and foreign keys in the GaussDB database; analyzing and processing tables without primary keys; starting full data synchronization using the DRS tool; numbering each table in the GaussDB database; and enabling full triggers and foreign keys in the GaussDB database. Specifically, the analysis and processing of tables without primary keys includes: for each table without a primary key, determining whether the data in the table matches a pre-defined technical purpose keyword; if so, retaining the table; otherwise, deleting it. Obtain incremental data within the time period from the cessation of data interaction to full data synchronization, and use the anchor point to perform incremental data synchronization through the DRS tool; Start the system application server; Start the workflow for the GaussDB database; The business verification of the migrated GaussDB database is performed by using the recording and playback component, including: recording transaction information completed based on the Oracle database using the recording and playback component, replaying the transactions corresponding to the transaction information in the GaussDB database, and completing technical and business verification by comparing the consistency between the Oracle database and the GaussDB database.

2. The method as described in claim 1, characterized in that, Stop data interaction with system application servers related to Oracle and GaussDB databases, including: Stop the external service functions of the system application server that interacts with the Oracle database and GaussDB database respectively; Stop the data synchronization operation of the Oracle database and record the anchor point at which data interaction stops; Stop monitoring the availability of the system application server.

3. The method as described in claim 1, characterized in that, Disable all triggers and foreign keys in the GaussDB database, including: Query the GaussDB tables to find the tables that have full triggers and the tables that have foreign keys; Turn off full triggers in tables that contain full triggers; Disable foreign keys in tables that contain foreign keys; Enable full triggers and foreign keys for the GaussDB database, including: Activate the full trigger in the table where a full trigger exists; Enable foreign keys in tables that contain foreign keys.

4. The method as described in claim 1, characterized in that, Each table in the GaussDB database is numbered, including: The data in each table of the GaussDB database is numbered starting from zero; Alternatively, obtain the last number of the data in each table of the Oracle database, and determine the initial number of each table in the GaussDB database as the last number of the corresponding table in the Oracle database plus 1.

5. The method as described in claim 1, characterized in that, After starting the GaussDB database workflow, the following is also included: Perform a data consistency comparison between the Oracle database and the GaussDB database, obtain the discrepancies, and then restore the discrepancies to the GaussDB database.

6. The method as described in claim 1, characterized in that, Also includes: If you have migrated data from an Oracle database to a GaussDB database but still retain the Oracle database as a standby database that is constantly synchronizing with the data in the GaussDB database, and there is a rollback requirement, follow these steps to perform the rollback: Stop data interaction with system application servers related to Oracle database and GaussDB database, record the anchor point where data interaction stops, and wait for incremental data synchronization from GaussDB database to Oracle database to complete. Perform full data synchronization from GaussDB database to Oracle database using the DRS tool; Switch the system application server that interacts with the GaussDB database to the system application server that interacts with the Oracle database; Start the Oracle database workflow; Business verification of the Oracle database is performed using the recording and playback component.

7. A database migration device from Oracle to GaussDB, characterized in that, include: The stop module is used to stop data interaction with system application servers related to Oracle databases and GaussDB databases, and to record the anchor point at which data interaction stops. The deployment module is used to deploy the GaussDB database version; The full data synchronization module is used to perform full data synchronization from an Oracle database to a GaussDB database using the DRS tool. Specifically, this module is used to: disable full triggers and foreign keys in the GaussDB database; analyze and process tables without primary keys; initiate full data synchronization using the DRS tool; number each table in the GaussDB database; and activate full triggers and foreign keys in the GaussDB database. When analyzing tables without primary keys, the module specifically performs the following: for each table without a primary key, it determines whether the data in the table matches a pre-set technical purpose keyword; if so, it retains the table; otherwise, it deletes it. The incremental data synchronization module is used to obtain incremental data during the time period from the cessation of data interaction to the full data synchronization, and to perform incremental data synchronization through the DRS tool using the anchor point. The system application server startup module is used to start the system application server; The workflow startup module is used to start workflows for the GaussDB database. The business verification module is used to perform post-migration business verification of the GaussDB database through a recording and playback component. Specifically, the business verification module is used to: record transaction information completed based on the Oracle database through the recording and playback component, replay the transactions corresponding to the transaction information in the GaussDB database, and complete technical and business verification by comparing the consistency between the Oracle database and the GaussDB database.

8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data migration system and method

    CN107122360A