CN112765129A - Method and equipment for realizing database data version management - Google Patents

Method and equipment for realizing database data version management Download PDF

Info

Publication number
CN112765129A
CN112765129A CN202110033173.3A CN202110033173A CN112765129A CN 112765129 A CN112765129 A CN 112765129A CN 202110033173 A CN202110033173 A CN 202110033173A CN 112765129 A CN112765129 A CN 112765129A
Authority
CN
China
Prior art keywords
database
time point
snapshot
data
database data
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
CN202110033173.3A
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.)
Shanghai Suninfo Technology Co ltd
Original Assignee
Shanghai Suninfo 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 Shanghai Suninfo Technology Co ltd filed Critical Shanghai Suninfo Technology Co ltd
Priority to CN202110033173.3A priority Critical patent/CN112765129A/en
Publication of CN112765129A publication Critical patent/CN112765129A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/128Details of file system snapshots on the file-level, e.g. snapshot creation, administration, deletion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (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)

Abstract

The method comprises the steps of firstly determining a time point corresponding to a target database data version and a reference snapshot time point, then obtaining a reference database snapshot corresponding to the reference snapshot time point, then obtaining database data updating information from a database log file based on the time point corresponding to the target database data version and the reference snapshot time point, and finally obtaining the target database data based on the reference database snapshot and the database data updating information so as to realize the database data version management. By the method, the database data can be safely restored to the data version at any previous time point as required, the switching of the database data version between any previous time points can be realized, and the method has very practical value for database data restoration and debugging.

Description

Method and equipment for realizing database data version management
Technical Field
The application relates to the technical field of computer databases, in particular to a technology for realizing database data version management.
Background
A database snapshot is a copy of a version of the data that the database is in at some point in time. After the database snapshot at a certain time point is created, if the database data is modified or deleted due to misoperation on the database at a certain time point after the certain time point, or the database data cannot be used due to non-human factors, the data in the database server can be restored to the data version at the time point based on the database snapshot. Therefore, the influence is reduced to the minimum, and the safety and the use flexibility of the data can be ensured to a certain extent.
At present, the database snapshot is adopted to restore the database data to the database data version of a certain database snapshot time point before the current time point through the rollback of the database snapshot. However, if the database snapshot needs to be rolled back by forcing the database snapshot to roll back when the recovery is performed across multiple database snapshot time points, the database snapshot at the intermediate time point is deleted, and the data of all the snapshot points cannot be retained.
The database snapshot can be established based on the database snapshot to restore the database data to the data version of a certain database snapshot time point, so that the snapshot data is not lost, but a new database needs to be established completely, more storage resources are occupied, and the operation is complicated.
In addition, the existing database snapshot-based database data recovery method can only realize data recovery at the database snapshot time point, and cannot recover the database data to the data version at any previous time point.
Disclosure of Invention
The application aims to provide a method and equipment for realizing database version jumping, which are used for solving the technical problem that the database snapshot-based data version recovery at any time point cannot be realized in the prior art.
According to one aspect of the application, a method for realizing database version jump is provided, wherein the method comprises the following steps:
determining a time point corresponding to a target data version of the database and a reference snapshot time point;
acquiring a reference database snapshot corresponding to the reference snapshot time point;
acquiring database data updating information from a database log file based on the time point corresponding to the target database data version and the reference snapshot time point;
and acquiring database target data based on the reference database snapshot and the database data updating information so as to realize database data version management.
Optionally, wherein the reference snapshot time point includes:
and the database snapshot time point closest to the time point corresponding to the target data version.
Optionally, the obtaining, based on the time point corresponding to the target database data version and the reference snapshot time point, database data update information from a database log file includes:
and screening out the database log files between the reference snapshot time point and the time point corresponding to the target data version based on the time point corresponding to the target data version of the database and the reference snapshot time point.
Optionally, the obtaining database target data based on the reference database snapshot and the database data update information to implement the database data version management includes:
based on the reference database snapshot, restoring the data in the database to the database data at the reference snapshot time point;
and obtaining database target data based on the database data of the reference snapshot time point and the database log file so as to realize the database data version management.
Optionally, the obtaining database target data based on the reference database snapshot and the database data update information to implement the database data version management includes:
based on the reference database snapshot, creating a database data copy corresponding to a reference snapshot time point;
updating preset shared database data into the database data copy to update the shared database data;
and obtaining database target data based on the shared database data and the database log file so as to realize the database data version management.
Optionally, the method for implementing database data version management further includes:
a database snapshot of the current point in time is created.
According to another aspect of the present application, there is also provided an apparatus for implementing database data version management, where the apparatus includes:
the device comprises a first device, a second device and a third device, wherein the first device is used for determining a time point corresponding to a target data version of a database and a reference snapshot time point;
the third device is used for acquiring a reference database snapshot corresponding to the reference snapshot time point;
the fourth device is used for acquiring database data updating information from a database log file based on the time point corresponding to the target database data version and the reference snapshot time point;
and the fifth device is used for acquiring database target data based on the reference database snapshot and the database data updating information so as to realize the database data version management.
Optionally, the apparatus for implementing database version management further includes:
and the second device is used for creating the database snapshot of the current time point.
Compared with the prior art, the method and the device for realizing the management of the database data version firstly determine the time point corresponding to the target database data version of the database and the reference snapshot time point, then obtain the reference database snapshot corresponding to the reference snapshot time point, then obtain the database data updating information from the database log file based on the time point corresponding to the target database data version of the database and the reference snapshot time point, and finally obtain the target database data of the database based on the reference database snapshot and the database data updating information so as to realize the management of the database data version. By the method, the database data can be safely restored to the data version at any previous time point as required, the switching of the database data version between any previous time points can be realized, and the method has very practical value for database data restoration and debugging.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings:
FIG. 1 illustrates a flow diagram of a method for implementing database data version management, in accordance with an aspect of the subject application;
FIG. 2 illustrates a schematic diagram of an apparatus for implementing database data version management, according to another aspect of the subject application;
the same or similar reference numbers in the drawings identify the same or similar elements.
Detailed Description
The present invention is described in further detail below with reference to the attached drawing figures.
In a typical configuration of the present application, each module and trusted party of the system includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
In order to further explain the technical means and effects adopted by the present application, the following description clearly and completely describes the technical solution of the present application with reference to the accompanying drawings and preferred embodiments.
FIG. 1 is a flow diagram illustrating a method for implementing database data version management in one aspect of the present application, wherein the method of one embodiment comprises:
s11, determining a time point corresponding to the target data version of the database and a reference snapshot time point;
s13, acquiring a reference database snapshot corresponding to the reference snapshot time point;
s14, based on the time point corresponding to the target data version of the database and the time point of the reference snapshot, obtaining database data updating information from a database log file;
s15 obtains database target data based on the reference database snapshot and the database data update information, so as to implement version management of the database data.
In the present application, the method is performed by a device 1, the device 1 is a computer device and/or a cloud, the computer device includes but is not limited to a personal computer, a notebook computer, an industrial computer, a network host, a single network server, a plurality of network server sets; the Cloud is made up of a large number of computers or web servers based on Cloud Computing (Cloud Computing), which is a type of distributed Computing, a virtual supercomputer consisting of a collection of loosely coupled computers.
The computer device and/or cloud are merely examples, and other existing or future devices and/or resource sharing platforms, as applicable to the present application, are also intended to be included within the scope of the present application and are hereby incorporated by reference.
In this embodiment, in the step S11, according to the required database target data version, a time point corresponding to the database target data version and a reference snapshot time point of the time are determined.
Optionally, wherein the reference snapshot time point includes:
and the database snapshot time point closest to the time point corresponding to the target data version.
For example, if the time point corresponding to the target data version is T1 before the current time point, and there are multiple database snapshots created before and after T1, where the database snapshot time point closest to T1 is T2, then T2 is the reference snapshot time point of time point T1 corresponding to the target data version.
Continuing in this embodiment, in step S13, device 1 obtains the reference database snapshot corresponding to the reference snapshot time point.
For example, the database snapshot corresponding to the reference snapshot time point T2 is a reference database snapshot.
In this embodiment, in step S14, the device 1 obtains database data update information from the database log file based on the time point corresponding to the target database version and the reference snapshot time point.
Optionally, wherein the step S14 includes:
and screening out the database log files between the reference snapshot time point and the time point corresponding to the target data version based on the time point corresponding to the target data version of the database and the reference snapshot time point.
The device 1 screens out the database log file between the reference snapshot time point and the time point corresponding to the target data version according to the time point corresponding to the target data version of the database and the reference snapshot time point. And the database log file between the screened reference snapshot time point and the time point corresponding to the target data version comprises database data updating information between the database snapshot corresponding to the reference snapshot time point and the target data version.
Continuing in this embodiment, in step S15, the device 1 obtains database target data based on the reference database snapshot and the database data update information, so as to implement the database data version management.
In an application scenario of an embodiment, if the user directly logs in the device 1 to access the database, then,
optionally, wherein the step S15 includes:
based on the reference database snapshot, restoring the data in the database to the database data at the reference snapshot time point;
and obtaining database target data based on the database data of the reference snapshot time point and the database log file so as to realize the database data version management.
The device 1 restores the data in the database to the database data at the reference snapshot time point according to the reference database snapshot; and then, obtaining database target data according to the database data of the reference snapshot time point and the database log file so as to realize the database data version management.
Wherein the database data version of the device 1 is a target data version.
If the database security is considered, the user cannot directly access the source database, but only can access the database data in the preset share. In an application scenario of an embodiment, the device 1 is a CDM server, and based on security considerations, places database data to be accessed by a user from a source database into a preset share of the CDM server through preset share in the CDM server, so as to uniformly manage user access, and provide a database service to the user through the preset share. Further, in order to improve security of the CDM server, the predetermined share of the CDM server is not provided directly to the user, but provided to the target host, and the user can only access the target host, and the target host provides the database service to the user.
Optionally, wherein the step S15 includes:
based on the reference database snapshot, creating a database data copy corresponding to a reference snapshot time point;
updating preset shared database data into the database data copy to update the shared database data;
and obtaining database target data based on the shared database data and the database log file so as to realize the database data version management.
The device 1 creates a database data copy corresponding to a reference snapshot time point according to the reference database snapshot; then updating preset shared database data into the database data copy to update the shared database data; and finally, obtaining database target data according to the shared database data and the database log file so as to realize the database data version management.
Further, the shared database data is updated to target data for use by other clients.
To prepare a version of the database data that may subsequently need to be used up to the current point in time,
optionally, the method for implementing database data version management further includes:
s12 (not shown) creates a database snapshot of the current point in time.
Fig. 2 is a schematic diagram of an apparatus for implementing database data version management according to another aspect of the present application, where the apparatus includes:
a first device 21, configured to determine a time point corresponding to a target data version of a database and a reference snapshot time point;
a third device 23, configured to obtain a reference database snapshot corresponding to the reference snapshot time point;
a fourth device 24, configured to obtain database data update information from a database log file based on a time point corresponding to the database target data version and a reference snapshot time point;
a fifth device 25, configured to obtain database target data based on the reference database snapshot and the database data update information, so as to implement version management of the database data.
In this embodiment, the apparatus is the apparatus 1 described previously.
The first device 21 of the device determines a time point and a reference snapshot time point corresponding to a target database data version, then the third device 23 of the device obtains a reference database snapshot corresponding to the reference snapshot time point, then the fourth device 24 of the device obtains database data update information from a database log file based on the time point and the reference snapshot time point corresponding to the target database data version, and finally the fifth device 25 of the device obtains the target database data based on the reference database snapshot and the database data update information, so as to realize the database data version management.
Optionally, the apparatus for implementing database version management further includes:
a second means 22 (not shown) for creating a database snapshot of the current point in time.
Wherein the second means 22 of the device also creates a database snapshot of the current point in time for subsequent possible use of the database data version up to the current point in time.
According to yet another aspect of the present application, there is also provided a computer readable medium having stored thereon computer readable instructions executable by a processor to implement the foregoing method.
According to another aspect of the present application, there is also provided an apparatus for implementing database data version management, where the apparatus includes:
one or more processors; and
a memory storing computer readable instructions that, when executed, cause the processor to perform operations of the method as previously described.
For example, the computer readable instructions, when executed, cause the one or more processors to: determining a time point corresponding to a target data version of the database and a reference snapshot time point; acquiring a reference database snapshot corresponding to the reference snapshot time point; acquiring database data updating information from a database log file based on the time point corresponding to the target database data version and the reference snapshot time point; and acquiring database target data based on the reference database snapshot and the database data updating information so as to realize database data version management.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.

Claims (10)

1. A method for implementing database data version management, the method comprising:
determining a time point corresponding to a target data version of the database and a reference snapshot time point;
acquiring a reference database snapshot corresponding to the reference snapshot time point;
acquiring database data updating information from a database log file based on the time point corresponding to the target database data version and the reference snapshot time point;
and acquiring database target data based on the reference database snapshot and the database data updating information so as to realize database data version management.
2. The method of claim 1, wherein the reference snapshot time point comprises:
and the database snapshot time point closest to the time point corresponding to the target data version.
3. The method of claim 2, wherein the obtaining database data update information from a database log file based on the time point corresponding to the target database version and a reference snapshot time point comprises:
and screening out the database log files between the reference snapshot time point and the time point corresponding to the target data version based on the time point corresponding to the target data version of the database and the reference snapshot time point.
4. The method of claim 3, wherein obtaining database target data based on the reference database snapshot and the database data update information to implement the database data version management comprises:
based on the reference database snapshot, restoring the data in the database to the database data at the reference snapshot time point;
and obtaining database target data based on the database data of the reference snapshot time point and the database log file so as to realize the database data version management.
5. The method of claim 3, wherein obtaining database target data based on the reference database snapshot and the database data update information to implement the database data version management comprises:
based on the reference database snapshot, creating a database data copy corresponding to a reference snapshot time point;
updating preset shared database data into the database data copy to update the shared database data;
and obtaining database target data based on the shared database data and the database log file so as to realize the database data version management.
6. The method according to any one of claims 1 to 5, further comprising:
a database snapshot of the current point in time is created.
7. An apparatus for implementing database data version management, the apparatus comprising:
the device comprises a first device, a second device and a third device, wherein the first device is used for determining a time point corresponding to a target data version of a database and a reference snapshot time point;
the third device is used for acquiring a reference database snapshot corresponding to the reference snapshot time point;
the fourth device is used for acquiring database data updating information from a database log file based on the time point corresponding to the target database data version and the reference snapshot time point;
and the fifth device is used for acquiring database target data based on the reference database snapshot and the database data updating information so as to realize the database data version management.
8. The apparatus of claim 7, further comprising:
and the second device is used for creating the database snapshot of the current time point.
9. A computer-readable medium comprising, in combination,
stored thereon computer readable instructions to be executed by a processor to implement the method of any one of claims 1 to 6.
10. An apparatus for implementing database data version management, the apparatus comprising:
one or more processors; and
memory storing computer readable instructions that, when executed, cause the processor to perform the operations of the method of any of claims 1 to 6.
CN202110033173.3A 2021-01-11 2021-01-11 Method and equipment for realizing database data version management Pending CN112765129A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110033173.3A CN112765129A (en) 2021-01-11 2021-01-11 Method and equipment for realizing database data version management

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110033173.3A CN112765129A (en) 2021-01-11 2021-01-11 Method and equipment for realizing database data version management

Publications (1)

Publication Number Publication Date
CN112765129A true CN112765129A (en) 2021-05-07

Family

ID=75701502

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110033173.3A Pending CN112765129A (en) 2021-01-11 2021-01-11 Method and equipment for realizing database data version management

Country Status (1)

Country Link
CN (1) CN112765129A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113868273A (en) * 2021-09-23 2021-12-31 北京百度网讯科技有限公司 Metadata snapshot method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108255994A (en) * 2017-12-29 2018-07-06 上海上讯信息技术股份有限公司 A kind of database version management method based on database snapshot
CN109885427A (en) * 2019-01-31 2019-06-14 郑州云海信息技术有限公司 A kind of database short-term data guard method, device, memory and equipment
CN111611108A (en) * 2020-05-21 2020-09-01 云和恩墨(北京)信息技术有限公司 Method and device for restoring virtual database

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108255994A (en) * 2017-12-29 2018-07-06 上海上讯信息技术股份有限公司 A kind of database version management method based on database snapshot
CN109885427A (en) * 2019-01-31 2019-06-14 郑州云海信息技术有限公司 A kind of database short-term data guard method, device, memory and equipment
CN111611108A (en) * 2020-05-21 2020-09-01 云和恩墨(北京)信息技术有限公司 Method and device for restoring virtual database

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
康博创作室: "《Access 2000中文版使用教程》", 宇航出版社 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113868273A (en) * 2021-09-23 2021-12-31 北京百度网讯科技有限公司 Metadata snapshot method and device

Similar Documents

Publication Publication Date Title
US9645892B1 (en) Recording file events in change logs while incrementally backing up file systems
US9063822B2 (en) Efficient application-aware disaster recovery
US10719407B1 (en) Backing up availability group databases configured on multi-node virtual servers
US20210182156A1 (en) System and method for a backup and recovery of application data using containerized backups
CN106357703B (en) Cluster switching method and device
CN113656149A (en) Application processing method and device and related equipment
US9626252B1 (en) Save set indexing outside of backup windows
CN113672350A (en) Application processing method and device and related equipment
US11281543B2 (en) Application-level recovery from an enterprise-level image copy
CN114003439B (en) Data backup method, device, equipment and storage medium
US20180150312A1 (en) Data-persisting temporary virtual machine environments
US9734022B1 (en) Identifying virtual machines and errors for snapshots
CN112765129A (en) Method and equipment for realizing database data version management
US11093290B1 (en) Backup server resource-aware discovery of client application resources
US20210342228A1 (en) Automated Data Restore
US10228879B1 (en) System and method for backup and restore of offline disks in mainframe computers
CN107154960B (en) Method and apparatus for determining service availability information for distributed storage systems
US11675931B2 (en) Creating vendor-neutral data protection operations for vendors' application resources
CN113535477A (en) Method and equipment for data disaster recovery
US20190278747A1 (en) System and method to optimally apply local retention in a remote repository
CN115485677A (en) Secure data replication in a distributed data storage environment
US10884874B1 (en) Federated restore of availability group database replicas
US11520668B2 (en) Vendor-neutral models of vendors' application resources
CN111858487A (en) Data updating method and device
CN116186033A (en) Data archiving method, system, equipment and storage medium

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: 20210507