CN114840361B - Method for accelerating database recovery and application - Google Patents

Method for accelerating database recovery and application Download PDF

Info

Publication number
CN114840361B
CN114840361B CN202210385670.4A CN202210385670A CN114840361B CN 114840361 B CN114840361 B CN 114840361B CN 202210385670 A CN202210385670 A CN 202210385670A CN 114840361 B CN114840361 B CN 114840361B
Authority
CN
China
Prior art keywords
database
backup
file
recovery
original format
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210385670.4A
Other languages
Chinese (zh)
Other versions
CN114840361A (en
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.)
Jiangsu Anchao Cloud Software Co Ltd
Original Assignee
Jiangsu Anchao Cloud Software 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 Jiangsu Anchao Cloud Software Co Ltd filed Critical Jiangsu Anchao Cloud Software Co Ltd
Priority to CN202210385670.4A priority Critical patent/CN114840361B/en
Publication of CN114840361A publication Critical patent/CN114840361A/en
Application granted granted Critical
Publication of CN114840361B publication Critical patent/CN114840361B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F11/1451Management of the data involved in backup or backup restore by selection of backup contents
    • 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/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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 invention discloses a method for accelerating database recovery and application thereof, wherein the method comprises the following steps: when the dream database is backed up: initializing database files, and respectively executing full-volume backup and incremental backup to generate a compressed backup set and backup metadata files; restoring the backup set and the backup metadata file to the initialization database file to generate a non-uniform database file in the original format; restoring the original format non-uniform database file into an original format database file with data uniformity through REDO logs in the backup set; upon the dream database recovery: updating the database magic number, and copying the original format database file to a recovery directory to recover the database. The method can ensure that the original format file ensuring the consistency of the data is obtained after each backup is completed by planning the partial recovery step of the database in the backup flow, and the recovery time of the database is shortened only by directly pulling up the database according to the original format file during recovery.

Description

Method for accelerating database recovery and application
Technical Field
The present invention relates to the field of databases, and more particularly, to a method for accelerating database recovery and an application thereof.
Background
In large and medium-sized domestic enterprises, the database with large volume is often required to recover the data of TB level or PB level, which means that the service system is in an unavailable state from the database failure to the recovery of production within a period of several hours, and the maximum time required for recovering the whole system from the disaster to the normal reaches the hour level. Even with backup, several hours are required to recover from the production incident each time, during which the economic loss due to service interruption is significant. Whereas, a longer backup time is often relatively acceptable to an enterprise compared to the hours that it takes to restore, because most enterprise planning production environments have backup times that are at night, during low business peaks.
The information disclosed in this background section is only for enhancement of understanding of the general background of the invention and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art already known to a person of ordinary skill in the art.
Disclosure of Invention
The invention aims to provide a method for accelerating database recovery and application thereof, which solve the problem that a plurality of recovery steps are needed to be carried out during the recovery of a database, and if multiple incremental backups are involved, the database needs to be recovered one by one backup set in turn during the recovery.
To achieve the above object, an embodiment of the present invention provides a method for accelerating database recovery.
In one or more embodiments of the invention, the method comprises: when the database is backed up: initializing database files, and respectively executing full-volume backup and incremental backup to generate a compressed backup set and backup metadata files; restoring the backup set and the backup metadata file into the initialization database file to generate a non-uniform database file in the original format; upon database recovery: restoring the original format non-uniform database file into an original format database file with data uniformity through REDO logs in the backup set; and updating the database magic number, and copying the original format database file to a recovery directory to recover the database.
In one or more embodiments of the present invention, restoring the backup set and the backup metadata file into the initialization database file to generate a native format non-uniform database file includes: analyzing the backup set to obtain corresponding description information; and restoring the backup set and the backup metadata file according to the description information to generate the original format non-uniform database file.
In one or more embodiments of the present invention, recovering the original format non-uniform database file into an original format database file having data uniformity through a REDO log in the backup set includes: acquiring a target archive log file directory in the initialization database file; searching whether the REDO log exists in the target archive log file directory; if yes, the original format non-consistency database file is restored to the original format database file with data consistency.
To achieve the above object, an embodiment of the present invention provides a method for accelerating database recovery.
In one or more embodiments of the invention, the method comprises: when the database is backed up: initializing database files, and respectively executing full-volume backup and incremental backup to generate a compressed backup set and backup metadata files; restoring the backup set and the backup metadata file to the initialization database file to generate a non-uniform database file in the original format; and recovering the original format non-uniform database file into an original format database file with data uniformity through REDO logs in the backup set; upon database recovery: updating the database magic number, and copying the original format database file to a recovery directory to recover the database.
In one or more embodiments of the present invention, restoring the backup set and the backup metadata file into the initialization database file to generate a native format non-uniform database file includes: analyzing the backup set to obtain corresponding description information; and restoring the backup set and the backup metadata file according to the description information to generate the original format non-uniform database file.
In one or more embodiments of the present invention, recovering the original format non-uniform database file into an original format database file having data uniformity through a REDO log in the backup set includes: acquiring a target archive log file directory in the initialization database file; searching whether the REDO log exists in the target archive log file directory; if yes, the original format non-consistency database file is restored to the original format database file with data consistency.
In another aspect of the present invention, an apparatus for expediting database recovery and restoration is provided that includes a backup module and a restoration module.
The backup module is used for, when the database is backed up: initializing database files, and respectively executing full-volume backup and incremental backup to generate a compressed backup set and backup metadata files; and restoring the backup set and the backup metadata file to the initialization database file to generate a primary format non-uniform database file.
A recovery module, configured to, when the database is recovered: restoring the original format non-uniform database file into an original format database file with data uniformity through REDO logs in the backup set; and updating the database magic number, and copying the original format database file to a recovery directory to recover the database.
In one or more embodiments of the present invention, the backup module is further configured to: analyzing the backup set to obtain corresponding description information; and restoring the backup set and the backup metadata file according to the description information to generate the original format non-uniform database file.
In one or more embodiments of the invention, the recovery module is further configured to: acquiring a target archive log file directory in the initialization database file; searching whether the REDO log exists in the target archive log file directory; if yes, the original format non-consistency database file is restored to the original format database file with data consistency.
In another aspect of the present invention, there is provided yet another apparatus for expediting database recovery and restoration, comprising a backup module and a restoration module.
The backup module is used for, when the database is backed up: initializing database files, and respectively executing full-volume backup and incremental backup to generate a compressed backup set and backup metadata files; restoring the backup set and the backup metadata file to the initialization database file to generate a non-uniform database file in the original format; and restoring the original format non-uniform database file into an original format database file with data uniformity through REDO logs in the backup set.
A recovery module, configured to, when the database is recovered: updating the database magic number, and copying the original format database file to a recovery directory to recover the database.
In one or more embodiments of the present invention, the backup module is further configured to: analyzing the backup set to obtain corresponding description information; and restoring the backup set and the backup metadata file according to the description information to generate the original format non-uniform database file.
In one or more embodiments of the present invention, the backup module is further configured to: acquiring a target archive log file directory in the initialization database file; searching whether the REDO log exists in the target archive log file directory; if yes, the original format non-consistency database file is restored to the original format database file with data consistency.
In another aspect of the present invention, there is provided an electronic device including: at least one processor; and a memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the method of expediting database recovery and restoration as described above.
In another aspect of the invention, a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of a method of expediting database recovery and restoration as described.
Compared with the prior art, according to the method for accelerating database recovery and the application of the method, partial recovery steps of the database can be planned in a backup process, so that the backup set and the backup metadata file which are not compressed after each backup are obtained, but the original format file which ensures the data consistency is obtained, when a recovery task is initiated, only the original format file which designates the data consistency is required to directly pull up the database service, the minute-level recovery production availability can be realized, the RTO is shortened to the minute level, and the economic loss of enterprises is greatly reduced.
Drawings
FIG. 1 is a first flow diagram of a method of expediting database recovery and restoration according to an embodiment of the invention;
FIG. 2 is a second flowchart of a method of expediting database recovery and restoration according to an embodiment of the invention;
FIG. 3 is a full back-up restore schematic of a method of expediting database restoration and restoration according to an embodiment of the invention;
FIG. 4 is an incremental backup restoration schematic of a method of expediting database restoration and restoration according to an embodiment of the invention;
FIG. 5 is a block diagram of an apparatus for expediting database recovery and restoration according to an embodiment of the invention;
FIG. 6 is a hardware block diagram of a computing device that expedites database recovery and restoration according to an embodiment of the invention.
Detailed Description
The following detailed description of embodiments of the invention is, therefore, to be taken in conjunction with the accompanying drawings, and it is to be understood that the scope of the invention is not limited to the specific embodiments.
Throughout the specification and claims, unless explicitly stated otherwise, the term "comprise" or variations thereof such as "comprises" or "comprising", etc. will be understood to include the stated element or component without excluding other elements or components.
The following describes in detail the technical solutions provided by the embodiments of the present invention with reference to the accompanying drawings.
Example 1
As shown in fig. 1 to 2, a method of accelerating database recovery in one embodiment of the present invention is described, the method comprising the following steps.
In step S101, at the time of database backup: initializing database files, and respectively executing full-volume backup and incremental backup to generate a compressed backup set and backup metadata files.
Backup catalog planning: the dmdata is used for initializing a database, full is used for storing full-volume backups, and inc is used for storing incremental backups.
[dmdba@meijia-dm-2~]$ll/opt/dmbak/
total 0
drwxr-xr-x 2dmdba dinstall 6Mar 416:57dmdata
drwxr-xr-x 2dmdba dinstall 57Mar 416:05full
drwxr-xr-x 2dmdba dinstall 54Mar 416:08inc
And initializing a database file for subsequent recovery.
[dmdba@meijia-dm-2~]$dminit PATH=/opt/dmbak/dmdata INSTANCE_NAME=DMREST DB_NAME=DBREST
Initdb V8
Db version:0x7000c
File dm.key not gound,use default license!
License will expire on 2022-07-09
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
Log file path:/opt/dmbak/dmdata/DBREST/DBREST01.log
Log file path:/opt/dmbak/dmdata/DBREST/DBREST02.log
Write to dir[/opt/dmbak/dmdata/DBREST].
Creat dm database success.2022-03-0416:57:59
And respectively executing full backup and incremental backup to generate a compressed backup set and backup metadata files.
Full back-up:
[root@meijia-dm-2opt]#disql SYSDBA/SYSDBA@127.0.0.1:5236
server [127.0.0.1:5236]Is in a normal open state
Logging the service time: 4.054 (ms)
DisqlV8
SQL>BACKUP DATABASE FULL BACKUPSET’/opt/dmbak/full’;
The operation has been performed
The elapsed time: 00:00:26.736. execution number: 61300.
SQL>
incremental backup:
[root@meijia-dm-2opt]#disql SYSDBA/SYSDBA@127.0.0.1:5236
server [127.0.0.1:5236]Is in a normal open state
Logging the service time: 3.508 (ms)
DisqlV8
SQL>BACKUP DATABASE INCREMENT BACKUPSET’/opt/dmbak/inc’;
The operation has been performed
The elapsed time: 00:00:10.035. execution number: 61100.
SQL>
in step S102, the backup set and backup metadata file are restored to the initializing database file to generate the original format non-uniform database file.
Specifically, the backup set is analyzed to obtain corresponding description information; and restoring the backup set and the backup metadata file according to the description information to generate the original format non-uniform database file. RMAN > restore database '/opt/dmbak/dmdata/DBREST/dm.ini ' from backup '/opt/dmbak/full;
Restore database’/opt/dmbak/dmdata/DBREST/dm.ini’from backupset’/opt/dmbak/full;
[percent:0.00%][speed:0.00M/s][cost:00:00:01][remaining:00:00:00]
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
[percent:100.00%][speed:0.00M/s][cost:00:00:27][remaining:00:00:00]
Restore successfully
Time used:00:0027.084
in step S103, upon database restoration: and restoring the original format non-uniform database file into the original format database file with data uniformity through REDO logs in the backup set.
Specifically, a target archive log file directory in an initialization database file is obtained; searching whether REDO logs exist in a target archive log file directory; if yes, the original format non-consistency database file is restored to the original format database file with data consistency. The database can be restored according to REDO logs in the backup set to promote the generation of the sequence numbers of the logs of the database, so that the consistency of the database is ensured.
RMAN>recover databse’/opt/dmbak/dmdata/DBREST/dm.ini’from backupset’/opt/dmbak/full;
recover database’/opt/dmbak/dmdata/DBREST/dm.ini’from backupset’/opt/dmbak/full;
Database mode=0,oguid=0
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
EP[0]’s cur_lsn[20464674],file_lsn[20464674]
EP:0total 1pkgs applied,percent:14%
EP:0total 2pkgs applied,percent:28%
EP:0total 3pkgs applied,percent:42%
EP:0total 4pkgs applied,percent:57%
EP:0total 5pkgs applied,percent:71%
EP:0total 6pkgs applied,percent:85%
EP:0total 7pkgs applied,percent:100%
recover successfully
Time used:00:02.591
In step S104, the database magic number is updated, and the original format database file is copied to the recovery directory to perform recovery of the database.
Updating the database magic number and copying it to the recovery directory: rsync-az/opt/dmbak/dmdata// opt/dmrest/.
RMAN>recover databse’/opt/dmbak/dmdata/DBREST/dm.ini’update db_magic;recover database’/opt/dmbak/dmdata/DBREST/dm.ini’update db_magic;
file dm.key not found,use default license!
Database mode=0,oguid=0
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
EP[0]’s cur_lsn[20464685],file_lsn[20464685]
recover successfully
Time used:00:00:01.231
Aiming at the defects of excessive operation flow and long time consumption of the existing database recovery, the invention redesigns and integrates the backup and recovery flow so as to realize simple and efficient recovery flow, can be used for quickly recovering the availability of the production system and realize the minute-level RTO.
Example 2
As shown in fig. 1 to 2, a method of accelerating database recovery in one embodiment of the present invention is described, the method comprising the following steps.
In step S201, at the time of database backup: initializing database files, and respectively executing full-volume backup and incremental backup to generate a compressed backup set and backup metadata files.
Backup catalog planning: the dmdata is used for initializing a database, full is used for storing full-volume backups, and inc is used for storing incremental backups.
[dmdba@meijia-dm-2~]$ll/opt/dmbak/
total 0
drwxr-xr-x 2dmdba dinstall 6Mar 416:57dmdata
drwxr-xr-x 2dmdba dinstall 57Mar 416:05full
drwxr-xr-x 2dmdba dinstall 54Mar 416:08inc
And initializing a database file for subsequent recovery.
[dmdba@meijia-dm-2~]$dminit PATH=/opt/dmbak/dmdata INSTANCE_NAME=DMREST DB_NAME=DBREST
Initdb V8
Db version:0x7000c
File dm.key not gound,use default license!
License will expire on 2022-07-09
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal ofROLL
Log file path:/opt/dmbak/dmdata/DBREST/DBREST01.log
Log file path:/opt/dmbak/dmdata/DBREST/DBREST02.logWrite to dir[/opt/dmbak/dmdata/DBREST].
Creat dm database success.2022-03-0416:57:59
And respectively executing full backup and incremental backup to generate a compressed backup set and backup metadata files. Full back-up:
[root@meijia-dm-2opt]#disql SYSDBA/SYSDBA@127.0.0.1:5236
server [127.0.0.1:5236]Is in a normal open state
Logging the service time: 4.054 (ms)
DisqlV8
SQL>BACKUP DATABASE FULLBACKUPSET’/opt/dmbak/full’;
The operation has been performed
The elapsed time: 00:00:26.736. execution number: 61300.
SQL>
incremental backup:
[root@meijia-dm-2opt]#disql SYSDBA/SYSDBA@127.0.0.1:5236
server [127.0.0.1:5236]Is in a normal open state
Logging the service time: 3.508 (ms)
DisqlV8
SQL>BACKUP DATABASE INCREMENT BACKUPSET’/opt/dmbak/inc’;
The operation has been performed
The elapsed time: 00:00:10.035. execution number: 61100.
SQL>
in step S202, the backup set and the backup metadata file are restored to the initialization database file to generate the original format non-uniform database file.
Specifically, the backup set is analyzed to obtain corresponding description information; and restoring the backup set and the backup metadata file according to the description information to generate the original format non-uniform database file. The step is time-consuming, and the database recovery speed can be effectively increased by adjusting the part to the backup process.
RMAN>restore database’/opt/dmbak/dmdata/DBREST/dm.ini’from backupset’/opt/dmbak/full;
Restore database’/opt/dmbak/dmdata/DBREST/dm.ini’from backupset’/opt/dmbak/full;
[percent:0.00%][speed:0.00M/s][cost:00:00:01][remaining:00:00:00]
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
[percent:100.00%][speed:0.00M/s][cost:00:00:27][remaining:00:00:00]
Restore successfully
Time used:00:0027.084
In step S203, the original format non-uniform database file is restored to the original format database file having data uniformity through the REDO log in the backup set.
Specifically, a target archive log file directory in an initialization database file is obtained; searching whether REDO logs exist in a target archive log file directory; if yes, the original format non-consistency database file is restored to the original format database file with data consistency. The database can be restored according to REDO logs in the backup set to promote the generation of the sequence numbers of the logs of the database, so that the consistency of the database is ensured. RMAN > recovery databse '/opt/dmbak/dmdata/DBREST/dm.ini ' from backup '/opt/dmbak/full;
recover database’/opt/dmbak/dmdata/DBREST/dm.ini’from backupset’/opt/dmbak/full;
Database mode=0,oguid=0
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
EP[0]’s cur_lsn[20464674],file_lsn[20464674]
EP:0total 1pkgs applied,percent:14%
EP:0total 2pkgs applied,percent:28%
EP:0total 3pkgs applied,percent:42%
EP:0total 4pkgs applied,percent:57%
EP:0total 5pkgs applied,percent:71%
EP:0total 6pkgs applied,percent:85%
EP:0total 7pkgs applied,percent:100%
recover successfully
Time used:00:02.591
from this full or incremental backup to completion, the original format database file with data consistency is generated under the backup catalog. The backup set and the backup metadata file after each backup are not compressed any more, but the original format file ensuring the data consistency is obtained, and when a recovery task is initiated, only the original format file specifying the data consistency is directly pulled up to database service.
In step S204, upon database recovery: updating the magic number of the database, and copying the original format database file to a recovery directory to recover the database.
Updating the database magic number and copying it to the recovery directory: rsync-az/opt/dmbak/dmdata// opt/dmrest/.
RMAN>recover databse’/opt/dmbak/dmdata/DBREST/dm.ini’update db_magic;recover database’/opt/dmbak/dmdata/DBREST/dm.ini’update db_magic;
file dm.key not found,use default license!
Database mode=0,oguid=0
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
EP[0]’s cur_lsn[20464685],file_lsn[20464685]
recover successfully
Time used:00:00:01.231
The adjusted database recovery method can shorten 80% of recovery time, and RTO time can be shortened to a minute level, so that the purpose of quickly recovering production availability is achieved.
As shown in fig. 5, an apparatus for expediting database recovery according to an embodiment of the invention is described.
In an embodiment of the present invention, the device for accelerating database recovery includes a backup module 501 and a recovery module 502.
A backup module 501, configured to, during database backup: initializing database files, and respectively executing full-volume backup and incremental backup to generate a compressed backup set and backup metadata files; and restoring the backup set and the backup metadata file to the initialized database file to generate the original format non-uniform database file.
A recovery module 502, configured to, when recovering the database: restoring the original format non-uniform database file into an original format database file with data uniformity through REDO logs in the backup set; and updating the database magic number, and copying the original format database file to a recovery directory to recover the database.
The backup module 501 is further configured to: analyzing the backup set to obtain corresponding description information; and restoring the backup set and the backup metadata file according to the description information to generate the original format non-uniform database file.
The recovery module 502 is further configured to: acquiring a target archive log file directory in an initialization database file; searching whether REDO logs exist in a target archive log file directory; if yes, the original format non-consistency database file is restored to the original format database file with data consistency.
As shown in fig. 5, an apparatus for expediting database recovery according to an embodiment of the invention is described.
In an embodiment of the present invention, the device for accelerating database recovery includes a backup module 501 and a recovery module 502.
A backup module 501, configured to, during database backup: initializing database files, and respectively executing full-volume backup and incremental backup to generate a compressed backup set and backup metadata files; restoring the backup set and the backup metadata file into an initialized database file to generate a non-uniform database file in the original format; and restoring the original format non-uniform database file into the original format database file with data uniformity through REDO logs in the backup set.
A recovery module 502, configured to, when recovering the database: updating the magic number of the database, and copying the original format database file to a recovery directory to recover the database.
The backup module 501 is further configured to: analyzing the backup set to obtain corresponding description information; and restoring the backup set and the backup metadata file according to the description information to generate the original format non-uniform database file.
The backup module 502 is also configured to: acquiring a target archive log file directory in an initialization database file; searching whether REDO logs exist in a target archive log file directory; if yes, the original format non-consistency database file is restored to the original format database file with data consistency.
FIG. 6 illustrates a hardware block diagram of a computing device 60 for expediting database recovery and restoration according to an embodiment of the disclosure. As shown in fig. 6, computing device 60 may include at least one processor 601, memory 602 (e.g., non-volatile memory), memory 603, and communication interface 604, and at least one processor 601, memory 602, memory 603, and communication interface 604 are connected together via bus 605. The at least one processor 601 executes at least one computer readable instruction stored or encoded in the memory 602.
It should be appreciated that the computer-executable instructions stored in the memory 602, when executed, cause the at least one processor 601 to perform the various operations and functions described above in connection with fig. 1-6 in various embodiments of the present specification.
In embodiments of the present description, computing device 60 may include, but is not limited to: personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile computing devices, smart phones, tablet computers, cellular phones, personal Digital Assistants (PDAs), handsets, messaging devices, wearable computing devices, consumer electronic devices, and the like.
According to one embodiment, a program product, such as a machine-readable medium, is provided. The machine-readable medium may have instructions (i.e., elements described above implemented in software) that, when executed by a machine, cause the machine to perform the various operations and functions described above in connection with fig. 1-6 in various embodiments of the specification. In particular, a system or apparatus provided with a readable storage medium having stored thereon software program code implementing the functions of any of the above embodiments may be provided, and a computer or processor of the system or apparatus may be caused to read out and execute instructions stored in the readable storage medium.
According to the method for accelerating database recovery and the application of the embodiment of the invention, partial recovery steps of the database can be planned in a backup process, so that the backup set and the backup metadata file which are not compressed are obtained after each backup is completed, but the original format file which ensures the data consistency is obtained, when a recovery task is initiated, only the original format file which designates the data consistency is required to directly pull up the database service, the minute-level recovery production can be realized, the RTO is shortened to the minute level, and the economic loss of enterprises is greatly reduced.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing descriptions of specific exemplary embodiments of the present invention are presented for purposes of illustration and description. It is not intended to limit the invention to the precise form disclosed, and obviously many modifications and variations are possible in light of the above teaching. The exemplary embodiments were chosen and described in order to explain the specific principles of the invention and its practical application to thereby enable one skilled in the art to make and utilize the invention in various exemplary embodiments and with various modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the claims and their equivalents.

Claims (8)

1. A method of expediting database recovery, the method comprising:
when the dream database is backed up: initializing database files, and respectively executing full-volume backup and incremental backup to generate a compressed backup set and backup metadata files;
restoring the backup set and the backup metadata file to the initialization database file to generate a non-uniform database file in the original format; and
restoring the original format non-uniform database file into an original format database file with data uniformity through REDO logs in the backup set;
upon the dream database recovery: updating the database magic number, and copying the original format database file to a recovery directory to recover the database.
2. The method for expediting database recovery of claim 1, wherein reverting the backup set and the backup metadata file to the initialization database file to generate a native format non-conforming database file comprises:
analyzing the backup set to obtain corresponding description information; and
and restoring the backup set and the backup metadata file according to the description information to generate the original format non-uniform database file.
3. The method for expediting database recovery of claim 1, wherein recovering the original-format non-uniform database file from the REDO log in the backup set to an original-format database file having data consistency comprises:
acquiring a target archive log file directory in the initialization database file;
searching whether the REDO log exists in the target archive log file directory; if so, the first and second data are not identical,
and recovering the original format non-uniform database file into an original format database file with data uniformity.
4. An apparatus for expediting database recovery, the apparatus comprising:
the backup module is used for when the dream database is backed up: initializing database files, and respectively executing full-volume backup and incremental backup to generate a compressed backup set and backup metadata files; restoring the backup set and the backup metadata file to the initialization database file to generate a non-uniform database file in the original format; and recovering the original format non-uniform database file into an original format database file with data uniformity through REDO logs in the backup set;
the recovery module is used for, when the dream database is recovered: updating the database magic number, and copying the original format database file to a recovery directory to recover the database.
5. The apparatus for expediting database recovery of claim 4, wherein the backup module is further to:
analyzing the backup set to obtain corresponding description information; and
and restoring the backup set and the backup metadata file according to the description information to generate the original format non-uniform database file.
6. The apparatus for expediting database recovery of claim 4, wherein the backup module is further to:
acquiring a target archive log file directory in the initialization database file;
searching whether the REDO log exists in the target archive log file directory; if so, the first and second data are not identical,
and recovering the original format non-uniform database file into an original format database file with data uniformity.
7. An electronic device, comprising:
at least one processor; and
a memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the method of expediting database recovery and restoration of any one of claims 1 to 3.
8. A computer readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, implements the steps of the method for expediting database recovery and restoration according to any one of claims 1 to 3.
CN202210385670.4A 2022-04-13 2022-04-13 Method for accelerating database recovery and application Active CN114840361B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210385670.4A CN114840361B (en) 2022-04-13 2022-04-13 Method for accelerating database recovery and application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210385670.4A CN114840361B (en) 2022-04-13 2022-04-13 Method for accelerating database recovery and application

Publications (2)

Publication Number Publication Date
CN114840361A CN114840361A (en) 2022-08-02
CN114840361B true CN114840361B (en) 2023-07-14

Family

ID=82564458

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210385670.4A Active CN114840361B (en) 2022-04-13 2022-04-13 Method for accelerating database recovery and application

Country Status (1)

Country Link
CN (1) CN114840361B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116541469B (en) * 2023-07-07 2024-04-09 深圳市科力锐科技有限公司 Method, device, equipment and storage medium for realizing data synchronization

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105045680A (en) * 2015-07-10 2015-11-11 上海爱数软件有限公司 Data backup method for DM database
CN111078667A (en) * 2019-12-12 2020-04-28 腾讯科技(深圳)有限公司 Data migration method and related device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10394667B2 (en) * 2015-02-25 2019-08-27 Hyland Switzerland Sàrl System and methods for backing up and restoring database objects
CN107506260B (en) * 2017-07-27 2019-11-05 南京南瑞集团公司 A kind of dynamic division database incremental backup method
CN108664359B (en) * 2018-05-23 2020-12-29 上海达梦数据库有限公司 Database recovery method, device, equipment and storage medium
CN111488339B (en) * 2019-01-25 2023-10-27 上海哔哩哔哩科技有限公司 NoSQL database based on node.JS, establishing and processing method
CN112286728A (en) * 2020-10-30 2021-01-29 深圳前海微众银行股份有限公司 Data backup method, device, equipment and computer storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105045680A (en) * 2015-07-10 2015-11-11 上海爱数软件有限公司 Data backup method for DM database
CN111078667A (en) * 2019-12-12 2020-04-28 腾讯科技(深圳)有限公司 Data migration method and related device

Also Published As

Publication number Publication date
CN114840361A (en) 2022-08-02

Similar Documents

Publication Publication Date Title
US10055148B1 (en) Storing application data as an enhanced copy
US10310951B1 (en) Storage system asynchronous data replication cycle trigger with empty cycle detection
EP2318929B1 (en) Application restore points
US10678663B1 (en) Synchronizing storage devices outside of disabled write windows
CN102782639B (en) Enable to copy the system and method that target reclaims untapped storage space in thin supply storage system
KR100515890B1 (en) Method of efficiently recovering database
CN108416040B (en) Database repair method and device, terminal equipment and storage medium
US8578203B2 (en) Providing a backup service from a remote backup data center to a computer through a network
CN107003890B (en) Efficiently providing virtual machine reference points
US8260752B1 (en) Systems and methods for change tracking with multiple backup jobs
CN109542682B (en) Data backup method, device, equipment and storage medium
US7831787B1 (en) High efficiency portable archive with virtualization
EP3796174B1 (en) Restoring a database using a fully hydrated backup
CN1877539A (en) Data backup/recovery system under cold start mode and implementing method therefor
CN109086425B (en) Data processing method and device for database
CN108614876B (en) Redis database-based system and data processing method
CN114840361B (en) Method for accelerating database recovery and application
CN104572354A (en) Backup and restoration method for operating system based on restoration service and equipment thereof
CN110597661A (en) Virtual machine backup method and device
RU2665884C2 (en) Method and device for restoring backup database
US8677088B1 (en) Systems and methods for recovering primary sites after failovers to remote secondary sites
CN111984469B (en) Incremental snapshot capacity expansion method and device
US8595271B1 (en) Systems and methods for performing file system checks
CN108089942B (en) Data backup and recovery method and device
US11449389B2 (en) Techniques for performing incremental data backups

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant