CN111611108A - Method and device for restoring virtual database - Google Patents

Method and device for restoring virtual database Download PDF

Info

Publication number
CN111611108A
CN111611108A CN202010438953.1A CN202010438953A CN111611108A CN 111611108 A CN111611108 A CN 111611108A CN 202010438953 A CN202010438953 A CN 202010438953A CN 111611108 A CN111611108 A CN 111611108A
Authority
CN
China
Prior art keywords
virtual database
time point
snapshot
database
recovery
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
CN202010438953.1A
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.)
Yunhe Enmo Beijing Information Technology Co ltd
Original Assignee
Yunhe Enmo Beijing 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 Yunhe Enmo Beijing Information Technology Co ltd filed Critical Yunhe Enmo Beijing Information Technology Co ltd
Priority to CN202010438953.1A priority Critical patent/CN111611108A/en
Publication of CN111611108A publication Critical patent/CN111611108A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method and a device for database restoration. Wherein, the method comprises the following steps: receiving a recovery instruction of the virtual database, wherein the recovery instruction carries a recovery time point of the virtual database; determining a snapshot of the virtual database at the target time point according to the recovery time point; acquiring log information between a recovery time point and a target time point; and restoring the virtual database based on the log information and the snapshot. The method and the device solve the technical problems that the recovery process is complicated, time is consumed much, and errors are easy to occur when the database is manually recovered from the backup file.

Description

Method and device for restoring virtual database
Technical Field
The application relates to the field of databases, in particular to a method and a device for restoring a virtual database.
Background
Commercial, open source databases are already in wide variety on the market. Wherein the Database (Oracle Database) is a relational Database management system (Oracle RDBMS), or Oracle for short. The Oracle database system is a popular relational database management system in the world at present, has good system portability, convenient use and strong function, is suitable for various large, medium, small and microcomputer environments, and is a high-efficiency, high-reliability and high-throughput database.
At present, in the daily work of a database Administrator (DBA for short), there are a lot of demands for building a test environment or finding historical Data. The current solution is to manually restore the database from the backup software, and the manual restoration of the database from the backup software has the following problems: (1) the manual operation steps are complicated; (2) misoperation is easy to occur in manual operation; (3) the operation is repeated frequently, and the manual operation consumes a large amount of time.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the application provides a method and a device for restoring a virtual database, and the method and the device are used for at least solving the technical problems that in the prior art, when the database is manually restored from a backup file, the restoration process is complicated, the time consumption is high, and errors are easy to occur.
According to an aspect of the embodiments of the present application, there is provided a method for restoring a virtual database, including: receiving a recovery instruction of the virtual database, wherein the recovery instruction carries a recovery time point of the virtual database; determining a snapshot of the virtual database at the target time point according to the recovery time point; acquiring log information between a recovery time point and a target time point; and restoring the virtual database based on the log information and the snapshot.
Optionally, the target time point includes: a time point closest to the recovery time point is prior to the recovery time point.
Optionally, restoring the virtual database based on the log information and the snapshot includes: determining a snapshot corresponding to a time point closest to the recovery time point; backing up the snapshot; controlling the virtual database to enter a mount state in response to the mount signal; and fusing the log information into the backup snapshot through the virtual database in the mounting state so as to restore the virtual database.
Optionally, before receiving the recovery instruction of the virtual database, the method further includes: performing snapshot operation on the virtual database according to a preset time interval to obtain a plurality of snapshots; or after the previous snapshot, when the memory occupied by the file newly written into the virtual database reaches a preset threshold value, performing snapshot on the database.
Optionally, before receiving the recovery instruction of the virtual database, the method further includes: backing up source data of the virtual database, wherein the backing up comprises the following steps: the method comprises full backup and incremental backup, wherein the full backup is all data of a backup database, and the incremental backup is only data which is newly added after the previous full backup.
Optionally, when performing incremental backup, recording indexes of data corresponding to the incremental backup into the plurality of snapshots, and storing the data of the incremental backup into a specified storage space of the file system.
Optionally, the method further includes: and determining the target storage duration which is greater than a preset threshold value in the storage durations of the plurality of snapshots, and deleting the snapshot corresponding to the target storage duration.
According to another aspect of the embodiments of the present application, there is also provided an apparatus for restoring a virtual database, including: the system comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a recovery instruction of a virtual database, and the recovery instruction carries a recovery time point of the virtual database; the determining unit is used for determining the snapshot of the virtual database at the target time point according to the recovery time point; an acquisition unit that acquires log information between a recovery time point and a target time point; and the recovery unit is used for recovering the virtual database based on the log information and the snapshot.
According to another aspect of the embodiments of the present application, there is also provided a non-volatile storage medium, where the non-volatile storage medium includes a stored program, and when the program runs, a device in which the non-volatile storage medium is located is controlled to perform the above-described method for restoring the virtual database.
According to another aspect of the embodiments of the present application, there is also provided a processor for executing a program stored in a memory, wherein the program executes the method for restoring a virtual database described above.
In the embodiment of the application, a recovery instruction of the virtual database is received, wherein the recovery instruction carries a recovery time point of the virtual database; determining a snapshot of the virtual database at the target time point according to the recovery time point; acquiring log information between a recovery time point and a target time point; according to the method for recovering the virtual database based on the log information and the snapshot, the data of the virtual database at the recovery time point is automatically restored according to the log information between the recovery time point and the target time point and the snapshot of the virtual database at the target time point, so that the technical effects of quickly recovering the database and improving the accuracy of database recovery are achieved, and the technical problems that the recovery process is complicated, the time consumption is high and errors are prone to occurring when the database is manually recovered from a backup file are solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a schematic flow chart diagram illustrating a method for restoring a virtual database according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an alternative virtual database implementation according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an alternative virtual database restoring apparatus according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
In accordance with an embodiment of the present application, there is provided a method embodiment for virtual database restore, where it is noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer-executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
Fig. 1 is a method for restoring a virtual database according to an embodiment of the present application, as shown in fig. 1, the method includes the following steps:
step S102, receiving a recovery instruction of the virtual database, wherein the recovery instruction carries a recovery time point of the virtual database;
step S104, determining a snapshot of the virtual database at the target time point according to the recovery time point;
step S106, acquiring log information between a recovery time point and a target time point;
and step S108, restoring the virtual database based on the log information and the snapshot.
Through the steps, the data of the virtual database at the recovery time point is automatically restored according to the log information between the recovery time point and the target time point and the snapshot of the virtual database at the target time point, so that the technical effects of quickly recovering the database and improving the accuracy of database recovery are achieved, and the technical problems that the recovery process is complicated, the time consumption is high and errors are prone to occurring when the database is manually recovered from the backup file are solved.
The above steps will be described in detail below.
For the above step 104, the target time point includes: a time point closest to the recovery time point is prior to the recovery time point. For example, if it is desired to restore a virtual database of 12:00 at 5/12/2020, the time points corresponding to the existing snapshots are 10:00 at 5/12/2020, 10:30 at 12/5/2020, 11:00 at 12/5/2020, and 11:30 at 12/5/2020, respectively, and since 11:30 at 12/5/2020 is closest to 12:00 at 12/5/2020, the target time point at 12:00 at 12/5/2020 is 11:30 at 12/2020.
For the above step 104, the snapshot is a data copy technology based on a time point, and it is aimed at recording and saving data information at a certain time, and if some failure occurs later and data recovery is required, the data can be recovered to the state of the previous time point through the snapshot.
For the step 108, restoring the virtual database based on the log information and the snapshot may be implemented by: determining a snapshot corresponding to a time point closest to the recovery time point; backing up the snapshot; controlling the virtual database to enter a mount state in response to the mount signal; and fusing the log information into the backup snapshot through the virtual database in the mounting state so as to restore the virtual database. Wherein the log information includes: the System comprises a log thread, a log start time, a log end time, a log start SCN and a log end SCN, wherein a System Change Number (SCN) is a Number automatically maintained by a DBMS to accumulate and increase after an Oracle database is updated, and in Oracle, the SCN is divided into four types, which are respectively: system check point SCN, data file check point SCN, start SCN, end SCN.
Specifically, when the database is restored based on the log information and the snapshot, the snapshot included in the snapshot is read first and stored in the unique snapshot database, and at this time, the virtual database receives the mount signal, and the virtual database is restored to the mount state. The log information is fused into a snapshot database for storing the snapshot by the virtual database in the mounting state, and the virtual database is restored to a certain time point by executing a statement "recovery database negative time" based on the snapshot database.
For example: the virtual database which is 12:00 in 5, month and 12 days in 2020 needs to be restored, the time point corresponding to the snapshot closest to the time is 11:30 in 12 days in 5, month and 2020, and the specific restoration process of the virtual database is as follows: reading the snapshot of 11:30 at 12/5/2020, storing the read snapshot in the unique snapshot database, and after the snapshot is stored in the unique snapshot database, the virtual database receives the mount signal and the virtual database is restored to the mount state. At this time, the mounted virtual database fuses the log information of 11: 30/12/2020/5 into the snapshot database storing the snapshot, and restores the virtual database to 12: 00/12/2020/5 by executing the statement "recovery database based on the snapshot database.
In some embodiments of the present application, before receiving a recovery instruction of a virtual database, there are various methods for performing a snapshot on the virtual database, and a snapshot operation may be performed on the virtual database according to a preset time interval to obtain a plurality of snapshots, where the meaning of performing the snapshot on the virtual database according to the preset time interval is: taking a snapshot of the virtual database at every preset time interval, for example, assuming that the preset time interval of the snapshot is 30 minutes, the file system management unit takes a snapshot of the virtual database at every 30 minutes to obtain a plurality of snapshots; or snapshotting the virtual database according to a preset memory occupied by the files in the database, wherein the preset memory occupied by the files in the database means that: after the previous snapshot, when the memory occupied by the file newly written into the virtual database reaches a preset value, the virtual database is subjected to the snapshot once, for example, if the preset value occupied by the memory is 5G, when the memory occupied by the newly written data reaches 5G, the virtual database is subjected to the snapshot once, and a plurality of snapshots are obtained.
After the plurality of snapshots are obtained according to the method for performing snapshots on the virtual database, in order to save storage space, it is necessary to determine a target storage duration, which is greater than a preset threshold, from among the storage durations of the plurality of snapshots, and delete the snapshot corresponding to the target storage duration. The snapshots of different data need to be kept in different periods, for example, some data snapshots need to be kept in 3 months, some data snapshots need to be kept in 1 month, and then the data snapshots with the retention period of 3 months need to be deleted in real time before the current time is 3 months; and keeping the data snapshot with the period of 1 month, and deleting the data snapshot which is 1 month away from the current moment in real time.
In some embodiments of the present application, before receiving a restore instruction of a virtual database, in order to better save system data and facilitate providing the system data for creating a snapshot, backup of source data of the virtual database is further required, where the backup includes: the method comprises full backup and incremental backup, wherein the full backup is all data of a backup database, and the incremental backup is only data which is newly added after the previous full backup.
Specifically, when performing incremental backup, the indexes of the data corresponding to the incremental backup are recorded in a plurality of snapshots, and the data of the incremental backup is stored in a designated storage space of the file system.
Fig. 2 is a schematic diagram of an implementation scheme of a virtual database, and the restoration process of the virtual database is described in detail below with reference to fig. 2:
the intermediate database management module 20: the Oracle database is composed of a plurality of files, at least comprising the following files: the intermediate database management module automatically backs up a client source production database and then stores files corresponding to the database in a file system for management. These files stored in the file system are defined as a staging database.
The file system management module 22: the file system used by the technical scheme supports the creation of the snapshot. It has the following characteristics: storage pools, copy-on-write, creation of snapshots, data integrity verification, and automatic repair. And the file system management module can create the snapshot aiming at the specific file system according to the snapshot creation instruction. The snapshot creation is a quick operation, is independent of the size of the file system, and can be completed within 1 second, and after the snapshot creation is completed, the whole file system is composed of the current latest state and the past snapshots. The current, up-to-date state of the file system is a readable and writable state, while the snapshot is the state of the file system at some point in time in the past, which is an unreadable, non-writable state. Because the data update is not in-place update, the file system will automatically store the newly written data and the updated data in other designated storage spaces of the file system, so the size of the snapshot is only the difference of the data between the snapshot and the previous snapshot, and is changed according to the snapshot interval and the data, but the size is generally very small.
Because the snapshot is unreadable, unwritable, if the snapshot is to be used, a virtual clone technique is used to clone an independent file system from the snapshot. Because the file system cloned by the virtual cloning technology shares the underlying data with the associated file system, the cloning speed is very high, and the cloning can be completed within 1 second regardless of the size of the file system.
The policy management module 24: the strategy management module is internally provided with strategies of different levels, and the strategies of different levels control the snapshots to have different retention periods. For example, the strategy corresponding to the first type of database may control the snapshot to be preserved for 3 months, so that the snapshot of the first type of database may be preserved for 3 months, and after more than 3 months, the corresponding snapshot may be deleted; the strategy corresponding to the second type of database can control the snapshot to be preserved for 3 months, so that the snapshot of the first type of database can be preserved for 3 months, and after 1 month, the corresponding snapshot can be deleted, namely, the preservation periods of the snapshots of the databases corresponding to different strategies are different. The intermediate database management module 20 controls the historical data retention period of different intermediate databases by using various policies provided by the policy management module BPM.
After the snapshot at the bottom layer of the intermediate database exceeds the retention strategy, the intermediate database management module calls the file system management module to clear the earliest snapshot. By the method, the database is guaranteed to only retain data in a specific period, and meanwhile, the storage space is released.
Virtual database management module 26: the initial storage space of the virtual database is cloned from the file system snapshot of the staging database. This part of the space is readable and writable. No additional space is occupied from the file system snapclone. When the virtual database newly writes data, the newly written data is stored in other designated storage space by the file system. The size of the space consumed by the virtual database is only the newly written part, and most of the space of the virtual database is the original snapshot. When the administrator wants to restore a set of virtual databases, the administrator needs to transmit the restoration time point of the virtual databases, and after the restoration time point is transmitted, the virtual database management module automatically selects the snapshot closest to the restoration time point. For example, if the recovery time point is 15:30:00 at 12.5.2020, the virtual database management module will find a snapshot that is older in snapshot time than 15:30:00 at 12.5.2020 and that is most recent in time difference, e.g., it finds a snapshot timestamp of 15:00:00 at 12.5.2020. After the snapshot is cloned, the virtual database management module automatically starts the database, and applies the logs from the snapshot time point of 2020, 5/12/15: 00:00 to the expected recovery point of the virtual database to the virtual database. When the log is applied, the virtual database is opened, and the state of the virtual database is the state of 15:30:00 in 12 days 5 and 12 months 2020. Since the application log is only half an hour, in general, the virtual database can be opened within 10 minutes. At this point, the virtual database creation is complete.
Example 2
Fig. 3 is a device for restoring a virtual database according to an embodiment of the present application, and as shown in fig. 3, the device includes:
a receiving unit 30, configured to receive a recovery instruction of the virtual database, where the recovery instruction carries a recovery time point of the virtual database;
a determining unit 32, configured to determine a snapshot of the virtual database at the target time point according to the recovery time point;
wherein the target time point includes: a time point closest to the recovery time point is prior to the recovery time point. For example, if it is desired to restore a virtual database of 12:00 at 5/12/2020, the time points corresponding to the existing snapshots are 10:00 at 5/12/2020, 10:30 at 12/5/2020, 11:00 at 12/5/2020, and 11:30 at 12/5/2020, respectively, and since 11:30 at 12/5/2020 is closest to 12:00 at 12/5/2020, the target time point at 12:00 at 12/5/2020 is 11:30 at 12/2020. The snapshot is a data copy technology based on a time point, and aims to record and save data information at a certain moment, and if some faults occur later and data recovery is needed, the data can be recovered to the state of the previous time point through the snapshot.
An acquisition unit 34 that acquires log information between the recovery time point and the target time point;
and a restoring unit 36 for restoring the virtual database based on the log information and the snapshot.
Specifically, the restoring the virtual database based on the log information and the snapshot includes: and determining first data corresponding to the log information in the virtual database and second data corresponding to the snapshot in the virtual database, and determining the virtual database based on the first data and the second data.
In some embodiments of the present application, before receiving a recovery instruction of a virtual database, there are various methods for performing a snapshot on the virtual database, and a snapshot operation may be performed on the virtual database according to a preset time interval to obtain a plurality of snapshots, where the meaning of performing the snapshot on the virtual database according to the preset time interval is: taking a snapshot of the virtual database at every preset time interval, for example, assuming that the preset time interval of the snapshot is 30 minutes, the file system management unit takes a snapshot of the virtual database at every 30 minutes to obtain a plurality of snapshots; or snapshotting the virtual database according to a preset memory occupied by the files in the database, wherein the preset memory occupied by the files in the database means that: after the previous snapshot, when the memory occupied by the file newly written into the virtual database reaches a preset value, the virtual database is subjected to the snapshot once, for example, if the preset value occupied by the memory is 5G, when the memory occupied by the newly written data reaches 5G, the virtual database is subjected to the snapshot once, and a plurality of snapshots are obtained.
After the plurality of snapshots are obtained according to the method for performing snapshots on the virtual database, in order to save storage space, it is necessary to determine a target storage duration, which is greater than a preset threshold, from among the storage durations of the plurality of snapshots, and delete the snapshot corresponding to the target storage duration. The snapshots of different data need to be kept in different periods, for example, some data snapshots need to be kept in 3 months, some data snapshots need to be kept in 1 month, and then the data snapshots with the retention period of 3 months need to be deleted in real time before the current time is 3 months; and keeping the data snapshot with the period of 1 month, and deleting the data snapshot which is 1 month away from the current moment in real time.
In some embodiments of the present application, before receiving a restore instruction of a virtual database, in order to better save system data and facilitate providing system data for creating a snapshot, a backup of a source database of the virtual database is further required, where the backup includes: the method comprises full backup and incremental backup, wherein the full backup is all data of a backup database, and the incremental backup is only data which is newly added after the previous full backup.
Specifically, when performing incremental backup, the indexes of the data corresponding to the incremental backup are recorded in a plurality of snapshots, and the data of the incremental backup is stored in a designated storage space of the file system.
According to another aspect of the embodiments of the present application, there is also provided a non-volatile storage medium, where the non-volatile storage medium includes a stored program, and when the program runs, the apparatus where the storage medium is located is controlled to perform any one of the above methods for restoring a virtual database.
Specifically, the nonvolatile storage medium is used for storing program instructions for executing the following functions, and the following functions are realized:
receiving a recovery instruction of the virtual database, wherein the recovery instruction carries a recovery time point of the virtual database; determining a snapshot of the virtual database at the target time point according to the recovery time point; acquiring log information between a recovery time point and a target time point; and restoring the virtual database based on the log information and the snapshot.
There is also provided, in accordance with yet another aspect of the embodiments of the present application, a processor for executing a program stored in a memory, wherein the program, when executed, performs any one of the methods for virtual database recovery,
specifically, the processor is configured to call a program instruction in the memory, and implement the following functions:
receiving a recovery instruction of the virtual database, wherein the recovery instruction carries a recovery time point of the virtual database; determining a snapshot of the virtual database at the target time point according to the recovery time point; acquiring log information between a recovery time point and a target time point; and restoring the virtual database based on the log information and the snapshot.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method for restoring a virtual database, comprising:
receiving a recovery instruction of a virtual database, wherein the recovery instruction carries a recovery time point of the virtual database;
determining a snapshot of the virtual database at a target time point according to the recovery time point;
acquiring log information between the recovery time point and a target time point;
restoring the virtual database based on the log information and the snapshot.
2. The method of claim 1, wherein the target time point comprises: a time point prior to the recovery time point that is closest to the recovery time point.
3. The method of claim 1, wherein restoring the virtual database based on the log information and the snapshot comprises:
determining a snapshot corresponding to a time point closest to the recovery time point;
backing up the snapshot;
responding to a mounting signal, and controlling the virtual database to enter a mounting state;
and fusing the log information into a backup snapshot through the virtual database in the mounting state so as to restore the virtual database.
4. The method of claim 2, wherein prior to receiving the restore instruction for the virtual database, the method further comprises: performing snapshot operation on the virtual database according to a preset time interval to obtain a plurality of snapshots; or after the previous snapshot, when the memory occupied by the file newly written into the virtual database reaches a preset threshold value, performing snapshot on the database.
5. The method of claim 1, wherein prior to receiving the restore instruction for the virtual database, the method further comprises: backing up a source database of the virtual database, wherein the backing up comprises the following steps: the method comprises full backup and incremental backup, wherein the full backup is all data of a backup database, and the incremental backup is only data which is newly added after the previous full backup.
6. The method according to claim 5, wherein when performing the incremental backup, recording indexes of data corresponding to the incremental backup into a plurality of snapshots, and storing the data of the incremental backup into a designated storage space of a file system.
7. The method of claim 6, further comprising:
and determining the target storage duration which is greater than a preset threshold value in the storage durations of the plurality of snapshots, and deleting the snapshot corresponding to the target storage duration.
8. An apparatus for virtual database restore, comprising:
the system comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a recovery instruction of a virtual database, and the recovery instruction carries a recovery time point of the virtual database;
the determining unit is used for determining the snapshot of the virtual database at the target time point according to the recovery time point;
an acquisition unit that acquires log information between the recovery time point and a target time point;
and the recovery unit is used for recovering the virtual database based on the log information and the snapshot.
9. A non-volatile storage medium, comprising a stored program, wherein when the program runs, a device in which the non-volatile storage medium is located is controlled to perform the method for restoring the virtual database according to any one of claims 1 to 7.
10. A processor configured to execute a program stored in a memory, wherein the program when executed performs the method of virtual database restoration of any one of claims 1 to 7.
CN202010438953.1A 2020-05-21 2020-05-21 Method and device for restoring virtual database Pending CN111611108A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010438953.1A CN111611108A (en) 2020-05-21 2020-05-21 Method and device for restoring virtual database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010438953.1A CN111611108A (en) 2020-05-21 2020-05-21 Method and device for restoring virtual database

Publications (1)

Publication Number Publication Date
CN111611108A true CN111611108A (en) 2020-09-01

Family

ID=72203630

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010438953.1A Pending CN111611108A (en) 2020-05-21 2020-05-21 Method and device for restoring virtual database

Country Status (1)

Country Link
CN (1) CN111611108A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685230A (en) * 2021-01-05 2021-04-20 浪潮云信息技术股份公司 Method for realizing backup and restoration of assigned time point by distributed database
CN112765129A (en) * 2021-01-11 2021-05-07 上海上讯信息技术股份有限公司 Method and equipment for realizing database data version management
CN113672679A (en) * 2021-07-02 2021-11-19 杭州沃趣科技股份有限公司 Method and system for restoring historical table structure
CN115098300A (en) * 2022-06-28 2022-09-23 江苏安超云软件有限公司 Database backup method, disaster recovery method, device and equipment
CN115658239A (en) * 2022-12-23 2023-01-31 安超云软件有限公司 Snapshot management method, system and computer readable medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102239475A (en) * 2008-11-18 2011-11-09 有限公司新人类 Method and apparatus for information recovery using snapshot database
CN103914359A (en) * 2012-12-31 2014-07-09 中国移动通信集团浙江有限公司 Data recovery method and device
CN105446828A (en) * 2014-09-30 2016-03-30 北京金山云网络技术有限公司 Database backup and recovery method, apparatus and system
CN105528368A (en) * 2014-09-30 2016-04-27 北京金山云网络技术有限公司 A database migration method and device
CN105843707A (en) * 2016-03-28 2016-08-10 上海上讯信息技术股份有限公司 Quick recovery method and equipment of database
CN106610876A (en) * 2015-10-23 2017-05-03 中兴通讯股份有限公司 Method and device for recovering data snapshot
CN106708662A (en) * 2016-12-13 2017-05-24 上海上讯信息技术股份有限公司 Method for restoring database and equipment
EP2904501B1 (en) * 2012-10-04 2017-12-06 Delphix Corp. Creating validated database snapshots for provisioning virtual databases
CN110688252A (en) * 2019-08-26 2020-01-14 无锡华云数据技术服务有限公司 Data recovery method, data backup device and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102239475A (en) * 2008-11-18 2011-11-09 有限公司新人类 Method and apparatus for information recovery using snapshot database
EP2904501B1 (en) * 2012-10-04 2017-12-06 Delphix Corp. Creating validated database snapshots for provisioning virtual databases
CN103914359A (en) * 2012-12-31 2014-07-09 中国移动通信集团浙江有限公司 Data recovery method and device
CN105446828A (en) * 2014-09-30 2016-03-30 北京金山云网络技术有限公司 Database backup and recovery method, apparatus and system
CN105528368A (en) * 2014-09-30 2016-04-27 北京金山云网络技术有限公司 A database migration method and device
CN106610876A (en) * 2015-10-23 2017-05-03 中兴通讯股份有限公司 Method and device for recovering data snapshot
CN105843707A (en) * 2016-03-28 2016-08-10 上海上讯信息技术股份有限公司 Quick recovery method and equipment of database
CN106708662A (en) * 2016-12-13 2017-05-24 上海上讯信息技术股份有限公司 Method for restoring database and equipment
CN110688252A (en) * 2019-08-26 2020-01-14 无锡华云数据技术服务有限公司 Data recovery method, data backup device and storage medium

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685230A (en) * 2021-01-05 2021-04-20 浪潮云信息技术股份公司 Method for realizing backup and restoration of assigned time point by distributed database
CN112685230B (en) * 2021-01-05 2022-03-15 浪潮云信息技术股份公司 Method for realizing backup and restoration of assigned time point by distributed database
CN112765129A (en) * 2021-01-11 2021-05-07 上海上讯信息技术股份有限公司 Method and equipment for realizing database data version management
CN113672679A (en) * 2021-07-02 2021-11-19 杭州沃趣科技股份有限公司 Method and system for restoring historical table structure
CN115098300A (en) * 2022-06-28 2022-09-23 江苏安超云软件有限公司 Database backup method, disaster recovery method, device and equipment
CN115098300B (en) * 2022-06-28 2024-01-02 江苏安超云软件有限公司 Database backup method, disaster recovery method, device and equipment
CN115658239A (en) * 2022-12-23 2023-01-31 安超云软件有限公司 Snapshot management method, system and computer readable medium

Similar Documents

Publication Publication Date Title
CN111611108A (en) Method and device for restoring virtual database
US8145603B2 (en) Method and apparatus for data recovery using storage based journaling
CN1331063C (en) On-line data backup method based on data volume snapshot
US7243197B2 (en) Method and apparatus for backup and recovery using storage based journaling
US7398422B2 (en) Method and apparatus for data recovery system using storage based journaling
CN100592251C (en) Storage virtual computer system and management data snapshot image method in storage system
US6665815B1 (en) Physical incremental backup using snapshots
CN101566959B (en) Using volume snapshots to prevent file corruption in failed restore operations
US20050235016A1 (en) Method and apparatus for avoiding journal overflow on backup and recovery system using storage based journaling
EP2382543B1 (en) Granular application data lifecycle sourcing from a single backup
WO2007103141A2 (en) Method and apparatus for providing virtual machine backup
WO2014169142A1 (en) Partition level backup and restore of a massively parallel processing database
CN105320576A (en) Device and method for database backup
CN102096613A (en) Method and device for generating snapshot
CN106326041A (en) Second-level recovery method for database
CN104142943A (en) Database expansion method and database
CN105740098A (en) Determination method and system for stale data among backup data
WO2017067397A1 (en) Data recovery method and device
Cisco Database Administration
CN111221801A (en) Database migration method, system and related device
CN110673985A (en) Method for automatically backing up version library, storage medium and server
CN108415796A (en) A kind of data reconstruction method and terminal device based on terminal device
McGehee et al. SQL Server backup and Restore
CN114442942B (en) Data migration method, system, equipment and storage medium
CN112612648B (en) SQL Server database recovery method, terminal 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: 20200901