WO2012034440A1 - Method and device for generating database upgrading script - Google Patents
Method and device for generating database upgrading script Download PDFInfo
- Publication number
- WO2012034440A1 WO2012034440A1 PCT/CN2011/076526 CN2011076526W WO2012034440A1 WO 2012034440 A1 WO2012034440 A1 WO 2012034440A1 CN 2011076526 W CN2011076526 W CN 2011076526W WO 2012034440 A1 WO2012034440 A1 WO 2012034440A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- upgrade
- database
- script
- sql statement
- new
- 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.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/214—Database migration support
Definitions
- the present invention relates to the field of database upgrade technologies, and in particular, to a method and an apparatus for generating a database upgrade script. Background technique
- the upgrade of the version includes: program upgrade, configuration file upgrade and database Upgrade.
- the database upgrade is the most cumbersome, the database upgrade is achieved by executing the database script written in advance. Due to the complexity of the telecommunication service, the change of the network element model is relatively large, and the changes of factors such as the network element model cause the database to change accordingly. Since the amount of data in the database is large and the fields are large, the database script is manually written. The workload is large and error prone.
- the main object of the present invention is to provide a generator for generating a database upgrade script.
- the method and device enable the generated upgrade script to describe changes in the structure of the database table, as well as describe changes in the data in the table, and the upgrade script can implement rollback.
- the present invention provides a method for generating a database upgrade script, and sets and stores an upgrade rule description file corresponding to the data change in the database table.
- the method further includes:
- the table structure before and after the database upgrade is obtained, and the table structure before and after the database upgrade is compared; the upgrade rule description file is parsed, and the database upgrade is generated according to the analysis result and the comparison result of the table structure change. script.
- the upgrade rule description file includes: an algorithm for upgrading the original data in the original table to new data in the new table, and a value of a new field in the upgraded new table.
- the upgrade rule description file is an extensible markup language XML file format or a text file format.
- the parsing upgrade rule description file is: a table name, a field name, and a default value.
- the three parts of the upgrade rule description file are correspondingly classified, and the contents of each part are correspondingly stored in the table entry as a table name, a field name, and a default. The value in the table.
- the table name and the field name are the table name and the field name in the new table obtained after the upgrade; the default value is: an algorithm according to the upgrade of the original data in the upgrade rule description file to the new data, or a new table after the upgrade The value of the new field.
- the generated database upgrade script includes an upgrade statement and a fallback statement.
- the method further includes: generating a SQL statement for creating a table space in addition to the built-in SQL statement in the database script file; creating a user, a user-authorized SQL statement ; create a sequence number of SQL statements; create a view of the SQL statement; create a stored procedure SQL statement; create a trigger SQL statement and static configuration data insert statement changes script; also generate control for the upgrade operation Script.
- the present invention also provides a device for generating a database upgrade script, which includes a lexical analysis module and a syntax analysis module.
- the device further includes: an upgrade rule storage module, an upgrade rule analysis module, and an upgrade script generation module;
- the upgrade rule storage module is configured to store an upgrade rule description file corresponding to the data change in the set database table
- the upgrade rule parsing module is configured to parse the upgrade rule description file stored in the upgrade rule storage module, and send the parsing result to the upgrade script generation module;
- the upgrade script generating module is configured to compare a table structure before and after the database upgrade sent by the parsing module, and generate a database upgrade according to the parsing result sent by the upgrade rule parsing module and the comparison result of the database structure before and after the database upgrade. script.
- the parsing operation performed by the upgrade rule parsing module is specifically:
- the upgrade script generating module is further configured to generate a SQL statement for creating a table space in addition to the built-in SQL statement in the database script file; creating a SQL statement authorized by the user and the user; and creating a SQL statement of the serial number ; create a view of the SQL statement; create a stored procedure SQL statement; create a trigger SQL statement and static configuration data insert statement changes script, and generate a script to control the upgrade operation.
- the method and device for generating a database upgrade script focus on setting an upgrade rule description file, which describes an upgrade rule of data in a database table, and specifically includes upgrading original data in the original table to new data in the new table. Based on the algorithm, and the value of the new field in the new table after the upgrade.
- When generating the database upgrade script generate the corresponding upgrade statement for creating a new table or deleting the original table according to the comparison result of the table structure before and after the upgrade; and also generating data for importing into the new table.
- the SQL statement which includes the value of the new field in the new table or the algorithm by which the original data in the original table is upgraded to the new data in the new table. Therefore, the present invention can describe not only the change of the database table structure, but also the change of the data in the table, and the readability of the upgrade script is enhanced.
- the database upgrade script generated by the present invention further includes an upgrade statement for backing up the original table and a rollback statement, which can be rolled back to the original version of the database if the user needs or upgrade fails.
- FIG. 1 is a schematic flowchart of a method for generating a database upgrade script according to the present invention
- FIG. 2 is a schematic structural diagram of a database upgrade script generating apparatus according to the present invention. detailed description
- the database script file is roughly divided into the following eight parts according to the function: a) a structured query language (SQL) statement for creating a table space; b) creating a SQL statement authorized by the user and the user; c) Create SQL statements for tables and indexes; d) create SQL statements with serial numbers; e) create SQL statements for views; f) create SQL statements for stored procedures; g) create SQL statements for triggers; and h) statically configure data Insert the statement.
- SQL structured query language
- the c) the table and the index of the SQL statement mainly include: a table name, a field name, a field type, an index name, an index field, etc., by analyzing the statement, the table structure of the database can be obtained, in the prior art,
- the table and the indexed SQL statement are successively subjected to lexical analysis and parsing to obtain the table structure of the database.
- the SQL statement for creating the table and the index is simply referred to as the table-building SQL statement;
- the other seven parts of the database script file are usually unchanged during the upgrade process.
- the present invention mainly describes the changes in the table structure and the data in the table.
- the basic idea of the present invention is: setting and storing an upgrade rule description file corresponding to the data change in the database table; obtaining a table structure before and after the database upgrade by analyzing the built-in SQL statement, And compare the table structure before and after the database upgrade; parse the upgrade rule description file, and generate a database upgrade script according to the analysis result and the comparison result of the table structure change.
- the solution of the invention is not only applicable to database upgrade in the field of telecommunication management, but also applicable to database upgrade in other fields, for example: database upgrade of enterprise management system.
- FIG. 1 is a schematic flowchart of a method for generating a database upgrade script according to the present invention. As shown in FIG. 1, the implementation steps of the method are as follows:
- Step 101 Set and store an upgrade rule description file corresponding to the data change in the table.
- the data in the database table is used to describe different content, such as the field of telecommunication management, and the data in the table.
- the wireless resource is mainly described.
- the upgrade rule description file describes the change of the wireless resource, that is, the upgrade rule of the data in the table is described, for example: the original data in the original table is upgraded to a new one in the new table.
- the upgrade rule description file can be an Extensible Markup Language (XML) file format or a text file format.
- XML Extensible Markup Language
- the upgrade rule description file may be set by the relevant personnel of the radio resource module according to the needs of the maintenance work, and may also be set by the database upgrade management personnel.
- the workload of setting the upgrade rule description file is much smaller than the existing one. The workload of writing a database script.
- Step 102 Obtain a table structure before and after the database upgrade by analyzing the SQL statement of the table; specifically: performing lexical analysis and grammar for each of the built-in SQL statements in the source version script file and the upgraded target version script file respectively after the upgrade. Analysis, the table structure corresponding to the source version script file before the database upgrade, and the table structure corresponding to the target version script file after the database upgrade.
- This file is scanned to produce a single SQL statement.
- SQL statements generally end with a semicolon or "/”.
- you scan to such an end symbol you get a complete SQL statement and pass the SQL statement to the corresponding module that performs the parsing.
- the grammatical analysis is: obtaining, for each SQL statement obtained by the lexical analysis, the table name, the field name, and the field type information in the SQL statement according to the syntax of the SQL statement, and storing the information in the table attribute list, and the obtained table attribute list.
- the table structure of the database can be embodied. As shown in Table 1, Table 1 is an embodiment of a list of table attributes obtained by parsing.
- Step 103 Compare the table structure before and after the database upgrade
- the table structure corresponding to the target version script file is compared, that is, the table attribute list corresponding to the source version script file and the table attribute list corresponding to the target version script file are compared, and the table name, the field name, and the field type are sequentially compared.
- Step 104 Parse the upgrade rule description file. Specifically, the upgrade rule description file of the set XML file format or the text file format is analyzed, and the content in the upgrade rule description file is correspondingly classified according to the table name, the field name and the default value, wherein the table is The name and field name are the table name in the new table obtained after the upgrade and the field name in the new table; the default value is the algorithm by which the original data in the original table is upgraded to the new data in the new table, or is in the new table. Add the value of the field, etc.
- a TABCHANGE table can be created, and the entry is: a table name, a field name, and a default value, and is used to store the parsing result of the upgrade rule description file.
- Step 105 Generate a database upgrade script according to the analysis result and the comparison result of the table structure change
- a database upgrade script is generated, which includes an upgrade statement and a fallback statement, all of which are SQL statements.
- step 103 If it is determined in step 103 that a table exists in the source version script file, and the table does not exist in the target version script file, the generated upgrade script is as follows:
- Upgrade statement Modify the SQL statement of the original table named suffix BAK, and delete the original SQL statement;
- Rollback statement Modify the table with the suffix BAK to the SQL statement of the original table name.
- the original table name is changed to a table with a suffix of BAK, that is, the suffix BAK is added after the suffix of the original table name, and the purpose of modifying the table name is to implement backup of the original table. If you want to restore the suffix BAK, you can directly delete the suffix BAK and get the original table name, which corresponds to the back-off statement described above. This backup method is prior art and will not be described in detail.
- the backup of the original table structure is also included, and the backup of the data in the original table is also included to implement the rollback of the version.
- step 103 If the comparison in step 103 determines that a table exists in the target version script file, and the source version The table does not exist in the script file.
- the generated upgrade script is as follows:
- Upgrade statement Create a new table SQL statement and SQL statement to import data into the new table; Rollback statement: Delete the SQL statement of the new table.
- the corresponding SQL statement can be directly called from the target version script file; the importing the data into the new table is: According to the analysis result of the upgrade rule description file, the corresponding new The data is filled in the new table; the SQL statement that imports the data into the new table includes the default value in the parsing result, that is, the value of the new field in the new table.
- step 103 If it is determined in step 103 that a table exists in both the source version script file and the target version script file, all field attributes of the table need to be compared, such as: field name and field type, if all field attributes in the table are the same, NOTE: The table and the data in it are unchanged before and after the upgrade. That is, the table does not need to be upgraded. You do not need to generate an upgrade script corresponding to the table. If there are differences, the generated upgrade script is as follows:
- Upgrade statement Modify the SQL statement of the original table named suffix BAK, the SQL statement to create a new table, and the SQL statement to import data into the new table;
- Rollback statement Modify the table with the suffix BAK to the SQL statement of the original table name.
- the importing data into the new table is: filling the new table with data corresponding to the table name and the field name according to the parsing result of the upgrade rule description file; and the SQL statement for importing data into the new table This includes the default values in the parsing results, ie the algorithm by which the original data in the original table is upgraded to the new data in the new table.
- the table structure and other information except the data change in the table may be described, that is, the seven parts of the database script file except the built-in SQL statement, due to the seven parts. It usually does not change during the database upgrade process, so you can directly call the corresponding content in the target version script file during the upgrade. Therefore, the generated upgrade script can be: Call to the target version script file directory e) Create the view SQL Statement, or call f) create a stored procedure SQL statement, or call g) create a trigger SQL statement, or call h) static State configuration data insertion statements and so on.
- the invention may also generate a script for controlling the upgrade operation, which may include: upgrading the pre-processed SQL statement, querying the version number of the current running environment, and calling the SQL statement of the corresponding version upgrade script and the SQL statement after the upgrade, the script
- a script for controlling the upgrade operation may include: upgrading the pre-processed SQL statement, querying the version number of the current running environment, and calling the SQL statement of the corresponding version upgrade script and the SQL statement after the upgrade, the script
- the present invention further provides a device for generating a database upgrade script.
- the device includes: an existing lexical analysis module and a syntax analysis module; and further includes: an upgrade rule storage module and an upgrade rule a parsing module and an upgrade script generating module; wherein, the version script file is scanned, and a SQL statement is generated and transmitted to the parsing module; the parsing module is configured to perform parsing on each SQL statement sent by the lexical module And sending the analyzed table structure before and after the database upgrade to the upgrade script generation module;
- the table name, the field name, and the field type information in each SQL statement are obtained according to the syntax of the SQL statement, and are stored in the table attribute list, and the obtained table attribute list is transmitted to the upgrade script generation module.
- the upgrade rule storage module is configured to store an upgrade rule description file corresponding to the data change in the set database table
- the upgrade rule parsing module is configured to parse the upgrade rule description file stored in the upgrade rule storage module, and send the parsing result to the upgrade script generation module;
- the upgrade script generating module is configured to compare a table structure before and after the database upgrade sent by the parsing module, and generate a database according to the parsing result sent by the upgrade rule parsing module and the comparison result of the table structure before and after the database upgrade. Upgrade the script.
- the upgrade script generating module is further configured to generate a script for indicating a change of seven parts other than the built-in SQL statement in the database script file, and generate a script for controlling the upgrade operation.
- the parsing operation performed by the upgrade rule parsing module is specifically:
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)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Stored Programmes (AREA)
Abstract
Description
一种数据库升级脚本的生成方法和装置 技术领域 Method and device for generating database upgrade script
本发明涉及数据库升级技术领域, 尤其涉及一种数据库升级脚本的生 成方法和装置。 背景技术 The present invention relates to the field of database upgrade technologies, and in particular, to a method and an apparatus for generating a database upgrade script. Background technique
目前, 在电信管理项目开发中, 根据应用的需要需开发和维护多个代 码分支, 与此对应的是不同版本间的升级, 所述版本的升级包括: 程序的 升级、 配置文件的升级和数据库的升级。 其中, 数据库的升级是最繁瑣的, 数据库升级是通过执行事先写好的数据库脚本来实现的。 由于电信业务的 复杂性导致网元模型的变化比较大, 而且, 网元模型等因素的变化使得数 据库也要相应变化, 又由于数据库里的数据量较大, 字段较多, 所以人工 编写数据库脚本的工作量很大, 且容易出错。 At present, in the development of telecom management projects, multiple code branches need to be developed and maintained according to the needs of the application, and corresponding to the upgrade between different versions, the upgrade of the version includes: program upgrade, configuration file upgrade and database Upgrade. Among them, the database upgrade is the most cumbersome, the database upgrade is achieved by executing the database script written in advance. Due to the complexity of the telecommunication service, the change of the network element model is relatively large, and the changes of factors such as the network element model cause the database to change accordingly. Since the amount of data in the database is large and the fields are large, the database script is manually written. The workload is large and error prone.
为了解决编写数据库脚本工作量大的问题, 现有技术中已提出一种自 动生成数据库升级脚本的方法, 该方法通过比较数据库的源版本脚本文件 和目标版本脚本文件得到数据库表结构的变化, 根据数据库表结构的变化 生成升级脚本。 但是, 仅仅比较数据库表结构的变化是不够的, 因为数据 库表中还存有对应的记录, 也就是数据, 升级后数据库表中的数据也将会 发生变化。 因此, 现有方法生成的数据库升级脚本未能全面反映数据库的 变化情况, 可读性较差; 此外, 由于生成的数据库升级脚本中不包括数据 的变化, 且未实现原有数据的备份, 因此无法实现版本的回退。 发明内容 In order to solve the problem of writing a large amount of database scripts, a method for automatically generating a database upgrade script has been proposed in the prior art, and the method obtains a change of the database table structure by comparing the source version script file and the target version script file of the database, according to The database table structure changes to generate an upgrade script. However, it is not enough to just compare the changes in the database table structure, because there are corresponding records in the database table, that is, data, and the data in the database table after the upgrade will also change. Therefore, the database upgrade script generated by the existing method fails to fully reflect the change of the database, and the readability is poor. In addition, since the generated database upgrade script does not include the change of the data, and the backup of the original data is not implemented, Unable to implement rollback of the version. Summary of the invention
有鉴于此, 本发明的主要目的在于提供一种数据库升级脚本的生成方 法和装置, 使得生成的升级脚本既可描述数据库表结构的变化, 还可描述 表中数据的变化, 且升级脚本可实现回退。 In view of this, the main object of the present invention is to provide a generator for generating a database upgrade script. The method and device enable the generated upgrade script to describe changes in the structure of the database table, as well as describe changes in the data in the table, and the upgrade script can implement rollback.
为解决上述技术问题, 本发明的技术方案是这样实现的: In order to solve the above technical problem, the technical solution of the present invention is implemented as follows:
本发明提供了一种数据库升级脚本的生成方法, 设置并存储与数据库 表中的数据变化对应的升级规则描述文件; 该方法还包括: The present invention provides a method for generating a database upgrade script, and sets and stores an upgrade rule description file corresponding to the data change in the database table. The method further includes:
通过分析建表结构化查询语言 SQL语句得到数据库升级前后的表结 构, 并对数据库升级前后表结构进行比较; 解析升级规则描述文件, 并依 据解析结果以及所述表结构变化的比较结果生成数据库升级脚本。 By analyzing the table structure structured query language SQL statement, the table structure before and after the database upgrade is obtained, and the table structure before and after the database upgrade is compared; the upgrade rule description file is parsed, and the database upgrade is generated according to the analysis result and the comparison result of the table structure change. script.
其中, 所述升级规则描述文件中包括: 原表中的原始数据升级为新表 中的新数据所依据的算法、 以及升级后新表中新增字段的值。 The upgrade rule description file includes: an algorithm for upgrading the original data in the original table to new data in the new table, and a value of a new field in the upgraded new table.
其中, 所述升级规则描述文件为可扩展标记语言 XML文件格式、 或者 文本文件格式。 The upgrade rule description file is an extensible markup language XML file format or a text file format.
其中, 所述解析升级规则描述文件为: 表名、 字段名和缺省值三部分将升级规则描述文件中的内容对应归类, 将 各部分内容对应存储于表项为表名、 字段名和缺省值的表中。 The parsing upgrade rule description file is: a table name, a field name, and a default value. The three parts of the upgrade rule description file are correspondingly classified, and the contents of each part are correspondingly stored in the table entry as a table name, a field name, and a default. The value in the table.
其中, 所述表名和字段名为升级后所得新表中的表名和字段名; 所述 缺省值为: 升级规则描述文件中的原始数据升级为新数据所依据的算法、 或者升级后新表中新增字段的值。 The table name and the field name are the table name and the field name in the new table obtained after the upgrade; the default value is: an algorithm according to the upgrade of the original data in the upgrade rule description file to the new data, or a new table after the upgrade The value of the new field.
其中, 所述生成的数据库升级脚本中包括升级语句和回退语句。 The generated database upgrade script includes an upgrade statement and a fallback statement.
上述方案中, 所述生成数据库升级脚本的过程中, 该方法还包括: 生成用于表示数据库脚本文件中除建表 SQL语句之外的创建表空间的 SQL语句; 创建用户、 用户授权的 SQL语句; 创建序列号的 SQL语句; 创建视图的 SQL语句; 创建存储过程的 SQL语句; 创建触发器的 SQL语 句和静态配置数据的插入语句的变化的脚本; 还生成用于控制升级操作的 脚本。 In the above solution, in the process of generating a database upgrade script, the method further includes: generating a SQL statement for creating a table space in addition to the built-in SQL statement in the database script file; creating a user, a user-authorized SQL statement ; create a sequence number of SQL statements; create a view of the SQL statement; create a stored procedure SQL statement; create a trigger SQL statement and static configuration data insert statement changes script; also generate control for the upgrade operation Script.
本发明还提供了一种数据库升级脚本的生成装置, 包括词法分析模块 和语法分析模块; 该装置还包括: 升级规则存储模块、 升级规则解析模块 和升级脚本生成模块; 其中, The present invention also provides a device for generating a database upgrade script, which includes a lexical analysis module and a syntax analysis module. The device further includes: an upgrade rule storage module, an upgrade rule analysis module, and an upgrade script generation module;
所述升级规则存储模块, 用于存储已设置的数据库表中的数据变化对 应的升级规则描述文件; The upgrade rule storage module is configured to store an upgrade rule description file corresponding to the data change in the set database table;
所述升级规则解析模块, 用于解析升级规则存储模块中存储的升级规 则描述文件, 并将解析结果发送给升级脚本生成模块; The upgrade rule parsing module is configured to parse the upgrade rule description file stored in the upgrade rule storage module, and send the parsing result to the upgrade script generation module;
所述升级脚本生成模块, 用于对语法分析模块所发的数据库升级前后 的表结构进行比较, 并依据升级规则解析模块所发的解析结果以及所述数 据库升级前后表结构的比较结果生成数据库升级脚本。 The upgrade script generating module is configured to compare a table structure before and after the database upgrade sent by the parsing module, and generate a database upgrade according to the parsing result sent by the upgrade rule parsing module and the comparison result of the database structure before and after the database upgrade. script.
其中, 所述升级规则解析模块执行的解析操作, 具体为: The parsing operation performed by the upgrade rule parsing module is specifically:
调用并分析升级规则存储模块中存储的升级规则描述文件, 按表名、 字段名和缺省值三部分将升级规则描述文件中的内容对应归类, 将各部分 内容对应存储于表项为表名、 字段名和缺省值的表中。 Calling and analyzing the upgrade rule description file stored in the upgrade rule storage module, classifying the content in the upgrade rule description file according to the table name, the field name, and the default value, and storing the contents of each part in the table entry as the table name. , field names, and default values in the table.
其中, 所述升级脚本生成模块, 还用于生成用于表示数据库脚本文件 中除建表 SQL语句之外的创建表空间的 SQL语句; 创建用户、用户授权的 SQL语句; 创建序列号的 SQL语句; 创建视图的 SQL语句; 创建存储过 程的 SQL语句;创建触发器的 SQL语句和静态配置数据的插入语句的变化 的脚本, 以及生成用于控制升级操作的脚本。 The upgrade script generating module is further configured to generate a SQL statement for creating a table space in addition to the built-in SQL statement in the database script file; creating a SQL statement authorized by the user and the user; and creating a SQL statement of the serial number ; create a view of the SQL statement; create a stored procedure SQL statement; create a trigger SQL statement and static configuration data insert statement changes script, and generate a script to control the upgrade operation.
本发明提供的数据库升级脚本的生成方法和装置, 重点在于设置了升 级规则描述文件, 其中描述了数据库表中数据的升级规则, 具体包括原表 中的原始数据升级为新表中的新数据所依据的算法、 以及升级后新表中新 增字段的值。 在生成数据库升级脚本时, 依据对升级前后表结构的比较结 果生成相应的创建新表或删除原表的升级语句; 还生成向新表中导入数据 的 SQL语句, 该语句中包括新表中新增字段的值或者原表中的原始数据升 级为新表中的新数据所依据的算法。 因此, 本发明既可描述数据库表结构 的变化, 还可描述表中数据的变化, 升级脚本的可读性增强。 The method and device for generating a database upgrade script provided by the present invention focus on setting an upgrade rule description file, which describes an upgrade rule of data in a database table, and specifically includes upgrading original data in the original table to new data in the new table. Based on the algorithm, and the value of the new field in the new table after the upgrade. When generating the database upgrade script, generate the corresponding upgrade statement for creating a new table or deleting the original table according to the comparison result of the table structure before and after the upgrade; and also generating data for importing into the new table. The SQL statement, which includes the value of the new field in the new table or the algorithm by which the original data in the original table is upgraded to the new data in the new table. Therefore, the present invention can describe not only the change of the database table structure, but also the change of the data in the table, and the readability of the upgrade script is enhanced.
此外, 本发明生成的数据库升级脚本中还包括对原表进行备份的升级 语句以及回退语句, 可在用户需要或升级失败等情况下回退到数据库的原 始版本。 附图说明 In addition, the database upgrade script generated by the present invention further includes an upgrade statement for backing up the original table and a rollback statement, which can be rolled back to the original version of the database if the user needs or upgrade fails. DRAWINGS
图 1为本发明数据库升级脚本的生成方法实现流程示意图; 1 is a schematic flowchart of a method for generating a database upgrade script according to the present invention;
图 2为本发明数据库升级脚本生成装置的结构示意图。 具体实施方式 FIG. 2 is a schematic structural diagram of a database upgrade script generating apparatus according to the present invention. detailed description
从现有技术可知, 数据库脚本文件按功能大致分为以下八部分: a )创 建表空间的结构化查询语言 ( Structured Query Language , SQL )语句; b ) 创建用户、 用户授权的 SQL语句; c )创建表、 索引的 SQL语句; d )创建 序列号的 SQL语句; e )创建视图的 SQL语句; f )创建存储过程的 SQL 语句; g )创建触发器的 SQL语句; 和 h )静态配置数据的插入语句。 在数 据库升级过程中, 经常变化的是表结构和表中的数据。 As can be seen from the prior art, the database script file is roughly divided into the following eight parts according to the function: a) a structured query language (SQL) statement for creating a table space; b) creating a SQL statement authorized by the user and the user; c) Create SQL statements for tables and indexes; d) create SQL statements with serial numbers; e) create SQL statements for views; f) create SQL statements for stored procedures; g) create SQL statements for triggers; and h) statically configure data Insert the statement. In the database upgrade process, the data in the table structure and the table are often changed.
其中, 所述 c )创建表、 索引的 SQL语句中主要包括: 表名、 字段名、 字段类型、 索引名、 索引字段等, 通过分析该语句可得到数据库的表结构, 现有技术中, 通过对所述 c )创建表、 索引的 SQL语句先后进行词法分析 和语法分析可得到数据库的表结构, 本发明后续描述中, 将 c )创建表、 索 引的 SQL语句简称为建表 SQL语句;所述数据库脚本文件的其它七部分在 升级过程中通常不变, 本发明主要针对表结构和表中数据的变化进行描述。 The c) the table and the index of the SQL statement mainly include: a table name, a field name, a field type, an index name, an index field, etc., by analyzing the statement, the table structure of the database can be obtained, in the prior art, For the c) the table and the indexed SQL statement are successively subjected to lexical analysis and parsing to obtain the table structure of the database. In the subsequent description of the present invention, c) the SQL statement for creating the table and the index is simply referred to as the table-building SQL statement; The other seven parts of the database script file are usually unchanged during the upgrade process. The present invention mainly describes the changes in the table structure and the data in the table.
本发明的基本思想是: 设置并存储与数据库表中的数据变化对应的升 级规则描述文件; 通过分析建表 SQL语句得到数据库升级前后的表结构, 并对数据库升级前后表结构进行比较; 解析升级规则描述文件, 并依据解 析结果以及所述表结构变化的比较结果生成数据库升级脚本。 The basic idea of the present invention is: setting and storing an upgrade rule description file corresponding to the data change in the database table; obtaining a table structure before and after the database upgrade by analyzing the built-in SQL statement, And compare the table structure before and after the database upgrade; parse the upgrade rule description file, and generate a database upgrade script according to the analysis result and the comparison result of the table structure change.
本发明方案不仅适用于电信管理领域的数据库升级, 还适用于其它领 域的数据库升级, 例如: 企业管理系统的数据库升级等。 The solution of the invention is not only applicable to database upgrade in the field of telecommunication management, but also applicable to database upgrade in other fields, for example: database upgrade of enterprise management system.
下面结合附图及具体实施例对本发明作进一步详细说明。 The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
图 1为本发明数据库升级脚本的生成方法实现流程示意图, 如图 1所 示, 该方法的实现步骤如下: FIG. 1 is a schematic flowchart of a method for generating a database upgrade script according to the present invention. As shown in FIG. 1, the implementation steps of the method are as follows:
步骤 101 : 设置并存储与表中的数据变化对应的升级规则描述文件; 这里, 对于不同的领域, 数据库的表中的数据用于描述不同的内容, 如电信管理领域, 所述表中的数据则主要描述无线资源, 相应的, 所述升 级规则描述文件则描述了无线资源的变化情况, 即: 描述了表中数据的升 级规则, 例如: 原表中的原始数据升级为新表中的新数据所依据的算法、 以及升级后新表中新增字段的值等。 升级规则描述文件可为可扩展标记语 言 (XML )文件格式或者文本文件格式等。 Step 101: Set and store an upgrade rule description file corresponding to the data change in the table. Here, for different domains, the data in the database table is used to describe different content, such as the field of telecommunication management, and the data in the table. The wireless resource is mainly described. Correspondingly, the upgrade rule description file describes the change of the wireless resource, that is, the upgrade rule of the data in the table is described, for example: the original data in the original table is upgraded to a new one in the new table. The algorithm on which the data is based, and the value of the new field in the new table after the upgrade. The upgrade rule description file can be an Extensible Markup Language (XML) file format or a text file format.
其中, 对于电信管理领域, 所述升级规则描述文件可由无线资源模块 的相关人员依据维护工作的需要来设置, 当然也可由数据库升级管理人员 来设置, 设置升级规则描述文件的工作量远小于现有所述编写数据库脚本 的工作量。 For the field of telecommunication management, the upgrade rule description file may be set by the relevant personnel of the radio resource module according to the needs of the maintenance work, and may also be set by the database upgrade management personnel. The workload of setting the upgrade rule description file is much smaller than the existing one. The workload of writing a database script.
步骤 102: 通过分析建表 SQL语句得到数据库升级前后的表结构; 具体为: 分别对升级前的源版本脚本文件和升级后的目标版本脚本文 件中的所有建表 SQL语句逐条进行词法分析和语法分析, 得到数据库升级 前的源版本脚本文件对应的表结构, 以及数据库升级后的目标版本脚本文 件对应的表结构。 Step 102: Obtain a table structure before and after the database upgrade by analyzing the SQL statement of the table; specifically: performing lexical analysis and grammar for each of the built-in SQL statements in the source version script file and the upgraded target version script file respectively after the upgrade. Analysis, the table structure corresponding to the source version script file before the database upgrade, and the table structure corresponding to the target version script file after the database upgrade.
这里, 所述词法分析和语法分析过程为现有技术, 下面对其实现进行 简单描述。 本文件进行扫描,产生一条条 SQL语句。 SQL语句一般以分号或 "/"结尾, 扫描到这样的结束符号时正好得到一条完整的 SQL语句,并把该 SQL语句 传输给执行语法分析的相应模块。 Here, the lexical analysis and grammar analysis process is prior art, and its implementation is briefly described below. This file is scanned to produce a single SQL statement. SQL statements generally end with a semicolon or "/". When you scan to such an end symbol, you get a complete SQL statement and pass the SQL statement to the corresponding module that performs the parsing.
所述语法分析为: 对经词法分析得到的每条 SQL语句,按照 SQL语句 的语法格式获取 SQL语句里的表名、 字段名和字段类型信息, 并存储于表 属性列表中, 所得的表属性列表可体现数据库的表结构, 如表 1所示, 表 1 为经语法分析得到的表属性列表的一实施例。 The grammatical analysis is: obtaining, for each SQL statement obtained by the lexical analysis, the table name, the field name, and the field type information in the SQL statement according to the syntax of the SQL statement, and storing the information in the table attribute list, and the obtained table attribute list. The table structure of the database can be embodied. As shown in Table 1, Table 1 is an embodiment of a list of table attributes obtained by parsing.
表 1 Table 1
步骤 103: 对数据库升级前后表结构进行比较; Step 103: Compare the table structure before and after the database upgrade;
目标版本脚本文件对应的表结构进行比较, 也就是比较源版本脚本文件对 应的表属性列表和目标版本脚本文件对应的表属性列表, 依次对所述表名、 字段名和字段类型进行比较。 The table structure corresponding to the target version script file is compared, that is, the table attribute list corresponding to the source version script file and the table attribute list corresponding to the target version script file are compared, and the table name, the field name, and the field type are sequentially compared.
例如: 判断源版本脚本文件对应的表属性列表中的表名 POLICYPROPERTY是否也包含在目标版本脚本文件对应的表属性列表中, 如果不存在, 则说明升级后, 该表名对应的表已被删除; 相反, 如果目标 版本脚本文件对应的表属性列表中的表名 POLICYPROPERTY不包含在源 版本脚本文件对应的表属性列表中, 则说明该表名对应的表为升级后新增 的表。 如果升级前后的表名相同, 则比较字段名和字段类型。 For example: Determine whether the table name POLICYPROPERTY in the table attribute list corresponding to the source version script file is also included in the table attribute list corresponding to the target version script file. If it does not exist, it indicates that the table corresponding to the table name has been deleted after the upgrade. On the contrary, if the table name POLICYPROPERTY in the table attribute list corresponding to the target version script file is not included in the table attribute list corresponding to the source version script file, the table corresponding to the table name is the table added after the upgrade. If the table names before and after the upgrade are the same, compare the field name and field type.
步骤 104: 解析升级规则描述文件; 具体为:对已设置的 XML文件格式或者文本文件格式的升级规则描述 文件进行分析, 按表名、 字段名和缺省值三部分将升级规则描述文件中的 内容对应归类, 其中, 所述表名和字段名为升级后所得新表中的表名和新 表中的字段名; 所述缺省值为原表中的原始数据升级为新表中的新数据所 依据的算法、或者为新表中新增字段的值等。这里,可创建一 TABCHANGE 表, 表项为: 表名、 字段名和缺省值, 用于存储所述对升级规则描述文件 的解析结果。 Step 104: Parse the upgrade rule description file. Specifically, the upgrade rule description file of the set XML file format or the text file format is analyzed, and the content in the upgrade rule description file is correspondingly classified according to the table name, the field name and the default value, wherein the table is The name and field name are the table name in the new table obtained after the upgrade and the field name in the new table; the default value is the algorithm by which the original data in the original table is upgraded to the new data in the new table, or is in the new table. Add the value of the field, etc. Here, a TABCHANGE table can be created, and the entry is: a table name, a field name, and a default value, and is used to store the parsing result of the upgrade rule description file.
本发明中, 所述步骤 103与步骤 104的先后顺序可以调换。 In the present invention, the sequence of the steps 103 and 104 can be reversed.
步骤 105:依据解析结果以及所述表结构变化的比较结果生成数据库升 级脚本; Step 105: Generate a database upgrade script according to the analysis result and the comparison result of the table structure change;
具体为: 依据对升级规则描述文件的解析结果, 如 TABCHANGE表中 的具体内容以及步骤 103 中得到的比较结果生成数据库升级脚本, 其中包 括升级语句和回退语句, 均为 SQL语句。 例如: Specifically: According to the analysis result of the upgrade rule description file, such as the specific content in the TABCHANGE table and the comparison result obtained in step 103, a database upgrade script is generated, which includes an upgrade statement and a fallback statement, all of which are SQL statements. E.g:
1 )如果步骤 103中比较确定源版本脚本文件中存在某表, 而目标版本 脚本文件中不存在该表, 生成的升级脚本如下: 1) If it is determined in step 103 that a table exists in the source version script file, and the table does not exist in the target version script file, the generated upgrade script is as follows:
升级语句: 修改原表名为后缀为 BAK的表的 SQL语句, 以及删除原 表的 SQL语句; Upgrade statement: Modify the SQL statement of the original table named suffix BAK, and delete the original SQL statement;
回退语句: 将后缀为 BAK的表修改为原表名的 SQL语句。 Rollback statement: Modify the table with the suffix BAK to the SQL statement of the original table name.
其中, 所述将原表名改为后缀为 BAK的表, 即为在原表名的后缀后再 添加后缀 BAK,修改表名的目的为:实现原表的备份。如要恢复后缀为 BAK 的表, 则可直接把后缀 BAK删除即可, 得到原表名, 对应上文所述的回退 语句, 该备份方法为现有技术, 不再详述。 The original table name is changed to a table with a suffix of BAK, that is, the suffix BAK is added after the suffix of the original table name, and the purpose of modifying the table name is to implement backup of the original table. If you want to restore the suffix BAK, you can directly delete the suffix BAK and get the original table name, which corresponds to the back-off statement described above. This backup method is prior art and will not be described in detail.
本发明中, 在备份表的过程中, 既包括原表结构的备份, 也包括原表 中数据的备份, 以实现版本的回退。 In the process of the backup table, the backup of the original table structure is also included, and the backup of the data in the original table is also included to implement the rollback of the version.
2 )如果步骤 103中比较确定目标版本脚本文件中存在某表, 而源版本 脚本文件中不存在该表, 生成的升级脚本如下: 2) If the comparison in step 103 determines that a table exists in the target version script file, and the source version The table does not exist in the script file. The generated upgrade script is as follows:
升级语句: 创建新表的 SQL语句和向新表中导入数据的 SQL语句; 回退语句: 删除该新表的 SQL语句。 Upgrade statement: Create a new table SQL statement and SQL statement to import data into the new table; Rollback statement: Delete the SQL statement of the new table.
其中, 由于创建新表的 SQL语句比较简单, 可直接从目标版本脚本文 件中调用相应 SQL语句; 所述向新表中导入数据即为: 依据对升级规则描 述文件的解析结果, 将对应的新数据填入新表中; 所述向新表中导入数据 的 SQL语句中包括解析结果中的缺省值, 即: 新表中新增字段的值。 Wherein, since the SQL statement for creating a new table is relatively simple, the corresponding SQL statement can be directly called from the target version script file; the importing the data into the new table is: According to the analysis result of the upgrade rule description file, the corresponding new The data is filled in the new table; the SQL statement that imports the data into the new table includes the default value in the parsing result, that is, the value of the new field in the new table.
3 )如果步骤 103中比较确定源版本脚本文件和目标版本脚本文件中均 存在某表, 则需比较该表的所有字段属性, 如: 字段名和字段类型, 如果 表中所有字段属性均相同, 则说明该表以及其中的数据在升级前后未变化, 即该表不需升级, 则不需生成与该表对应的升级脚本; 若存在不同, 则生 成的升级脚本如下: 3) If it is determined in step 103 that a table exists in both the source version script file and the target version script file, all field attributes of the table need to be compared, such as: field name and field type, if all field attributes in the table are the same, NOTE: The table and the data in it are unchanged before and after the upgrade. That is, the table does not need to be upgraded. You do not need to generate an upgrade script corresponding to the table. If there are differences, the generated upgrade script is as follows:
升级语句: 修改原表名为后缀为 BAK的表的 SQL语句、 创建新表的 SQL语句以及向新表中导入数据的 SQL语句; Upgrade statement: Modify the SQL statement of the original table named suffix BAK, the SQL statement to create a new table, and the SQL statement to import data into the new table;
回退语句: 将后缀为 BAK的表修改为原表名的 SQL语句。 Rollback statement: Modify the table with the suffix BAK to the SQL statement of the original table name.
其中, 所述向新表中导入数据即为: 依据对升级规则描述文件的解析 结果, 将与表名和字段名对应的数据填入新表中; 所述向新表中导入数据 的 SQL语句中包括解析结果中的缺省值, 即: 原表中的原始数据升级为新 表中的新数据所依据的算法。 The importing data into the new table is: filling the new table with data corresponding to the table name and the field name according to the parsing result of the upgrade rule description file; and the SQL statement for importing data into the new table This includes the default values in the parsing results, ie the algorithm by which the original data in the original table is upgraded to the new data in the new table.
进一步地, 所述步骤 105 中还可对表结构和表中数据变化之外的其它 信息进行描述, 即: 数据库脚本文件中除建表 SQL语句之外的其它七部分 的变化, 由于这七部分在数据库升级过程中通常不变, 因此在升级时可直 接调用目标版本脚本文件中的对应内容即可, 因此, 生成的升级脚本可为: 到目标版本脚本文件目录下调用 e )创建视图的 SQL语句、 或调用 f )创建 存储过程的 SQL语句、 或调用 g )创建触发器的 SQL语句、 或调用 h )静 态配置数据的插入语句等等。 Further, in the step 105, the table structure and other information except the data change in the table may be described, that is, the seven parts of the database script file except the built-in SQL statement, due to the seven parts. It usually does not change during the database upgrade process, so you can directly call the corresponding content in the target version script file during the upgrade. Therefore, the generated upgrade script can be: Call to the target version script file directory e) Create the view SQL Statement, or call f) create a stored procedure SQL statement, or call g) create a trigger SQL statement, or call h) static State configuration data insertion statements and so on.
本发明还可生成用于控制升级操作的脚本,可包括:升级预处理的 SQL 语句、 查询当前运行环境的版本号并调用相应版本升级脚本的 SQL语句和 升级后处理的 SQL语句等,该脚本的生成过程为现有技术,此处不再详述。 The invention may also generate a script for controlling the upgrade operation, which may include: upgrading the pre-processed SQL statement, querying the version number of the current running environment, and calling the SQL statement of the corresponding version upgrade script and the SQL statement after the upgrade, the script The generation process is prior art and will not be described in detail herein.
为实现上述方法, 本发明还提供了一种数据库升级脚本的生成装置, 如图 2所示, 该装置包括: 已有的词法分析模块和语法分析模块; 还包括: 升级规则存储模块、 升级规则解析模块和升级脚本生成模块; 其中, 版本脚本文件进行扫描, 产生一条条 SQL语句, 并传输给语法分析模块; 所述语法分析模块, 用于对词法分析模块发送的每条 SQL语句进行语 法分析, 并将分析所得的数据库升级前后的表结构发送给升级脚本生成模 块; In order to implement the above method, the present invention further provides a device for generating a database upgrade script. As shown in FIG. 2, the device includes: an existing lexical analysis module and a syntax analysis module; and further includes: an upgrade rule storage module and an upgrade rule a parsing module and an upgrade script generating module; wherein, the version script file is scanned, and a SQL statement is generated and transmitted to the parsing module; the parsing module is configured to perform parsing on each SQL statement sent by the lexical module And sending the analyzed table structure before and after the database upgrade to the upgrade script generation module;
具体为: 按照 SQL语句的语法格式获取每条 SQL语句里的表名、字段 名和字段类型信息, 并存储于表属性列表中, 并将所得表属性列表传输给 升级脚本生成模块。 Specifically, the table name, the field name, and the field type information in each SQL statement are obtained according to the syntax of the SQL statement, and are stored in the table attribute list, and the obtained table attribute list is transmitted to the upgrade script generation module.
所述升级规则存储模块, 用于存储已设置的数据库表中的数据变化对 应的升级规则描述文件; The upgrade rule storage module is configured to store an upgrade rule description file corresponding to the data change in the set database table;
所述升级规则解析模块, 用于解析升级规则存储模块中存储的升级规 则描述文件, 并将解析结果发送给升级脚本生成模块; The upgrade rule parsing module is configured to parse the upgrade rule description file stored in the upgrade rule storage module, and send the parsing result to the upgrade script generation module;
所述升级脚本生成模块, 用于对语法分析模块所发的数据库升级前后 的表结构进行比较, 并依据升级规则解析模块所发的解析结果以及所述数 据库升级前后的表结构的比较结果生成数据库升级脚本。 The upgrade script generating module is configured to compare a table structure before and after the database upgrade sent by the parsing module, and generate a database according to the parsing result sent by the upgrade rule parsing module and the comparison result of the table structure before and after the database upgrade. Upgrade the script.
所述升级脚本生成模块, 还用于生成用于表示数据库脚本文件中除建 表 SQL语句之外的其它七部分的变化的脚本, 以及生成用于控制升级操作 的脚本。 所述升级规则解析模块执行的解析操作, 具体为: The upgrade script generating module is further configured to generate a script for indicating a change of seven parts other than the built-in SQL statement in the database script file, and generate a script for controlling the upgrade operation. The parsing operation performed by the upgrade rule parsing module is specifically:
调用并分析升级规则存储模块中存储的升级规则描述文件, 按表名、 字段名和缺省值三部分将升级规则描述文件中的内容对应归类, 将各部分 内容对应存储于表项为表名、 字段名和缺省值的表中。 Calling and analyzing the upgrade rule description file stored in the upgrade rule storage module, classifying the content in the upgrade rule description file according to the table name, the field name, and the default value, and storing the contents of each part in the table entry as the table name. , field names, and default values in the table.
以上所述, 仅为本发明的较佳实施例而已, 并非用于限定本发明的保 护范围, 凡在本发明的精神和原则之内所作的任何修改、 等同替换和改进 等, 均应包含在本发明的保护范围之内。 The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included. Within the scope of protection of the present invention.
Claims
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2010102873786A CN102402559A (en) | 2010-09-16 | 2010-09-16 | A method and device for generating a database upgrade script |
| CN201010287378.6 | 2010-09-16 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2012034440A1 true WO2012034440A1 (en) | 2012-03-22 |
Family
ID=45830984
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2011/076526 Ceased WO2012034440A1 (en) | 2010-09-16 | 2011-06-28 | Method and device for generating database upgrading script |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN102402559A (en) |
| WO (1) | WO2012034440A1 (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103810257A (en) * | 2014-01-24 | 2014-05-21 | 华为技术有限公司 | Method and device for upgrading software database and equipment |
| CN104881455A (en) * | 2015-05-20 | 2015-09-02 | 深圳市酷开网络科技有限公司 | Structural difference processing method and system based on MYSQL |
| US9513901B2 (en) | 2015-03-31 | 2016-12-06 | International Business Machines Corporation | Deploying incremental scripts |
| CN115587575A (en) * | 2022-09-26 | 2023-01-10 | 中国建设银行股份有限公司 | Data table creation method, target data query method, device and equipment |
| CN118227590A (en) * | 2024-03-11 | 2024-06-21 | 山东浪潮科学研究院有限公司 | A database version management method and device in software development process |
Families Citing this family (30)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102855305B (en) * | 2012-08-20 | 2015-05-27 | 大唐移动通信设备有限公司 | Data upgrading method and device |
| CN102890720A (en) * | 2012-10-16 | 2013-01-23 | 南京通达海信息技术有限公司 | Database inspection and maintenance method |
| CN104252486B (en) * | 2013-06-28 | 2017-09-12 | 阿里巴巴集团控股有限公司 | A kind of method and device of data processing |
| CN105760389A (en) * | 2014-12-17 | 2016-07-13 | 中兴通讯股份有限公司 | Equipment upgrading method and transport network equipment |
| CN104965735B (en) * | 2015-06-18 | 2018-10-19 | 北京京东尚科信息技术有限公司 | Device for generating upgrading SQL scripts |
| CN106325902B (en) * | 2015-06-24 | 2020-09-15 | 中兴通讯股份有限公司 | Database software upgrade detection method and device |
| CN106503019A (en) * | 2015-09-08 | 2017-03-15 | 中兴通讯股份有限公司 | A kind of method and apparatus for obtaining databases comparison information |
| CN106547765B (en) * | 2015-09-18 | 2020-07-17 | 深圳力维智联技术有限公司 | SQ L-based database management method and device |
| CN105373631A (en) * | 2015-12-18 | 2016-03-02 | 河南思维自动化设备股份有限公司 | SQLSever-based automatic upgrading method for database structure |
| CN105677425A (en) * | 2016-01-12 | 2016-06-15 | 四川文轩教育科技有限公司 | Updating method of software system of C/S system structure |
| CN106201591A (en) * | 2016-06-29 | 2016-12-07 | 浪潮(北京)电子信息产业有限公司 | The configuration file upgrade method of a kind of cloud management platform and device |
| CN108228223A (en) * | 2017-10-26 | 2018-06-29 | 山东浪潮云服务信息科技有限公司 | Multi-type database based on domestic CPU environment unifies increment updating method |
| CN108614868B (en) * | 2018-04-16 | 2021-09-17 | 北京酷我科技有限公司 | Automatic database upgrading method |
| CN109388676B (en) * | 2018-08-21 | 2023-11-14 | 中国平安人寿保险股份有限公司 | Data synchronization generation method, device, computer equipment and storage medium |
| CN110865829B (en) * | 2018-08-28 | 2024-04-16 | 京东科技控股股份有限公司 | Database upgrading method, system, equipment and storage medium |
| CN109325046A (en) * | 2018-10-25 | 2019-02-12 | 深圳壹账通智能科技有限公司 | Database script generation method, device, medium and electronic device |
| CN110704398B (en) * | 2019-09-30 | 2023-08-25 | 深圳前海环融联易信息科技服务有限公司 | Database migration method and device from MySQL to Oracle and computer equipment |
| CN110825413A (en) * | 2019-11-04 | 2020-02-21 | 江苏金智教育信息股份有限公司 | Database upgrading method and device and application deployment upgrading method and device |
| CN111078273B (en) * | 2019-12-09 | 2022-08-12 | 京东科技控股股份有限公司 | Information acquisition method and device and storage medium |
| CN111459916B (en) * | 2020-04-16 | 2023-05-23 | 中国银行股份有限公司 | GBASE and ORACLE database table comparison method and system |
| CN112130891B (en) * | 2020-09-23 | 2021-06-29 | 上海逸迅信息科技有限公司 | Method and equipment for continuously deploying database |
| CN113110844A (en) * | 2021-04-14 | 2021-07-13 | 多点(深圳)数字科技有限公司 | Database updating method and system |
| CN113626049B (en) * | 2021-06-28 | 2024-05-28 | 上海市精神卫生中心(上海市心理咨询培训中心) | Program upgrading method and device suitable for hospital LAN environment |
| CN113901025B (en) * | 2021-09-28 | 2025-08-12 | 上海完美时空软件有限公司 | Database management method, device, equipment and storage medium |
| CN114115952A (en) * | 2021-11-30 | 2022-03-01 | 苏州瀚码智能技术有限公司 | Method and device for automatically upgrading packaged low-code application |
| CN114528348A (en) * | 2022-01-29 | 2022-05-24 | 中银金融科技有限公司 | Database table structure synchronization method, device and system based on configuration file |
| CN115470191A (en) * | 2022-08-19 | 2022-12-13 | 望海康信(北京)科技股份公司 | System and method for updating database, corresponding computer equipment and storage medium |
| CN115878658B (en) * | 2022-12-27 | 2026-02-06 | 四川效率源信息安全技术股份有限公司 | Method for importing high-capacity SQL (structured query language) file aiming at relational database |
| CN116614787A (en) * | 2023-05-23 | 2023-08-18 | 浪潮通信信息系统有限公司 | Data acquisition self-adaption method and system |
| CN117971984B (en) * | 2024-03-29 | 2024-06-21 | 天津南大通用数据技术股份有限公司 | Method and system for synchronizing table data between distributed database clusters |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101650663A (en) * | 2009-08-27 | 2010-02-17 | 中兴通讯股份有限公司 | Database system and upgrading method thereof |
| CN101789021A (en) * | 2010-02-24 | 2010-07-28 | 浪潮通信信息系统有限公司 | Universal configurable database data migration method |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7571192B2 (en) * | 2005-06-15 | 2009-08-04 | Oracle International Corporation | Methods and apparatus for maintaining consistency during analysis of large data sets |
| US7610298B2 (en) * | 2006-02-01 | 2009-10-27 | Microsoft Corporation | Difference-based database upgrade |
| CN101499069B (en) * | 2008-02-02 | 2013-06-05 | 中兴通讯股份有限公司 | Internal memory database file updating method and apparatus |
| EP2157517A1 (en) * | 2008-08-19 | 2010-02-24 | Siemens Aktiengesellschaft | A process and a system for updating a data structure in a relational database used within a manufacturing execution system |
-
2010
- 2010-09-16 CN CN2010102873786A patent/CN102402559A/en active Pending
-
2011
- 2011-06-28 WO PCT/CN2011/076526 patent/WO2012034440A1/en not_active Ceased
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101650663A (en) * | 2009-08-27 | 2010-02-17 | 中兴通讯股份有限公司 | Database system and upgrading method thereof |
| CN101789021A (en) * | 2010-02-24 | 2010-07-28 | 浪潮通信信息系统有限公司 | Universal configurable database data migration method |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103810257A (en) * | 2014-01-24 | 2014-05-21 | 华为技术有限公司 | Method and device for upgrading software database and equipment |
| US9513901B2 (en) | 2015-03-31 | 2016-12-06 | International Business Machines Corporation | Deploying incremental scripts |
| US9811332B2 (en) | 2015-03-31 | 2017-11-07 | International Business Machines Corporation | Deploying incremental scripts |
| CN104881455A (en) * | 2015-05-20 | 2015-09-02 | 深圳市酷开网络科技有限公司 | Structural difference processing method and system based on MYSQL |
| CN104881455B (en) * | 2015-05-20 | 2019-01-29 | 深圳市酷开网络科技有限公司 | A kind of architectural difference processing method and system based on MYSQL |
| CN115587575A (en) * | 2022-09-26 | 2023-01-10 | 中国建设银行股份有限公司 | Data table creation method, target data query method, device and equipment |
| CN118227590A (en) * | 2024-03-11 | 2024-06-21 | 山东浪潮科学研究院有限公司 | A database version management method and device in software development process |
Also Published As
| Publication number | Publication date |
|---|---|
| CN102402559A (en) | 2012-04-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2012034440A1 (en) | Method and device for generating database upgrading script | |
| US8065323B2 (en) | Offline validation of data in a database system for foreign key constraints | |
| CN101217406B (en) | Collocation data backup and recovery method | |
| CN111737140A (en) | Interface automated testing method, apparatus, device, and computer-readable storage medium | |
| US8656056B2 (en) | Web-enabled mainframe | |
| CN108762743A (en) | Data table operation code generation method and device | |
| CN104461531B (en) | A kind of implementation method of reporting system SQL | |
| US20060251073A1 (en) | Methods and apparatus for transferring data | |
| CN103268226A (en) | Method and device for generating test script file | |
| CN111459537A (en) | Redundant code removing method, device, equipment and computer readable storage medium | |
| CN111026670B (en) | Test case generation method, test case generation device and storage medium | |
| US8510320B2 (en) | Silent migration of business process binaries | |
| CN111259082B (en) | A method to realize full data synchronization in a big data environment | |
| CN114721681A (en) | Configuration file updating method, device, equipment and storage medium | |
| WO2019161620A1 (en) | Application dependency update method, terminal and device, and storage medium | |
| CN115396152A (en) | A data isolation method and system for a multi-tenant software-as-a-service platform | |
| CN108989074A (en) | Programme upgrade method and program upgrade apparatus | |
| CN101887375B (en) | Method and system for implementing man-machine command system | |
| CN104572145B (en) | File edition management method and system | |
| CN110968569B (en) | Database management method, database management device, and storage medium | |
| CN114089976B (en) | Method, apparatus and medium for generating database operation statements | |
| CN102446164A (en) | Method, device and business system for analyzing report formula | |
| WO2024041358A1 (en) | Configuration file updating method and apparatus, electronic device and readable storage medium | |
| CN116610345A (en) | Application program upgrading method and device based on execution record table | |
| CN102768721B (en) | The method of control White List and device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 11824510 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 11824510 Country of ref document: EP Kind code of ref document: A1 |