CN110083364B - 涉及数据库的系统中模式变更的部署方法 - Google Patents
涉及数据库的系统中模式变更的部署方法 Download PDFInfo
- Publication number
- CN110083364B CN110083364B CN201910066512.0A CN201910066512A CN110083364B CN 110083364 B CN110083364 B CN 110083364B CN 201910066512 A CN201910066512 A CN 201910066512A CN 110083364 B CN110083364 B CN 110083364B
- Authority
- CN
- China
- Prior art keywords
- old
- version
- data
- new version
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 25
- 230000004075 alteration Effects 0.000 claims abstract description 4
- 238000004519 manufacturing process Methods 0.000 claims description 11
- 230000005012 migration Effects 0.000 claims description 9
- 238000013508 migration Methods 0.000 claims description 9
- 238000007726 management method Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013480 data collection Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 238000013468 resource allocation Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
- 238000012384 transportation and delivery Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/211—Schema design and management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/211—Schema design and management
- G06F16/213—Schema design and management with details for schema evolution support
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
- G06F16/2445—Data retrieval commands; View definitions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/25—Integrating or interfacing systems involving database management systems
- G06F16/256—Integrating or interfacing systems involving database management systems in federated or virtual databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
Abstract
一种方法以及对应的系统,用于在计算机系统,特别是在工业计算机系统中布署变更,所述系统包括数据库(11)以及要更新的系统的旧版本(13’),所述方法包括:提供系统的新版本(13);提供合并视图(16),其能够从所述数据库读取数据并将所述数据布置到所述新版本;其中,所述数据库包含旧版本可读的至少一个旧表(12’)并且所述合并视图能够从所述旧表读取数据并将它们布置到新版本。
Description
技术领域
本发明涉及在计算机系统中部署变更的方法,特别是涉及数据库结构的修改的变更。
背景技术
有趣但非限定性的,本发明可以应用到的工业软件的实例是制造执行系统(MES)和制造运行管理(MOM)。最近,术语MOM被越来越多地用于代替术语MES。这些系统通常可以包括用作组件的软件或者充当具有上面解释的意义的组件。
正如制造企业解决方案协会(MESA国际)定义的,MES/MOM系统是通过管理“从订单投放制造的点到产品交付成成品的点的生产运行”,以及通过提供“关于生产活动的任务关键信息通过双向通信给贯穿组织和供应链的其他人”来“驱动制造运营有效执行的动态信息系统”。
为了提高制造工厂的质量和处理性能,MES/MOM系统通常包括的功能是资源分配和状态、派发生产订单、数据收集/获取、质量管理、维护管理、性能分析、操作/明细调度、文档控制、劳动管理、过程管理以及产品跟踪等。
例如,西门子公司在其IT产品家族下提供了广泛的MES/MOM产品。
无论如何,如前所述,MES/MOM系统只是本发明应用于的工业软件的一个示例,本发明适用于依赖专用数据库的任何种类的应用程序包。
参照图1,当根据REST(REpresentational State Transfer表现层状态转移)指南设计系统时(这特别意味着关于系统的状态的全部信息存储在数据库中),可以通过在专用新机器或机器集5(也可以仅仅是虚拟机)上提供新的应用程序2、平台3以及/或者操作系统4简单地部署对应用程序、甚至操作系统的全部变更,其中不涉及对数据库1的修改。只要创建了变更,负载均衡器6能够立即引导从用户到新机器集的任何请求。
如果新机器有问题,可以简单地切换回旧机器5’的操作,该操作被称为回滚。
因此能够被执行的可能的变更是操作系统(OS)补丁或者甚至主要更新、对外部或内部平台的更新以及对诸如用户界面(UI)和业务逻辑的应用程序的更新。
然而,如今,持续开发、甚至建模的迭代方案的需求意味着对内部数据库模式的变更是经常需要的。
通过简单地对数据库模式应用变更,会失去与旧业务逻辑的兼容性以及安全回滚的机会。而且,数据库能够包括数百万的数据,这些数据可能被涉及并且必须从旧表迁移至新表。由于在这一操作期间应用程序不能访问数据库,这将导致不可接受地延长的宕机时间(甚至很多个小时)。
为了保持回滚的可能性,只有与旧业务逻辑兼容的数据库模式的变更可以被执行,并且必须相应地写入新业务逻辑,因此,许多可能的变更被排除,例如,重命名或删除列,或者变更数据类型,使得敏捷型重构实际上不可能。这些限制没有避免仅仅为了保持兼容性而编写非常复杂的代码的必要性。
另一方面,在放弃回滚的可能性的情况下,依赖于问题的快速修复是有风险的,并且是不能接受的。
发明内容
通过在计算机系统,特别是在工业计算机系统中部署变更的方法,上述问题现在已经得到解决,所述系统包括数据库以及要更新的系统的旧版本,所述方法包括:
提供系统的新版本;
提供合并视图,其能够从所述数据库读取数据并将所述数据布置到所述新版本;
其中,所述数据库包含旧版本可读的旧表中的数据,并且所述合并视图能够读取所述旧表并将数据布置到新版本。
根据本发明的一个优选实施方式,方法包括由新版本和旧版本两者在数据库中写入数据,其中旧版本继续写入旧表,而新版本写入新版本可读的新表。
因此,使新版本能够就像数据库中的数据全部在新表中那样进行操作,新版本通过合并视图能够看到只在旧表中出现的、在新版本的部署之前已输入的数据,旧版本能够读取旧表并且仍然能够完全操作。
术语“表”与诸如模式和记录的其它术语一样,目的是作为关系数据库的通用语言。
优选地,方法进一步包括从与旧版本兼容的旧表到与新版本兼容的新表的数据的迁移。
本发明进一步涉及包括旧版本和新版本的计算机系统、至少包括旧版本可读的至少一个旧表中的数据的数据库、能够从所述数据库读取旧表中的数据并将所述数据布置到所述新版本的合并视图。
优选地,合并视图也能够从新版本可读的至少一个新表中读取数据。
“系统版本”是指能够执行系统的功能的一系列应用程序、平台以及操作系统。优选地,旧版本和新版本能够在不同的机器上运行(这也意味着在相同的物理机器上运行不同的虚拟机),以便能够独立运行。
附图说明
现在将借助附图更好地说明本发明:
如上所述,图1示出了根据现有技术的方法的示意性流程图,其中预知对数据库没有变更;
图2示出了根据本发明的方法的示意性流程图;
图3示意性地示出了根据数据库的旧版本和新版本的表的结构。
具体实施方式
参照图2,系统包括数据库11,其包括新表12以及包含数据的旧表12’。系统包括旧系统版本13’以及新系统版本13。
旧版本能够写入14’和读取15’旧表12’。类似地,新版本能够写入14和读取15新表12。然而,根据该方法,合并视图16从旧版本17’和新版本17读取数据,并且能够将它们布置到新版本13,使得后者能够读取15这些数据,就像它们来自与新版本兼容的表一样,即使一些数据因为只在与旧版本兼容的表中可用只能由合并视图16检索到,或者,如果新版本需要其它种类的数据,例如它们可以作为固定值或空字符串被插入,直到它们被更新。
命令多路复用器18可以根据操作请求操作两个版本写入数据库,使得旧表总是最新的,并且旧版本可以在不考虑新版本的操作的情况下操作。后者通过合并视图进行操作。
因为全部数据在旧表中可用,所以通过停用新版本和合并视图,以及在必要时删除新表,可以容易地执行回滚。
旧表仅被旧版本修改,因此,不存在它们被新版本破坏的风险。回滚是立即的并且没有数据丢失。
优选地,方法进一步包括通过适当的程序进行的从旧表到新表的数据的迁移19。这可以通过复制数据或者根据旧表计算它们并将它们写入新表而进行。优选地,一旦数据被迁移(或者,例如与项目相关的所有数据),就对其进行标记,使得合并视图不再从旧表中检索它。这可以例如通过在旧表中添加旧版本不可读但是只有合并视图可读的列来进行,所述列包含状态信息。
由于两个版本在任何时候是有效的,因此依赖于旧表或新表,可以小步骤执行迁移操作,由此一次只迁移预定数量的数据。这些步骤与系统的正常运行交替进行,系统的正常运行的确变慢,但并不一定经历对用户不可用的宕机时间。于是,可以根据逻辑对迁移步骤进行编程,该逻辑能够使缺陷最小化并且在系统可用性和更新速度之间允许适当的折衷(只有在迁移完成之后才能进行进一步变更)。一旦完成迁移操作并且发现新版本是可靠的,则旧版本可以被摒弃,旧表可以被删除。
参照图3,数据库可以包含未变更的表30、31,其模式没有变更,但是可以与其它新表32或旧表32’有关。它们可以被两个版本以及合并视图读取。
优选的是,相同的记录(与一系列数据关联)在两个表中保持相同的ID(标识)。否则,如果数据库结构不允许这样做,例如,可以提供合并视图可读取的另一个表作为交叉引用,以允许交叉引用。
参考符号表:
1 数据库
2 应用程序
3 平台
4 操作系统
5 新机器
5’ 旧机器
6 负载均衡器
11 数据库
12 新表
12’ 旧表
13 新系统版本
13’ 旧系统版本
14,14’ 写入操作
15,15’,17,17’ 读取操作
18 命令多路复用器
19 迁移操作
30,31 未变更的表
32 新表
32’ 旧表
Claims (11)
1.一种在计算机系统中布署变更的方法,所述系统包括数据库(11)以及要更新的系统的旧版本(13’),所述方法包括:
提供所述系统的新版本(13);
提供合并视图(16),其能够从所述数据库读取数据并将所述数据布置到所述新版本;
提供命令多路复用器,其能够根据操作请求操作所述旧版本和所述新版本写入所述数据库;
其中,所述数据库包含所述旧版本可读的旧表(12’),并且所述合并视图能够从所述旧表读取数据并将它们布置到所述新版本;
所述命令多路复用器能够操作所述旧版本使得所述旧表总是最新的;
所述命令多路复用器通过所述合并视图操作所述新版本;并且
所述合并视图被配置成:从所述旧表中读取所述数据中的第一格式的第一数据,并且将所述第一数据以所述新版本可读的与所述第一格式不同的第二格式布置到所述新版本,就像从所述旧表读取的所述第一数据是来自与所述新版本兼容的表一样。
2.根据权利要求1所述的方法,其中所述数据库包括所述新版本可读的至少一个新表(12)。
3.根据权利要求2所述的方法,其中所述合并视图能够从所述新表中读取数据并将它们布置到所述新版本。
4.根据前述权利要求的任一项所述的方法,其中所述系统是制造执行系统或者制造运营管理应用。
5.根据前述权利要求4所述的方法,包括由所述新版本和所述旧版本两者在所述数据库中写入数据。
6.根据前述权利要求4所述的方法,包括从旧表到新表的数据的迁移操作(19)。
7.根据权利要求6所述的方法,其中按预定数量迁移数据,并且所述迁移与所述系统的正常运行交替进行。
8.根据权利要求6或7所述的方法,其中对迁移的数据进行标记,使得所述合并视图不再从与所述旧版本兼容的表中读取它们。
9.根据权利要求1所述的方法,其中,所述计算机系统为工业计算机系统。
10.一种计算机系统,包括旧版本(13’),新版本(13),至少包括所述旧版本可读取的旧表(12’)中的数据的数据库,能够从所述旧表中读取数据并将所述数据布置到所述新版本的合并视图(16),以及能够根据操作请求操作所述旧版本和所述新版本写入所述数据库的命令多路复用器;
其中,所述合并视图能够从所述旧表读取数据并将它们布置到所述新版本;
所述命令多路复用器能够操作所述旧版本使得所述旧表总是最新的;
所述命令多路复用器通过所述合并视图操作所述新版本;并且
所述合并视图被配置成:从所述旧表中读取所述数据中的第一格式的第一数据,并且将所述第一数据以所述新版本可读的与所述第一格式不同的第二格式布置到所述新版本,就像从所述旧表读取的所述第一数据是来自与所述新版本兼容的表一样。
11.一种计算机系统,其能够执行根据权利要求1至9的任一项所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP18153436.3 | 2018-01-25 | ||
EP18153436.3A EP3518125A1 (en) | 2018-01-25 | 2018-01-25 | Method for the deployment of schema changes in systems involving a database |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110083364A CN110083364A (zh) | 2019-08-02 |
CN110083364B true CN110083364B (zh) | 2024-03-08 |
Family
ID=61131976
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910066512.0A Active CN110083364B (zh) | 2018-01-25 | 2019-01-24 | 涉及数据库的系统中模式变更的部署方法 |
Country Status (3)
Country | Link |
---|---|
US (1) | US11468021B2 (zh) |
EP (1) | EP3518125A1 (zh) |
CN (1) | CN110083364B (zh) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11636086B1 (en) * | 2021-03-29 | 2023-04-25 | Tonic AI, Inc. | Multi-database subsetting |
US11809386B2 (en) * | 2021-08-30 | 2023-11-07 | Salesforce, Inc. | Schema change operations |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090259999A1 (en) * | 2008-04-11 | 2009-10-15 | Oracle International Corporation | Method and system for applying a patch during application execution |
CN103729204A (zh) * | 2012-10-16 | 2014-04-16 | 阿里巴巴集团控股有限公司 | 一种网络平台中应用更新的数据在线迁移方法和装置 |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6640291B2 (en) * | 2001-08-10 | 2003-10-28 | Hitachi, Ltd. | Apparatus and method for online data migration with remote copy |
US9537731B2 (en) * | 2004-07-07 | 2017-01-03 | Sciencelogic, Inc. | Management techniques for non-traditional network and information system topologies |
CN102741817B (zh) * | 2009-09-04 | 2015-12-16 | 英特尔公司 | 方法和装置和记录载体 |
US10120886B2 (en) * | 2015-07-14 | 2018-11-06 | Sap Se | Database integration of originally decoupled components |
US10942792B2 (en) * | 2015-10-15 | 2021-03-09 | Push Technology Limited | Event driven subscription matching |
US10366338B2 (en) * | 2016-02-24 | 2019-07-30 | Bank Of America Corporation | Computerized system for evaluating the impact of technology change incidents |
US10621167B2 (en) * | 2017-10-26 | 2020-04-14 | Sap Se | Data separation and write redirection in multi-tenancy database systems |
-
2018
- 2018-01-25 EP EP18153436.3A patent/EP3518125A1/en not_active Ceased
-
2019
- 2019-01-24 CN CN201910066512.0A patent/CN110083364B/zh active Active
- 2019-01-25 US US16/257,405 patent/US11468021B2/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090259999A1 (en) * | 2008-04-11 | 2009-10-15 | Oracle International Corporation | Method and system for applying a patch during application execution |
CN103729204A (zh) * | 2012-10-16 | 2014-04-16 | 阿里巴巴集团控股有限公司 | 一种网络平台中应用更新的数据在线迁移方法和装置 |
Non-Patent Citations (1)
Title |
---|
Zero-Downtime SQL Database Schema Evolution for Continuous Deployment;Michael de Jong;《 2017 IEEE/ACM 39th International Conference on Software Engineering: Software Engineering in Practice Track (ICSE-SEIP)》;20170803;第143-152页 * |
Also Published As
Publication number | Publication date |
---|---|
US11468021B2 (en) | 2022-10-11 |
CN110083364A (zh) | 2019-08-02 |
US20190227997A1 (en) | 2019-07-25 |
EP3518125A1 (en) | 2019-07-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8832159B2 (en) | Systems and methods for asynchronous schema changes | |
CN101661508B (zh) | 一种应用于多技术平台的生成表单的方法及装置 | |
CA1316262C (en) | Version management tool | |
US9886245B2 (en) | Software development tool using a workflow pattern that describes software applications | |
US20160154910A1 (en) | Common plant model for modeling of physical plant items of a production plant | |
US20160154913A1 (en) | Common plant model for modeling physical plant items of a production plant | |
US20120210298A1 (en) | Locating changes in source code | |
JPH04289920A (ja) | 技術変更により影響を受けるバージョン化データオブジェクトの制御を実行する方法 | |
WO2006089092A2 (en) | Hierarchal data management | |
EP2610762A1 (en) | Database version management system | |
EP3026608A1 (en) | A common plant model for modelling of physical plant items of a production plant | |
US20160154912A1 (en) | Common plant model for modeling of physical plant items of a production plant | |
CN110083364B (zh) | 涉及数据库的系统中模式变更的部署方法 | |
EP2388697B1 (en) | System and method for managing conflicts between business functions configurations | |
CN103946794A (zh) | 数据特征的滚动升级的系统和方法 | |
US20230098227A1 (en) | Change control and version management of data | |
CN106886539B (zh) | 数据归档系统及方法 | |
US9348882B2 (en) | Method, system, and computer readable medium for long term archiving of data in a MES system | |
WO2009002901A2 (en) | Object model based mapping | |
WO2009002805A2 (en) | Providing mapping fault processing | |
CN111078666B (zh) | 基于跨中心多数据库的自动化卸数供数的方法 | |
JP2023169803A (ja) | 計算機システム、プログラム実行方法、及びプログラム | |
JP2003208346A (ja) | データベース更新情報の反映システムおよびそのためのプログラム | |
CN117608536A (zh) | 缺口数据在线模版定制补录系统及其方法 | |
Stross | Operation of a disc data base |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |