CN111459916B - GBASE and ORACLE database table comparison method and system - Google Patents

GBASE and ORACLE database table comparison method and system Download PDF

Info

Publication number
CN111459916B
CN111459916B CN202010298006.7A CN202010298006A CN111459916B CN 111459916 B CN111459916 B CN 111459916B CN 202010298006 A CN202010298006 A CN 202010298006A CN 111459916 B CN111459916 B CN 111459916B
Authority
CN
China
Prior art keywords
comparison
database
column
tables
gbase
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.)
Active
Application number
CN202010298006.7A
Other languages
Chinese (zh)
Other versions
CN111459916A (en
Inventor
雷立动
张育琴
李世杰
万小妹
高随涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202010298006.7A priority Critical patent/CN111459916B/en
Publication of CN111459916A publication Critical patent/CN111459916A/en
Application granted granted Critical
Publication of CN111459916B publication Critical patent/CN111459916B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/214Database migration support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/273Asynchronous replication or reconciliation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a system for comparing GBASE and ORACLE database tables, wherein the method comprises the following steps: configuring a table name of an ORACLE database and a corresponding GBASE database; respectively reading information of column information tables in the ORACLE database and the GBASE database according to the data configuration table to obtain column information of two comparison tables; based on column information of the comparison tables, judging consistency of the two comparison tables, and generating corresponding data comparison scripts according to consistency results; and connecting the ORACLE database with the corresponding GBASE database, and executing a data comparison script to obtain a comparison result. After the table range is configured completely, the method and the system can automatically find the field level difference item of each table by executing the comparison script, perform difference analysis, trace back the program code for processing the field, locate the difference reason, ensure the accuracy of data processing, and improve the data comparison efficiency and performance.

Description

GBASE and ORACLE database table comparison method and system
Technical Field
The invention relates to the technical field of database management, in particular to a method and a system for comparing GBASE and ORACLE database tables.
Background
Because of the many differences in syntax and implementation logic of the GBASE and ORACLE databases, the application program is basically reconfigured during the downward movement of ORACLE to GBASE, which requires verifying that the processing results are consistent. However, if the application system involves thousands of tables, the alignment process would be very time consuming and labor intensive.
In the prior art, the downshifting work is generally performed in batches, and data comparison is performed each time, so that a great deal of time and labor are consumed. The current common comparison scheme is that GBASE is compared by accessing ORACLE database tables through DBLINK. However, the DBLINK comparison scheme only supports tables with smaller data volume (generally, the data volume cannot exceed 100 ten thousand), and if the data volume is larger, the efficiency of querying the ORACLE data is slow, and even GBASE system errors are caused, and the scheme can only be used for comparing data such as parameter code tables.
In order to reduce the amount of query data, only table level comparison is performed, the total record number, sum of amounts, average value and other summarized information of the main comparison table are mainly compared, the scheme can only perform rough comparison, the accuracy of each column of information can not be ensured, and once the comparison is problematic, specific fields with differences can not be found in time.
In view of the foregoing, there is a need for a GBASE and ORACLE database table comparison scheme that can implement field level difference comparison.
Disclosure of Invention
In order to solve the problems, the invention provides a GBASE and ORACLE database table comparison method and system, which can be used for carding the range of the comparison table of two databases through configuring a data table, automatically generating a comparison script, finding out a specific field of a difference through executing the comparison script, and tracing program codes for processing the field to locate the reason of the difference so as to ensure the accuracy of data processing and improve the data comparison efficiency and performance.
In an embodiment of the present invention, a method for comparing GBASE and ORACLE database tables is provided, the method comprising:
creating a data configuration table, and configuring table names of an ORACLE database and a corresponding GBASE database;
respectively reading information of column information tables in the ORACLE database and the GBASE database according to the data configuration table to obtain column information of two comparison tables;
based on the column information of the two comparison tables, judging the consistency of the two comparison tables, and generating corresponding data comparison scripts according to a consistency result;
and connecting the ORACLE database and the corresponding GBASE database, and executing the data comparison script to obtain a comparison result.
In another embodiment of the present invention, a system for comparing GBASE and ORACLE database tables is also provided, the system comprising:
the data table configuration module is used for creating a data configuration table and configuring table names of the ORACLE database and the corresponding GBASE database;
the information reading module is used for respectively reading the information of the column information tables in the ORACLE database and the GBASE database according to the data configuration table to obtain the column information of the two comparison tables;
the comparison script generation module is used for judging the consistency of the two comparison tables based on the column information of the two comparison tables and generating corresponding data comparison scripts according to the consistency result;
and the data comparison analysis module is used for connecting the ORACLE database and the corresponding GBASE database, executing the data comparison script and obtaining a comparison result.
In another embodiment of the present invention, a computer device is also provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements a method for GBASE and ORACLE database table comparison when executing the computer program.
In another embodiment of the present invention, a computer readable storage medium is also presented, the computer readable storage medium storing a computer program which, when executed by a processor, implements a method of GBASE and ORACLE database table comparison.
By using the method and the system for comparing the GBASE and ORACLE database tables, after the table ranges are configured completely, the field level difference item of each table can be automatically found by executing the comparison script, and the difference analysis is carried out, so that the program codes for processing the field are traced, the difference reasons are positioned, the accuracy of data processing is ensured, and the data comparison efficiency and performance are improved.
Drawings
FIG. 1 is a flow chart of a method for GBASE and ORACLE database table comparison according to an embodiment of the present invention.
FIG. 2 is a detailed flow chart of a data alignment script generation according to an embodiment of the present invention.
FIG. 3 is a detailed flow chart of a data comparison analysis according to an embodiment of the present invention.
FIG. 4 is a schematic diagram of a system architecture for GBASE and ORACLE database table comparison according to one embodiment of the present invention.
FIG. 5 is a schematic diagram of an architecture of an alignment script generation module according to an embodiment of the present invention.
FIG. 6 is a schematic diagram of a data comparison analysis module according to an embodiment of the invention.
FIG. 7 is a schematic diagram of a computer device according to an embodiment of the invention.
Detailed Description
The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are presented merely to enable those skilled in the art to better understand and practice the invention and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Those skilled in the art will appreciate that embodiments of the invention may be implemented as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the following forms, namely: complete hardware, complete software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to the embodiment of the invention, a method and a system for comparing GBASE and ORACLE database tables are provided. The GBASE is a column storage database, and compared with ORACLE, field level comparison efficiency is higher, so that the scheme firstly needs to migrate the synchronous data processed by ORACLE into GBASE; in order not to affect the GBASE normal data, the migration data is generally put into a separate new library (such as a TEMP library); and then configuring the mapping relation of the to-be-compared tables in the GBASE and ORACLE databases, finally automatically generating and executing a data comparison script according to the configuration table record, and finally storing the comparison result into the data comparison result table.
The principles and spirit of the present invention are explained in detail below with reference to several representative embodiments thereof.
FIG. 1 is a flow chart of a method for GBASE and ORACLE database table comparison according to an embodiment of the present invention.
As shown in fig. 1, the method includes:
step S101, a data configuration table is created, and table names of an ORACLE database and a corresponding GBASE database are configured;
step S102, respectively reading information of column information tables in the ORACLE database and the GBASE database according to the data configuration table to obtain column information of two comparison tables; wherein, the column information of the comparison table may include: column name and sequence number of the comparison table
Step S103, judging the consistency of the two comparison tables based on the column information of the two comparison tables, and generating corresponding data comparison scripts according to a consistency result;
and step S104, connecting the ORACLE database and the corresponding GBASE database, and executing the data comparison script to obtain a comparison result.
In order to make a clearer explanation of the above-described methods of GBASE and ORACLE database table comparison, specific examples are described below.
Firstly, before the data comparison, the data migration from ORACLE to GBASE needs to be completed, and all data is imported into the GBASE database to perform field level check.
Step S101:
in order to complete data comparison, the range of the table to be compared of the two databases needs to be carded out, and for this, the table names of the ORACLE database and the corresponding GBASE database need to be configured first.
Step S102:
circularly reading ORACLE and corresponding GBASE database table names in a data configuration table; after the reading is completed, according to the read table names, the information of column tables in the information_schema library in the ORACLE and GBASE databases is further read respectively, and column names and corresponding sequence numbers of the two comparison tables are obtained.
Step S103:
and judging the consistency of the two comparison tables based on the column information of the two comparison tables, and generating corresponding data comparison scripts according to a consistency result.
Specifically, referring to fig. 2, a detailed flowchart of a data comparison script is shown in an embodiment of the present invention. As shown in fig. 2, step S103 includes:
step S1031, according to the sequence numbers, judging whether the sequence numbers or the number of the columns of each column of the two comparison tables are consistent;
if the sequence numbers and the column numbers are completely consistent, judging that the table structures are the same, generating comparison SQL script sentences, and performing subtraction operation calculation (MINUS calculation) on the two comparison tables column by column;
if the column numbers or the sequence numbers of the two comparison tables are inconsistent, judging that the table structure is changed, finding out the same column names, and generating comparison SQL script sentences according to the same column names, wherein the comparison SQL script sentences are used for carrying out subtraction operation calculation (MINUS calculation) on the same column names one by one;
step S1032, after the circulation is finished, generating a data comparison script according to the comparison SQL script statement; the data comparison script is used for respectively comparing each column of the ORACLE database table with each column of the GBASE database table.
Step S104:
and after all the comparison scripts are generated, storing the comparison scripts in a file, and executing the data comparison scripts to obtain a comparison result.
In one embodiment, referring to fig. 3, a detailed flow chart of the data comparison analysis according to an embodiment of the present invention is shown. As shown in fig. 3, includes:
s1041, connecting the ORACLE database and the corresponding GBASE database, setting parallel parameters according to database resource conditions, and controlling parallelism of script execution; the ORACLE database and the corresponding GBASE database can work more stably through parallel scheduling, and the comparison efficiency is ensured.
And S1042, executing the data comparison script in parallel according to the parallelism to obtain a comparison result.
Further, the comparison result analysis may be performed according to steps S1043-S1045, and the program code for processing the field may be traced back to locate the cause of the difference.
S1043, after the execution of the data comparison script is finished, updating the table name, the column name and the difference number corresponding to the difference to a comparison result table according to the comparison result;
s1044, acquiring a corresponding processing program name according to the table name corresponding to the difference, and updating the processing program name to a comparison result table;
s1045, according to the processing program name, acquiring codes corresponding to a subroutine storage table (routines table) under an information_schema library in the GBASE database, intercepting processing logic corresponding to a different column, and updating to a comparison result table.
In summary, field level comparison can be achieved through the comparison result analysis in step S1043. Furthermore, in combination with step S1044 and step S1045, the present invention further enables the whole comparison process to be more efficient by performing intelligent analysis on the differences, and tracing the corresponding processing program and specific code segments through the difference table and the columns thereof.
By using the method for comparing the GBASE database table and the ORACLE database table, field level verification of a large amount of data of GBASE database table and ORACLE database table can be realized, verification efficiency is high, and successful practice is achieved in actual projects. Aiming at the back line batch systems such as data warehouse and the like, the method has extremely high requirement on data accuracy when processing data, can realize field level comparison, and can ensure the accuracy of the data processing of the back line batch systems of the types.
In the above embodiment, the information_schema library is an information database in the GBASE database, in which information of the GBASE database is stored. Such as database name, table of database, data type and access rights of table column, etc. In the information_schema, there are a plurality of read-only tables. Wherein, the liquid crystal display device comprises a liquid crystal display device,
column table: column information in the table is provided. All columns of a table and the information for each column are detailed.
routines table: information about the stored subroutines (stored programs and functions) is provided.
It should be noted that although the operations of the method of the present invention are described in a particular order in the above embodiments and the accompanying drawings, this does not require or imply that the operations must be performed in the particular order or that all of the illustrated operations be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform.
Having described the method of an exemplary embodiment of the present invention, a system for GBASE and ORACLE database table comparison of an exemplary embodiment of the present invention is described next with reference to fig. 4-6.
The implementation of the GBASE and ORACLE database table comparison system can be referred to the implementation of the above method, and the repetition is not repeated. The term "module" or "unit" as used below may be a combination of software and/or hardware that implements the intended function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Based on the same inventive concept, the invention also provides a system for comparing GBASE and ORACLE database tables, as shown in FIG. 4, the system comprises:
a data table configuration module 410, configured to create a data configuration table, and configure table names of the ORACLE database and the corresponding GBASE database;
the information reading module 420 is configured to respectively read information of the column information tables in the ORACLE database and the GBASE database according to the data configuration table, so as to obtain column information of two comparison tables;
the comparison script generation module 430 is configured to determine consistency of the two comparison tables based on column information of the two comparison tables, and generate a corresponding data comparison script according to a consistency result;
and the data comparison and analysis module 440 is used for connecting the ORACLE database and the corresponding GBASE database, executing the data comparison script and obtaining a comparison result.
In one embodiment, the column information of the comparison table includes: column names and sequence numbers of the comparison table.
In an embodiment, referring to fig. 5, an architecture diagram of an alignment script generating module according to an embodiment of the invention is shown. As shown in fig. 5, the alignment script generation module 430 includes:
a judging unit 431, configured to judge whether the sequence numbers or the number of columns of each column of the two comparison tables are consistent based on the sequence numbers;
the script statement generating unit 432 is configured to generate a comparison SQL script statement according to the determination result, if the sequence number and the number of columns are completely identical, and perform subtraction operation calculation on the two comparison tables column by column;
if the column numbers or the sequence numbers of the two comparison tables are inconsistent, judging that the table structure is changed, finding out the same column names, and generating comparison SQL script sentences according to the same column names, wherein the comparison SQL script sentences are used for carrying out subtraction operation calculation on the same column names one by one;
and the comparison script generating unit 433 is configured to generate a data comparison script according to the comparison SQL script statement.
In an embodiment, referring to fig. 6, a schematic diagram of a data comparison analysis module according to an embodiment of the invention is shown. As shown in fig. 6, the data comparison analysis module 440 includes:
the parallel control unit 441 is configured to connect the ORACLE database and the corresponding GBASE database, set parallel parameters according to database resource conditions, and control parallelism when the script is executed;
and the data comparison unit 442 is configured to execute the data comparison script in parallel according to the parallelism, so as to obtain a comparison result.
Further, the data comparison analysis module 440 further includes:
the difference updating unit 443 is configured to update, after the execution of the data comparison script is completed, the table name, the column name, and the difference number corresponding to the difference to a comparison result table according to the comparison result;
a processing program name obtaining unit 444, configured to obtain a corresponding processing program name according to the table name corresponding to the difference, and update the table to a comparison result table;
and the processing logic obtaining unit 445 is configured to obtain codes corresponding to the subroutine storage table in the GBASE database according to the processing program names, intercept processing logic corresponding to the different columns, and update the processing logic to the comparison result table.
It should be noted that while several modules of the GBASE and ORACLE database table alignment system are mentioned in the detailed description above, this partitioning is merely exemplary and not mandatory. Indeed, the features and functions of two or more modules described above may be embodied in one module in accordance with embodiments of the present invention. Conversely, the features and functions of one module described above may be further divided into a plurality of modules to be embodied.
Based on the foregoing inventive concept, as shown in fig. 7, the present invention further proposes a computer device 700, including a memory 710, a processor 720, and a computer program 730 stored in the memory 710 and executable on the processor 720, where the processor 720 implements the foregoing GBASE and ORACLE database table comparison method when executing the computer program 730.
In another embodiment of the present invention, a computer readable storage medium is also presented, the computer readable storage medium storing a computer program which, when executed by a processor, implements a method of GBASE and ORACLE database table comparison.
By using the method and the system for comparing the GBASE and ORACLE database tables, after the table ranges are configured completely, the field level difference item of each table can be automatically found by executing the comparison script, and the difference analysis is carried out, so that the program codes for processing the field are traced, the difference reasons are positioned, the accuracy of data processing is ensured, and the data comparison efficiency and performance are improved.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may 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, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may 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, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above examples are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention, but it should be understood by those skilled in the art that the present invention is not limited thereto, and that the present invention is described in detail with reference to the foregoing examples: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A method for comparing GBASE and ORACLE database tables, the method comprising:
creating a data configuration table, and configuring table names of an ORACLE database and a corresponding GBASE database;
respectively reading information of column information tables in the ORACLE database and the GBASE database according to the data configuration table to obtain column information of two comparison tables;
based on the column information of the two comparison tables, judging the consistency of the two comparison tables, and generating corresponding data comparison scripts according to a consistency result;
connecting the ORACLE database and the corresponding GBASE database, and executing the data comparison script to obtain a comparison result;
the method comprises the steps of connecting the ORACLE database with a corresponding GBASE database, executing the data comparison script to obtain a comparison result, and further comprises the following steps:
connecting the ORACLE database and the corresponding GBASE database, setting parallel parameters according to database resource conditions, and controlling the parallelism of script execution;
the data comparison script is executed in parallel according to the parallelism, and a comparison result is obtained;
after the data comparison script is executed, updating the table names, the column names and the difference numbers corresponding to the differences to a comparison result table according to the comparison result;
according to the table names corresponding to the differences, corresponding processing program names are obtained and updated to a comparison result table;
acquiring codes corresponding to the routines table under the information_schema library in the GBASE database according to the processing program name, intercepting processing logic corresponding to the different column, and updating to a comparison result table; the information_schema library is an information database in the GBASE database, stores the information of the GBASE database and comprises a plurality of read-only tables, wherein column tables provide column information in the tables; the routines table provides information about the storage subroutine.
2. The method of GBASE and ORACLE database table comparison according to claim 1, wherein the column information of the comparison table comprises: column names and sequence numbers of the comparison table.
3. The method of comparing GBASE and ORACLE databases according to claim 2, wherein determining consistency of the two comparison tables based on column information of the two comparison tables, generating corresponding data comparison script based on consistency result, comprising
Based on the sequence numbers, judging whether the sequence numbers or the number of the columns of each column of the two comparison tables are consistent;
if the sequence numbers and the column numbers are completely consistent, judging that the table structures are the same, generating comparison SQL script sentences for performing subtraction operation calculation on the two comparison tables column by column;
if the column numbers or the sequence numbers of the two comparison tables are inconsistent, judging that the table structure is changed, finding out the same column names, and generating comparison SQL script sentences according to the same column names, wherein the comparison SQL script sentences are used for carrying out subtraction operation calculation on the same column names one by one;
and generating a data comparison script according to the comparison SQL script statement.
4. A system for GBASE and ORACLE database table comparison, the system comprising:
the data table configuration module is used for creating a data configuration table and configuring table names of the ORACLE database and the corresponding GBASE database;
the information reading module is used for respectively reading the information of the column information tables in the ORACLE database and the GBASE database according to the data configuration table to obtain the column information of the two comparison tables;
the comparison script generation module is used for judging the consistency of the two comparison tables based on the column information of the two comparison tables and generating corresponding data comparison scripts according to the consistency result;
the data comparison analysis module is used for connecting the ORACLE database and the corresponding GBASE database, executing the data comparison script and obtaining a comparison result;
wherein, the data comparison analysis module includes:
the parallel control unit is used for connecting the ORACLE database and the corresponding GBASE database, setting parallel parameters according to the database resource condition and controlling the parallelism of script execution;
the data comparison unit is used for executing the data comparison script in parallel according to the parallelism to obtain a comparison result;
the difference updating unit is used for updating the table name, the column name and the difference number corresponding to the difference to a comparison result table according to the comparison result after the execution of the data comparison script is finished;
the processing program name acquisition unit is used for acquiring the corresponding processing program name according to the table name corresponding to the difference and updating the table to the comparison result;
the processing logic acquisition unit is used for acquiring codes corresponding to the routines table under the information_schema library in the GBASE database according to the processing program name, intercepting processing logic corresponding to the different column, and updating the processing logic to the comparison result table; the information_schema library is an information database in the GBASE database, stores the information of the GBASE database and comprises a plurality of read-only tables, wherein column tables provide column information in the tables; the routines table provides information about the storage subroutine.
5. The GBASE and ORACLE database table alignment system of claim 4 wherein the column information of the alignment table comprises: column names and sequence numbers of the comparison table.
6. The GBASE and ORACLE database table alignment system of claim 5 wherein the alignment script generation module comprises:
a judging unit for judging whether the sequence number or the number of the columns of each of the two comparison tables is consistent based on the sequence numbers;
the script statement generating unit is used for generating comparison SQL script statements according to the judging result, if the sequence numbers and the number of columns are completely consistent, judging that the structures of the tables are the same, and performing subtraction operation calculation on the two comparison tables column by column;
if the column numbers or the sequence numbers of the two comparison tables are inconsistent, judging that the table structure is changed, finding out the same column names, and generating comparison SQL script sentences according to the same column names, wherein the comparison SQL script sentences are used for carrying out subtraction operation calculation on the same column names one by one;
and the comparison script generating unit is used for generating a data comparison script according to the comparison SQL script statement.
7. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 3 when executing the computer program.
8. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, implements the method of any of claims 1 to 3.
CN202010298006.7A 2020-04-16 2020-04-16 GBASE and ORACLE database table comparison method and system Active CN111459916B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010298006.7A CN111459916B (en) 2020-04-16 2020-04-16 GBASE and ORACLE database table comparison method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010298006.7A CN111459916B (en) 2020-04-16 2020-04-16 GBASE and ORACLE database table comparison method and system

Publications (2)

Publication Number Publication Date
CN111459916A CN111459916A (en) 2020-07-28
CN111459916B true CN111459916B (en) 2023-05-23

Family

ID=71685934

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010298006.7A Active CN111459916B (en) 2020-04-16 2020-04-16 GBASE and ORACLE database table comparison method and system

Country Status (1)

Country Link
CN (1) CN111459916B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112131846B (en) * 2020-09-07 2024-06-04 北京思特奇信息技术股份有限公司 Method and system for transmitting parameters based on mapping relation, electronic device and storage medium
CN113779955B (en) * 2021-09-15 2023-11-03 中国农业银行股份有限公司 Method, device and storage medium for generating difference script

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108304522A (en) * 2018-01-25 2018-07-20 深圳市买买提信息科技有限公司 Comparison method, device and the terminal device of difference between a kind of database
CN109918299A (en) * 2019-02-27 2019-06-21 洛阳中科汇成科技有限公司 A kind of method of comparison database architectural difference
CN109977082A (en) * 2019-03-12 2019-07-05 福建省农村信用社联合社 A kind of method and computer readable storage medium of high-volume data automatic comparison

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402559A (en) * 2010-09-16 2012-04-04 中兴通讯股份有限公司 Database upgrade script generating method and device
CN108572996B (en) * 2017-03-14 2021-02-26 北京京东尚科信息技术有限公司 Synchronization method and device of database table structure, electronic equipment and storage medium
CN107784102A (en) * 2017-10-27 2018-03-09 中国电子科技集团公司第二十八研究所 A kind of data difference comparative approach based on oracle database
CN107918679A (en) * 2018-01-04 2018-04-17 国网福建省电力有限公司 Data warehouse model technological layer difference comparison method
CN110287182B (en) * 2019-05-05 2021-09-14 浙江吉利控股集团有限公司 Big data comparison method, device, equipment and terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108304522A (en) * 2018-01-25 2018-07-20 深圳市买买提信息科技有限公司 Comparison method, device and the terminal device of difference between a kind of database
CN109918299A (en) * 2019-02-27 2019-06-21 洛阳中科汇成科技有限公司 A kind of method of comparison database architectural difference
CN109977082A (en) * 2019-03-12 2019-07-05 福建省农村信用社联合社 A kind of method and computer readable storage medium of high-volume data automatic comparison

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一种批量信息检索方法及实现;李杰等;计算机系统应用;全文 *
数据库同步中差异数据捕获方案设计与实现;郑祥云等;电脑知识与技术;全文 *

Also Published As

Publication number Publication date
CN111459916A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
US10956422B2 (en) Integrating event processing with map-reduce
CN110795455B (en) Dependency analysis method, electronic device, computer apparatus, and readable storage medium
JP2020510925A (en) Method and apparatus for performing a test using a test case
US10452628B2 (en) Data analysis schema and method of use in parallel processing of check methods
CN111459916B (en) GBASE and ORACLE database table comparison method and system
US8904352B2 (en) Systems and methods for processing source code during debugging operations
US10990515B2 (en) Automated unit testing in a mainframe environment
CN110737594A (en) Database standard conformance testing method and device for automatically generating test cases
CN114780641B (en) Multi-library multi-table synchronization method, device, computer equipment and storage medium
US20210406001A1 (en) Method and system for fast building and testing software
CN114610286A (en) Development document generation method and device, computer equipment and storage medium
CN112948473A (en) Data processing method, device and system of data warehouse and storage medium
CN110618829B (en) Service data checking method and system for upgrading database system
CN110908978B (en) Database data structure verification method and device
CN112130838B (en) Transaction data processing method and device
CN114816437A (en) Method, system and equipment for reversely generating Java entity class
CN114153813A (en) Method, system, equipment and medium for batch migration of large data tables between databases
US11720553B2 (en) Schema with methods specifying data rules, and method of use
CN113885970A (en) Method, system and medium for generating report data based on script
US20240202105A1 (en) Automated testing of database commands
CN116975032B (en) Data alignment method, system, electronic device and storage medium
CN111651364B (en) SQL (structured query language) checking method and device under parallel development
CN115658771A (en) Data processing method, device, system and storage medium
CN116955311A (en) Data processing method, device, electronic equipment and storage medium
CN116226168A (en) Method and system for verifying wide-table data

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
GR01 Patent grant
GR01 Patent grant