Database data definition language DDL operation increment analysis method and device
By analyzing the incremental information of the database system table, determining the change trajectory and DDL operation type, and generating and verifying the DDL operation statement, the problem of poor synchronization of Informix (Gbase8s) database is solved and the synchronization of database data is improved.
Patent Information
- Application Number
- CN202411049074.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-11-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Informix (Gbase8s) database synchronization product does not support incremental parsing of DDL operations, resulting in poor database synchronization. Because the specific SQL statements for DDL operations are not recorded in the incremental transaction log, incremental DDL statements cannot be parsed directly through the transaction log.
By obtaining incremental information of the database system table, determining the change trajectory and DDL operation type of the system table, analyzing the DDL operation statements, and verifying the database to determine the target statements, improving the synchronization of the database data.
It realizes the determination of database data changes, improves the synchronization of database data, and solves the problem of poor database synchronization.
Smart Images

Figure CN118981472A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of database technology, and in particular to a method and device for incremental analysis of database data definition language DDL operations. Background Art
[0002] Informix is a relational database management system produced by IBM. Gbase8S has the same origin as Informix and is a localized database of Informix.
[0003] Most of the common Informix (Gbase8s) database synchronization products on the market do not support incremental parsing of DDL (Data Definition Language) operations.
[0004] The incremental transaction log of Informix (Gbase8s) does not record the specific SQL statements of DDL operations, that is, the incremental DDL statements cannot be directly parsed through the transaction log, and the synchronization of the database is poor. Summary of the invention
[0005] The present application aims to solve one of the technical problems in the related art at least to some extent.
[0006] To this end, the first objective of the present application is to propose a method for incremental analysis of database data definition language DDL operations.
[0007] The second object of the present application is to provide a device.
[0008] The third objective of the present application is to provide an electronic device.
[0009] A fourth objective of the present application is to provide a computer-readable storage medium.
[0010] A fifth object of the present application is to provide a computer program product.
[0011] To achieve the above-mentioned purpose, the first embodiment of the present application proposes a method for incremental analysis of database data definition language DDL operations, including:
[0012] Get the incremental information of the system table in the database;
[0013] Determine a change track of the system table according to the incremental information, and determine a DDL operation type according to the change track;
[0014] Analyze and obtain a DDL operation statement according to the incremental information and the DDL operation type;
[0015] The database is verified according to the DDL operation statement, and the target statement is determined according to the verification result.
[0016] Optionally, obtaining incremental information of a system table in a database includes:
[0017] The data in the system table at the current time point is compared with the data in the system table at the initial time point, and the data added in the system table at the current time point is determined as the incremental information, and the incremental information includes the changed system table name information, operation time information, and operation type information.
[0018] Optionally, determining the change track of the system table according to the incremental information includes:
[0019] The changed system table name information and the operation type information are sorted according to the operation time information to generate a change track of the system table.
[0020] Optionally, determining the DDL operation type according to the change trace includes:
[0021] A search is performed in a DDL operation mapping table according to the change trajectory to obtain a DDL operation type corresponding to the change trajectory, wherein the DDL operation mapping table contains a mapping relationship between the change trajectory and the DDL operation type.
[0022] Optionally, the obtaining a DDL operation statement according to the incremental information and the DDL operation type analysis includes:
[0023] Determine a DDL operation function according to the DDL operation type;
[0024] Generate function filling content according to the change system table name information and operation type information;
[0025] The function filling content is filled into the DDL operation function according to the time sequence of the operation time information to generate the DDL operation statement.
[0026] Optionally, verifying the database according to the DDL operation statement includes:
[0027] Determine the changed system table and change information according to the DDL operation statement;
[0028] Generate a query statement according to the changed system table and the changed information;
[0029] The changed information in the changed system table is queried according to the query statement, and the verification result is generated.
[0030] Optionally, determining the target sentence according to the verification result includes:
[0031] If the verification results of all the query statements indicate that the changed system table contains the change information, then determining that the DDL operation statement is the target statement;
[0032] If the verification result of the query statement indicates that the changed system table does not contain the change information, it is determined that the DDL operation statement is not a target statement.
[0033] To achieve the above-mentioned purpose, the second embodiment of the present application proposes a database data definition language DDL operation incremental analysis device, comprising:
[0034] Incremental analysis module, used to obtain incremental information of system tables in the database;
[0035] An operation type analysis module, used to determine the change track of the system table according to the incremental information, and determine the DDL operation type according to the change track;
[0036] An operation statement analysis module, used for analyzing and obtaining a DDL operation statement according to the incremental information and the DDL operation type;
[0037] The verification module is used to verify the database according to the DDL operation statement and determine the target statement according to the verification result.
[0038] To achieve the above-mentioned purpose, the third aspect of the present application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0039] The memory stores computer-executable instructions;
[0040] The processor executes the computer-executable instructions stored in the memory to implement the method as described in any one of the first aspects.
[0041] To achieve the above-mentioned purpose, the fourth aspect embodiment of the present application proposes a computer-readable storage medium, in which computer-readable storage medium is stored computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the method as described in any one of the first aspects.
[0042] To achieve the above-mentioned purpose, the fifth aspect of the present application proposes a computer program product, which implements any method in the first aspect when executed by a processor.
[0043] The database data definition language DDL operation incremental analysis method, device, electronic device and storage medium provided in the present application analyze the incremental information of the system table to obtain the target statement, thereby determining the data changes in the database and improving the synchronization of the database data.
[0044] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0046] Figure 1 A flowchart of a method for incremental analysis of database data definition language DDL operations provided in an embodiment of the present application;
[0047] Figure 2 A schematic diagram of the structure of a database data definition language DDL operation incremental analysis device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0049] Informix is a relational database management system produced by IBM. Gbase8S has the same origin as Informix and is a localized database of Informix. Most of the common Informix (Gbase8s) database synchronization products on the market do not support incremental parsing of DDL operations.
[0050] The incremental transaction log of Informix (Gbase8s) does not record the specific SQL statements of DDL operations, that is, it is impossible to directly parse the incremental DDL statements through the transaction log. DDL is a subset of SQL (Structured Query Language) that is specifically used to define and manage the structure of the database. DDL instructions allow database administrators and developers to create, modify, and delete the structural components of the database, such as the database itself, tables, views, columns, indexes, constraints, indexes, and users.
[0051] The following are some common DDL commands and their uses:
[0052] 1.CREATE:
[0053] CREATE DATABASE is used to create a new database
[0054] CREATE TABLE is used to create a new table.
[0055] CREATE VIEW is used to create a view, which provides a virtual table (the result set of a query).
[0056] CREATE INDEX is used to create indexes to speed up data retrieval.
[0057] · CREATE PROCEDURE or CREATE FUNCTION creates a stored procedure or function to encapsulate complex operations.
[0058] 2. ALTER:
[0059] ALTER DATABASE modifies characteristics of a database, such as size, name, or filegroups.
[0060] ALTER TABLE is used to modify the table structure, such as adding, deleting, or modifying columns, indexes, and constraints.
[0061] ALTER VIEW modifies the definition of a view.
[0062] 3.DROP:
[0063] DROP DATABASE deletes the entire database.
[0064] DROP TABLE deletes a table.
[0065] DROP VIEW deletes the view.
[0066] DROP INDEX removes an index.
[0067] DROP PROCEDURE or DROP FUNCTION to delete a stored procedure or function.
[0068] 4.TRUNCACHE: In some database systems, such as Oracle, there may be CACHE or NOCACHE commands to control the data cache access strategy.
[0069] When DDL instructions are executed, the database management system (DBMS) will update its internal data dictionary to record the latest status of the database structure. These changes are permanent, and DDL operations are usually outside of transactions, that is, rollback is not supported. DDL operations manage the database schema and are a key step in database design and maintenance.
[0070] To address this problem, the present application provides a database DDL operation incremental analysis method. Figure 1 A flowchart of a database DDL operation incremental analysis method provided in an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:
[0071] Step 101, obtaining incremental information of the system table in the database;
[0072] In this embodiment, the database does not directly record the specific SQL statement information of the incremental DDL, but the DDL operation will cause a series of changes to the system tables. By analyzing the series of changes to these system tables, the specific DDL statements can be reversely inferred.
[0073] System table: used to store metadata information of various objects in the database. The system tables involved in this article are shown in Table 1:
[0074]
[0075] Table 1
[0076] In the process of obtaining incremental information of system tables in the database, incremental content parsing is performed on system tables such as systabauth, systables, sysfragments, syscolumns, sysindices, and syssequences.
[0077] Step 102, determining a change track of the system table according to the incremental information, and determining a DDL operation type according to the change track;
[0078] Step 103, analyzing and obtaining a DDL operation statement according to the incremental information and the DDL operation type;
[0079] Step 104: Verify the database according to the DDL operation statement, and determine the target statement according to the verification result.
[0080] In this embodiment, the target statement is a DDL statement.
[0081] Optionally, obtaining incremental information of a system table in a database includes:
[0082] The data in the system table at the current time point is compared with the data in the system table at the initial time point, and the data added in the system table at the current time point is determined as the incremental information, and the incremental information includes the changed system table name information, operation time information, and operation type information.
[0083] The database contains multiple system tables, and the system table name change information contains the name of the system table that has been changed; the operation time information corresponds to the operation type information one by one, the operation type information contains the operation on the corresponding system table (such as INSERT to insert data), and the operation time information contains the time when the operation on the system table occurs.
[0084] In this embodiment, the specific type of DDL operation is inferred from the change track (or change sequence) of the system table. DDL operation statements will cause changes to the system table. For example, the example table creation statement will cause changes to the systables, sysfragments, and syscolumns system tables. The change track is recorded. In a possible embodiment, the incremental information is:
[0085] Two INSERT operations occurred in the syscolumns system table;
[0086] One INSERT operation occurred in the sysfragments system table;
[0087] An INSERT operation occurred in the systables system table.
[0088] Optionally, determining the change track of the system table according to the incremental information includes:
[0089] The changed system table name information and the operation type information are sorted according to the operation time information to generate a change track of the system table.
[0090] In this embodiment, the change track corresponding to the incremental information is syscolumns(insert)→sysfragments(insert)→systables(insert).
[0091] Optionally, determining the DDL operation type according to the change trace includes:
[0092] A search is performed in a DDL operation mapping table according to the change trajectory to obtain a DDL operation type corresponding to the change trajectory, wherein the DDL operation mapping table contains a mapping relationship between the change trajectory and the DDL operation type.
[0093] In this embodiment, a DDL operation mapping table is preset, which includes a mapping relationship between the change track and the operation type. After obtaining the change track, the corresponding operation type can be obtained by looking up the table.
[0094] Correspondingly, when the system table undergoes the above change trajectory, we can infer that the DDL operation type is a table creation statement, that is, the first inferred information is CREATE TABLE.
[0095] The systables, sysfragments, and syscolumns system tables are changed: Different DDL operations will trigger different change tracks. The same DDL operation will also trigger different types of change tracks. That is, one DDL operation may correspond to multiple system table tracks. The example here only describes one track.
[0096] In another possible embodiment, the system table is changed, and the incremental information is as follows:
[0097] 1. syscolumns has two delete operations
[0098] 1.1 The first time is to delete the first column (c1 int) information of table DSG.TAB
[0099] 1.2 The second time is to delete the information of the second column (c2 char(10)) of the table DSG.TAB
[0100] Note: syscolumns deletes the old column information of the table
[0101] 2. Syscolumns has three insert operations
[0102] 2.1 The first insert of the first column (c1 int) of table DSG.TAB
[0103] 2.2 The second insert into the second column (c2 char(10)) of table DSG.TAB
[0104] 2.3 The third column (c3 int) information of table DSG.TAB is inserted for the third time
[0105] Note: syscolumns inserts information about all columns of the table (error reporting of newly added columns)
[0106] 3. systables has an update-before operation
[0107] 3.1systables deletes the information of table DSG.TAB once (deleted information includes OWNER and table name, i.e. DSG.TAB, as well as tabid and partnum information)
[0108] Note: The so-called update-before refers to the old photo information before the update operation, which is a delete operation in form.
[0109] 4. systables has an update-after operation
[0110] 4.1systables reinserts the DSG.TAB table information and reports the OWNER.NAME, tabid, partnum and other information (at this time, tabid and partnum and other information may change)
[0111] Note: The so-called update-after is the new information after the update operation, which is expressed as an insert operation.
[0112] The corresponding change track is: syscolumns(delete)->syscolumns(insert)->systables(update-before)->systables(update-after).
[0113] The DDL operation obtained by querying the DDL operation mapping table according to the change track is: alter table addcolumn.
[0114] Optionally, the obtaining a DDL operation statement according to the incremental information and the DDL operation type analysis includes:
[0115] Determine a DDL operation function according to the DDL operation type;
[0116] Generate function filling content according to the change system table name information and operation type information;
[0117] The function filling content is filled into the DDL operation function according to the time sequence of the operation time information to generate the DDL operation statement.
[0118] There are two INSERT changes in syscolumns, and the changes are the insertion of two column information of the table. From the incremental transaction log, we can parse the first column: the column name is C1, the column type is INT, and the second column: the column name is C2, the column type is CHAR(10). That is, at this time, we can infer that the DDL operation function is CREATE TABLE, the system table name information is changed to syscolumns, and the operation type information is INSERT; the DDL operation statement obtained by filling the function filling content into the DDL operation function is CREATE TABLE(C1 INT,C2 CHAR(10))
[0119] systables has one INSERT change, and the change content is the insertion of basic table information: table owner name (DSG), table name (TAB), tabid number, partnum number, number of columns, etc. At this time, it can be inferred that the DDL operation function is CREATE TABLE, the system table name information is changed to systables, and the operation type information is INSERT; the DDL operation statement obtained by filling the function filling content into the DDL operation function is CREATE TABLE DSG.TAB (C1 INT, C2CHAR (10)).
[0120] Optionally, verifying the database according to the DDL operation statement includes:
[0121] Determine the changed system table and change information according to the DDL operation statement;
[0122] Generate a query statement according to the changed system table and the changed information;
[0123] The changed information in the changed system table is queried according to the query statement, and the verification result is generated.
[0124] In this embodiment, after performing incremental analysis on the track and content of the above system tables, the specific DDL statement can be inferred. The example in this article is CREATE TABLE DSG.TAB(C1 INT,C2CHAR(10)). However, these are all information indirectly derived from the transaction log file. In order to further confirm that the DDL statement has indeed occurred, the derived content information can be checked back in the database for verification.
[0125] Optionally, determining the target sentence according to the verification result includes:
[0126] If the verification results of all the query statements indicate that the changed system table contains the change information, then determining that the DDL operation statement is the target statement;
[0127] If the verification result of the query statement indicates that the changed system table does not contain the change information, it is determined that the DDL operation statement is not a target statement.
[0128] In this embodiment, the SQL statement for checking and verifying may be:
[0129] systables backcheck verification
[0130] select count(*)from systables where owner='DS'and tabname='TAB'andpartnum=xxx and tabid=xxxx
[0131] If the returned result is 1, it proves that the information does exist in the system table. If the returned result is 0, it means that the changes made by the DDL statement may be washed away by subsequent DDL changes, that is, the DDL statement has expired.
[0132] sysfragments backcheck verification
[0133] select count(*)from sysfragments where tabid=xxx and partn=xxx
[0134] If the result is greater than 1, it proves that the information does exist in the system table. If the result is 0, it means that the changes made by the DDL statement may be washed away by subsequent DDL changes, that is, the DDL statement has expired.
[0135] syscolumns back check verification
[0136] select count(*)from syscolumns where tabname='tab'and colname='c1'and coltype=xxx
[0137] select count(*)from syscolumns where tabname='tab'and colname='c2'and coltype=xxx
[0138] If the result is greater than 1, it proves that the information does exist in the system table. If the result is 0, it means that the changes made by the DDL statement may be washed away by subsequent DDL changes, that is, the DDL statement has expired.
[0139] The information obtained from the database is assembled into DDL statements, and the correctness of the information is verified by executing DDL statements. Just like the freshmen reporting to the university after the college entrance examination, the university checks the name and test number reported by the freshmen in the database to confirm whether the student is really admitted by the school.
[0140] The above only describes one change track of CREATE TABLE. The incremental analysis method for other DDL operations is the same as above. Remember to infer the DDL type for different change tracks, and then fill in the specific statement information of DDL according to the specific change content.
[0141] In order to implement the above embodiment, the present application also proposes a database DDL operation incremental analysis device. Figure 2 A schematic diagram of a database DDL operation incremental analysis device provided in an embodiment of the present application. Figure 2 As shown, the device comprises:
[0142] Incremental analysis module 210, used to obtain incremental information of system tables in the database;
[0143] An operation type analysis module 220, configured to determine a change track of a system table according to the incremental information, and determine a DDL operation type according to the change track;
[0144] An operation statement analysis module 230, configured to obtain a DDL operation statement according to the incremental information and the DDL operation type;
[0145] The verification module 240 is used to verify the database according to the DDL operation statement and determine the target statement according to the verification result.
[0146] In order to implement the above embodiments, the present application also proposes an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method provided by the above embodiments.
[0147] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the methods provided by the above embodiments.
[0148] In order to implement the above embodiments, the present application also proposes a computer program product, including a computer program, which implements the methods provided by the above embodiments when executed by a processor.
[0149] The collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in this application are in compliance with relevant laws and regulations and do not violate public order and good morals.
[0150] It should be noted that personal information from users should be collected for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. In addition, such collection / sharing should be carried out after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign the agreement / authorization including authorization of relevant user information before the user uses the function. In addition, any necessary steps should be taken to protect and safeguard access to such personal information data and ensure that others who have access to personal information data comply with its privacy policy and procedures.
[0151] The present application is expected to provide an implementation scheme for users to selectively block the use or access of personal information data. That is, the present disclosure is expected to provide hardware and / or software to prevent or block access to such personal information data. Once the personal information data is no longer needed, the risk can be minimized by limiting data collection and deleting the data. In addition, when applicable, such personal information is de-identified to protect the privacy of the user.
[0152] In the description of the aforementioned embodiments, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0153] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0154] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0155] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0156] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0157] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0158] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0159] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A method for incremental analysis of database data definition language DDL operations. It is characterized in that The following steps are involved: Get the incremental information of the system table in the database; Determine a change track of the system table according to the incremental information, and determine a DDL operation type according to the change track; Analyze and obtain a DDL operation statement according to the incremental information and the DDL operation type; The database is verified according to the DDL operation statement, and the target statement is determined according to the verification result.
2. The method according to claim 1, It is characterized in that The step of obtaining incremental information of a system table in a database includes: The data in the system table at the current time point is compared with the data in the system table at the initial time point, and the data added in the system table at the current time point is determined as the incremental information, and the incremental information includes the changed system table name information, operation time information, and operation type information.
3. The method according to claim 2, It is characterized in that Determining the change track of the system table according to the incremental information includes: The changed system table name information and the operation type information are sorted according to the operation time information to generate a change track of the system table.
4. The method according to claim 3, It is characterized in that The determining the DDL operation type according to the change track includes: A search is performed in a DDL operation mapping table according to the change trajectory to obtain a DDL operation type corresponding to the change trajectory, wherein the DDL operation mapping table contains a mapping relationship between the change trajectory and the DDL operation type.
5. The method according to claim 4, It is characterized in that The obtaining of the DDL operation statement according to the incremental information and the DDL operation type analysis includes: Determine a DDL operation function according to the DDL operation type; Generate function filling content according to the change system table name information and the operation type information; Fill the function filling content into the DDL operation function according to the time sequence of the operation time information to generate the DDL operation statement.
6. The method according to claim 5, It is characterized in that The verifying the database according to the DDL operation statement includes: Determine the changed system table and change information according to the DDL operation statement; Generate a query statement according to the changed system table and the changed information; The changed information in the changed system table is queried according to the query statement, and the verification result is generated.
7. The method according to claim 6, It is characterized in that Determining the target sentence according to the verification result includes: If the verification results of all the query statements indicate that the changed system table contains the change information, then determining that the DDL operation statement is the target statement; If the verification result of the query statement indicates that the changed system table does not contain the change information, it is determined that the DDL operation statement is not the target statement.
8. A database data definition language DDL operation incremental analysis device, It is characterized in that include: Incremental analysis module, used to obtain incremental information of system tables in the database; An operation type analysis module, used to determine the change track of the system table according to the incremental information, and determine the DDL operation type according to the change track; An operation statement analysis module, used for analyzing and obtaining a DDL operation statement according to the incremental information and the DDL operation type; The verification module is used to verify the database according to the DDL operation statement and determine the target statement according to the verification result.
9. An electronic device, It is characterized in that include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Patent Citations
Method and device for copying information after table structure modification
CN106326376A
Real-time synchronization method and device for querying table building data
CN116910150A
Data real-time synchronization method and device of database
CN117453812A
Method and device for verifying SQL statement execution result, equipment and medium
CN117472958A
Cited By
Synchronous anti-collision real-time optimization method and system for DDL (Double Data Language) of heterogeneous database
CN120067218A
