CN107357907A - A kind of database upgrade method and device for supporting cross-version - Google Patents

A kind of database upgrade method and device for supporting cross-version Download PDF

Info

Publication number
CN107357907A
CN107357907A CN201710580945.9A CN201710580945A CN107357907A CN 107357907 A CN107357907 A CN 107357907A CN 201710580945 A CN201710580945 A CN 201710580945A CN 107357907 A CN107357907 A CN 107357907A
Authority
CN
China
Prior art keywords
sql files
sql
files
application program
database
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.)
Pending
Application number
CN201710580945.9A
Other languages
Chinese (zh)
Inventor
张德波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710580945.9A priority Critical patent/CN107357907A/en
Publication of CN107357907A publication Critical patent/CN107357907A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Disclosed herein is a kind of database upgrade method and device for supporting cross-version, it is related to program upgrade technique.Wherein, the database upgrade method disclosed herein for supporting cross-version, including:SQL SQL files are established in specified location, the SQL files are used for SQL files corresponding to database upgrade under sequential storage application program different editions, upgrading record sheet is created in the database of application program, for recording the successful SQL files of executed;When application program updating, the SQL files corresponding to database upgrade during this additional application program updating in the SQL files;Start after application program updating, travel through all SQL files in the SQL files, executed successfully all SQL files are inquired from the upgrading record sheet in database, contrast the SQL files being had not carried out;The SQL files having not carried out are read out successively according to sequence and perform operation.

Description

A kind of database upgrade method and device for supporting cross-version
Technical field
The present invention relates to program upgrade technique, and in particular to a kind of database upgrade scheme for supporting cross-version.
Background technology
Program upgrading is the problem of all developers must face, wherein including document upgrading and database upgrade again Deng.For database upgrade, deal with cumbersome, it can directly delete ancient deed unlike document upgrading, addition New file, because already present data need to remain in old database.
There are some more ripe Development Frameworks on the market at present, there is provided very perfect database upgrade scheme, exploitation As long as personnel develop according to rule, it is possible to easily solve the problems, such as database upgrade, but these frameworks are generally large, not It is adapted to applet.A kind of database upgrade scheme of light weight level application is urgently found, was both protected while upgrading Legacy data is stayed, and can supports cross-version upgrading.
The content of the invention
The technical problem to be solved by the invention is to provide a kind of database upgrade method and device for supporting cross-version, The problem of database upgrade of light weight level application can be realized.
In order to solve the above-mentioned technical problem, the invention discloses a kind of database upgrade method for supporting cross-version, including:
SQL SQL files are established in specified location, the SQL files are used for sequential storage application journey SQL files corresponding to database upgrade under sequence different editions, upgrading record sheet is created in the database of application program, for remembering Record the successful SQL files of executed;
When application program updating, the database upgrade pair during this additional application program updating in the SQL files The SQL files answered;
Start after application program updating, all SQL files in the SQL files are traveled through, from the liter in database Executed successfully all SQL files are inquired in level record sheet, contrast the SQL files being had not carried out;
The SQL files having not carried out are read out successively according to sequence and perform operation.
Alternatively, in the above method, SQL texts corresponding to database upgrade under the sequential storage application program different editions Part refers to:The name order of the SQL files for database upgrade and the order one of application version stored in SQL files Cause.
Alternatively, in the above method, the SQL files for database upgrade include number under application program different editions According to the SQL scripts for needing to perform during qurush level.
Alternatively, the above method also includes:
When being read out successively according to sequence to the SQL files having not carried out and performing operation, each SQL files are placed on In one affairs, if performing failure, upgrading is interrupted.
Alternatively, in the above method, the upgrading record sheet, the successful SQL files of all executeds of complete documentation, and it is right All SQL files recorded in the upgrading record sheet do not allow any modification.
There is disclosed herein a kind of database upgrade device for supporting cross-version, including:
First module, SQL SQL files are established in specified location, the SQL files are used for order SQL files corresponding to database upgrade under application program different editions are stored, upgrading note is created in the database of application program Table is recorded, for recording the successful SQL files of executed;
Second unit, in application program updating, data during this additional application program updating in the SQL files SQL files corresponding to qurush level;
Third unit, when starting after application program updating, all SQL files in the SQL files are traveled through, from number According to executed successfully all SQL files are inquired in the upgrading record sheet in storehouse, the SQL files being had not carried out are contrasted;
Unit the 4th, the SQL files having not carried out are read out successively according to sequence and perform operation.
Alternatively, in said apparatus, SQL texts corresponding to database upgrade under the sequential storage application program different editions Part refers to:The name order of the SQL files for database upgrade and the order one of application version stored in SQL files Cause.
Alternatively, in said apparatus, the SQL files for database upgrade include number under application program different editions According to the SQL scripts for needing to perform during qurush level.
Alternatively, in said apparatus, Unit the 4th, the SQL files having not carried out are read successively according to sequence When taking and performing operation, each SQL files are placed in an affairs, if performing failure, interrupt upgrading.
Alternatively, in said apparatus, the upgrading record sheet, the successful SQL files of all executeds of complete documentation, and it is right All SQL files recorded in the upgrading record sheet do not allow any modification.
Technical scheme is particularly suitable for use in the database upgrade of light weight level application, meets and is normally applied program Database upgrade demand, both remained existing customer data, can realize again cross-version upgrade.
Brief description of the drawings
Fig. 1 is the database upgrade method flow diagram that cross-version is supported in the embodiment of the present invention.
Embodiment
For the object, technical solutions and advantages of the present invention are more clearly understood, below in conjunction with accompanying drawing to skill of the present invention Art scheme is described in further detail.It should be noted that in the case where not conflicting, in embodiments herein and embodiment Feature can arbitrarily be mutually combined.
Present inventor proposes that, using script of the sql like language as upgrade database, these sentences are according to version The arrangement of number order (for example, version number is from low to high), what program needed to control is which SQL needs to perform, and which is not required to Perform, so as to realize the upgrading of database.
Based on above-mentioned thought, the present embodiment proposes a kind of database upgrade method for supporting cross-version, mainly includes as follows Operation:
SQL files are established in specified location, the SQL files are used for number under sequential storage application program different editions According to SQL files corresponding to qurush level, upgrading record sheet is created in the database of application program, it is successful for recording executed SQL files;
When application program updating, the database upgrade pair during this additional application program updating in the SQL files The SQL files answered;
Start after application program updating, all SQL files in the SQL files are traveled through, from the liter in database Executed successfully all SQL files are inquired in level record sheet, by operating obtained result set above, filters out and not yet holds Capable SQL files;
The SQL files having not carried out are read out successively according to sequence, and perform SQL scripts therein.
Below, the specific implementation of the database upgrade method of above-mentioned support cross-version is described with reference to the drawings, as shown in figure 1, Including following operating procedure:
Step 100:A file is built, the SQL script files for database upgrade is specially deposited, SQL can be called File.
In the step, the SQL document orders storage in SQL files, i.e., arranged according to version number's order corresponding to SQL files Sequence, for example, SQL files are according to the sequential storage from lowest version to highest version.
Step 200:When needing upgrade application every time, a SQL file is added all in SQL files, is in SQL files This upgrading needs the SQL scripts performed.
Step 300:A table is established in the database of application program, specially records the SQL files to have run succeeded, Upgrading record sheet can be called.
Step 400:During application program launching, there is a link, be responsible for database upgrade specially, that is, travel through SQL files All SQL files in folder;Inquire which SQL file had run succeeded from the upgrading record sheet in database;It is logical The result set for operating obtain above is crossed, filters out the SQL files having not carried out;
Step 500:The SQL files having not carried out are sorted according to filename, are successively read the SQL files having not carried out, Perform the SQL scripts of the inside.
Wherein, the script in each SQL files is placed in an affairs, and the SQL files to run succeeded will be recorded in liter In level record sheet, and do not allow to change its content again.And transaction rollback will be corresponded to by performing failed SQL files, in day Misregistration in will, and escalation process is interrupted at once, in case database structure is chaotic.
Wherein, due to the SQL files having not carried out of reading may have it is multiple, now, if it is equal to perform this this SQL file Success, then it represents that cross-version upgrades.
Illustrate to carry, the upgrading of involved database upgrade, not database program in the application, such as Oracle 10g is upgraded to Oracle 11g, and is due to function of application change, to the table of database, view, index, trigger etc. Increase that object is carried out, modification, deletions etc. operate.
Cross-version involved by the application, the version (such as Oracle 10g, Oracle11g) of database is not necessarily referring to, and Refer to the version of developed application program.
The present embodiment also provides a kind of database upgrade device for supporting cross-version, it is possible to implement above-mentioned database upgrade side Method, mainly including following each unit.
First module, SQL SQL files are established in specified location, the SQL files are used for order SQL files corresponding to database upgrade under application program different editions are stored, upgrading note is created in the database of application program Table is recorded, for recording the successful SQL files of executed;
Wherein, the name order and application version of the SQL files for database upgrade stored in SQL files Sequence consensus.For example, SQL files are according to the sequential storage from lowest version to highest version.
SQL files for database upgrade then include needing what is performed during database upgrade under application program different editions SQL scripts.Specifically, the upgrading of the database upgrade that the present embodiment is related to, not database program, and be due to using journey Sequence function changes, to operations such as the increases, modification, deletion of the progress of the objects such as the table of database, view, index, trigger.
Above-mentioned upgrading record sheet, the successful SQL files of all executeds of complete documentation, and to institute in the upgrading record sheet All SQL files of record do not allow any modification.
Second unit, in application program updating, data during this additional application program updating in the SQL files SQL files corresponding to qurush level;
Third unit, when starting after application program updating, all SQL files in the SQL files are traveled through, from number According to executed successfully all SQL files are inquired in the upgrading record sheet in storehouse, the SQL files being had not carried out are contrasted;
Unit the 4th, the SQL files having not carried out are read out successively according to sequence and perform operation.
Illustrate to carry, when Unit the 4th is read out and performs operation successively to the SQL files having not carried out according to sequence, Each SQL files are placed in an affairs, if performing failure, interrupt upgrading.
Because the present embodiment device can realize the scheme of above-mentioned database upgrade, therefore the other details operation of the present apparatus Reference can be made to the corresponding description of the above method, will not be repeated here.
One of ordinary skill in the art will appreciate that all or part of step in the above method can be instructed by program Related hardware is completed, and described program can be stored in computer-readable recording medium, such as read-only storage, disk or CD Deng.Alternatively, all or part of step of above-described embodiment can also be realized using one or more integrated circuits.Accordingly Ground, each module/unit in above-described embodiment can be realized in the form of hardware, can also use the shape of software function module Formula is realized.The application is not restricted to the combination of the hardware and software of any particular form.
It is described above, it is only the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all this Within the spirit and principle of invention, any modification, equivalent substitution and improvements done etc., the protection model of the present invention should be included in Within enclosing.

Claims (10)

  1. A kind of 1. database upgrade method for supporting cross-version, it is characterised in that including:
    SQL SQL files are established in specified location, the SQL files are used for sequential storage application program not With SQL files corresponding to database upgrade under version, upgrading record sheet is created in the database of application program, for recording The SQL files to run succeeded;
    When application program updating, in the SQL files during this additional application program updating corresponding to database upgrade SQL files;
    Start after application program updating, travel through all SQL files in the SQL files, from the upgrading note in database Executed successfully all SQL files are inquired in record table, contrast the SQL files being had not carried out;
    The SQL files having not carried out are read out successively according to sequence and perform operation.
  2. 2. the method as described in claim 1, it is characterised in that data qurush under the sequential storage application program different editions SQL files corresponding to level refer to:The name order of the SQL files for database upgrade stored in SQL files is with applying journey The sequence consensus of sequence version.
  3. 3. method as claimed in claim 2, it is characterised in that
    Need what is performed when the SQL files for database upgrade include database upgrade under application program different editions SQL scripts.
  4. 4. the method as described in any one of claims 1 to 3, it is characterised in that this method also includes:
    When being read out successively according to sequence to the SQL files having not carried out and performing operation, each SQL files are placed on one In affairs, if performing failure, upgrading is interrupted.
  5. 5. method as claimed in claim 4, it is characterised in that
    The upgrading record sheet, the successful SQL files of all executeds of complete documentation, and to recorded in the upgrading record sheet All SQL files do not allow any modification.
  6. A kind of 6. database upgrade device for supporting cross-version, it is characterised in that including:
    First module, SQL SQL files are established in specified location, the SQL files are used for sequential storage SQL files corresponding to database upgrade under application program different editions, upgrading record sheet is created in the database of application program, For recording the successful SQL files of executed;
    Second unit, in application program updating, data qurush during this additional application program updating in the SQL files SQL files corresponding to level;
    Third unit, when starting after application program updating, all SQL files in the SQL files are traveled through, from database In upgrading record sheet in inquire executed successfully all SQL files, contrast the SQL files being had not carried out;
    Unit the 4th, the SQL files having not carried out are read out successively according to sequence and perform operation.
  7. 7. device as claimed in claim 6, it is characterised in that data qurush under the sequential storage application program different editions SQL files corresponding to level refer to:The name order of the SQL files for database upgrade stored in SQL files is with applying journey The sequence consensus of sequence version.
  8. 8. device as claimed in claim 7, it is characterised in that
    Need what is performed when the SQL files for database upgrade include database upgrade under application program different editions SQL scripts.
  9. 9. the device as described in any one of claim 6 to 8, it is characterised in that
    Unit the 4th, will be each when being read out successively according to sequence to the SQL files having not carried out and performing operation SQL files are placed in an affairs, if performing failure, interrupt upgrading.
  10. 10. device as claimed in claim 9, it is characterised in that
    The upgrading record sheet, the successful SQL files of all executeds of complete documentation, and to recorded in the upgrading record sheet All SQL files do not allow any modification.
CN201710580945.9A 2017-07-17 2017-07-17 A kind of database upgrade method and device for supporting cross-version Pending CN107357907A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710580945.9A CN107357907A (en) 2017-07-17 2017-07-17 A kind of database upgrade method and device for supporting cross-version

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710580945.9A CN107357907A (en) 2017-07-17 2017-07-17 A kind of database upgrade method and device for supporting cross-version

Publications (1)

Publication Number Publication Date
CN107357907A true CN107357907A (en) 2017-11-17

Family

ID=60293117

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710580945.9A Pending CN107357907A (en) 2017-07-17 2017-07-17 A kind of database upgrade method and device for supporting cross-version

Country Status (1)

Country Link
CN (1) CN107357907A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110377583A (en) * 2019-06-17 2019-10-25 平安普惠企业管理有限公司 Database script executes method, apparatus, computer equipment and storage medium
CN111241455A (en) * 2020-01-22 2020-06-05 北京字节跳动网络技术有限公司 Data processing apparatus, computer device, and storage medium
CN112199106A (en) * 2020-10-20 2021-01-08 新华三信息安全技术有限公司 Cross-version upgrading method and device and electronic equipment
CN112925544A (en) * 2021-02-26 2021-06-08 湖南强智科技发展有限公司 Method and device for updating application program, electronic equipment and computer storage medium
CN116610345A (en) * 2023-07-21 2023-08-18 上海柯林布瑞信息技术有限公司 Application program upgrading method and device based on execution record table
CN116700763A (en) * 2023-08-07 2023-09-05 长扬科技(北京)股份有限公司 Version upgrading method and device for Clickhouse database

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1971556A (en) * 2005-11-26 2007-05-30 华为技术有限公司 System and method to realize database upgrading in background management system
CN102339298A (en) * 2010-07-28 2012-02-01 ***通信集团公司 Method, device and system for updating SQL (Structured Query Language) script metadata
CN105700917A (en) * 2016-01-04 2016-06-22 浪潮通用软件有限公司 Method and apparatus for synchronizing DLL and database
CN106445618A (en) * 2016-10-17 2017-02-22 成都知道创宇信息技术有限公司 Automatic database updating method
CN106599167A (en) * 2016-12-09 2017-04-26 郑州云海信息技术有限公司 System and method capable of supporting incremental upgrading of database

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1971556A (en) * 2005-11-26 2007-05-30 华为技术有限公司 System and method to realize database upgrading in background management system
CN102339298A (en) * 2010-07-28 2012-02-01 ***通信集团公司 Method, device and system for updating SQL (Structured Query Language) script metadata
CN105700917A (en) * 2016-01-04 2016-06-22 浪潮通用软件有限公司 Method and apparatus for synchronizing DLL and database
CN106445618A (en) * 2016-10-17 2017-02-22 成都知道创宇信息技术有限公司 Automatic database updating method
CN106599167A (en) * 2016-12-09 2017-04-26 郑州云海信息技术有限公司 System and method capable of supporting incremental upgrading of database

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110377583A (en) * 2019-06-17 2019-10-25 平安普惠企业管理有限公司 Database script executes method, apparatus, computer equipment and storage medium
CN111241455A (en) * 2020-01-22 2020-06-05 北京字节跳动网络技术有限公司 Data processing apparatus, computer device, and storage medium
CN111241455B (en) * 2020-01-22 2023-08-25 抖音视界有限公司 Data processing apparatus, computer device, and storage medium
CN112199106A (en) * 2020-10-20 2021-01-08 新华三信息安全技术有限公司 Cross-version upgrading method and device and electronic equipment
CN112199106B (en) * 2020-10-20 2022-08-26 新华三信息安全技术有限公司 Cross-version upgrading method and device and electronic equipment
CN112925544A (en) * 2021-02-26 2021-06-08 湖南强智科技发展有限公司 Method and device for updating application program, electronic equipment and computer storage medium
CN112925544B (en) * 2021-02-26 2022-12-02 湖南强智科技发展有限公司 Method and device for updating application program, electronic equipment and computer storage medium
CN116610345A (en) * 2023-07-21 2023-08-18 上海柯林布瑞信息技术有限公司 Application program upgrading method and device based on execution record table
CN116610345B (en) * 2023-07-21 2023-10-20 上海柯林布瑞信息技术有限公司 Application program upgrading method and device based on execution record table
CN116700763A (en) * 2023-08-07 2023-09-05 长扬科技(北京)股份有限公司 Version upgrading method and device for Clickhouse database
CN116700763B (en) * 2023-08-07 2023-10-27 长扬科技(北京)股份有限公司 Version upgrading method and device for Clickhouse database

Similar Documents

Publication Publication Date Title
CN107357907A (en) A kind of database upgrade method and device for supporting cross-version
US8010962B2 (en) Infrastructure for the automation of the assembly of schema maintenance scripts
US9361187B2 (en) File system metadata capture and restore
US7774772B2 (en) Method and apparatus to perform an application software migration
US9244953B2 (en) Systems and methods for asynchronous schema changes
US7613738B2 (en) FAT directory structure for use in transaction safe file system
US8078588B2 (en) Recoverable execution
CN101080715B (en) System and method for managing binary large objects
EP2194467A1 (en) Extend CRUD to support lifecycle management and business continuity
CN107122355A (en) Data mover system and method
CN107122360A (en) Data mover system and method
CN107924357B (en) Job managing apparatus and job management method
CN107122361A (en) Data mover system and method
JP4575762B2 (en) Data processing method and apparatus, storage apparatus and processing program therefor
CN105159991B (en) A kind of method, apparatus, system and application server keeping data consistency
US9928259B2 (en) Deleted database record reuse
US11868335B2 (en) Space-efficient change journal for a storage system
CN102054041A (en) Method and system for upgrading metadata
CN109101368A (en) A kind of data processing method and device
CN109271199A (en) A kind of method and system for database continuous integrating and script file management
US8862550B1 (en) Reliable in-place bootstrap metadata transformation in a shared data store
CN111259068A (en) Data development method and system based on data warehouse
CN104239497B (en) The method for cleaning and device of upgrade file
CN105975300A (en) System upgrading method and device
CN109815213A (en) It is deleted on a kind of Append-Only database and the method and system of modification data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20171117