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

Method for accelerating database recovery and application Download PDF

Info

Publication number
CN114840361A
CN114840361A CN202210385670.4A CN202210385670A CN114840361A CN 114840361 A CN114840361 A CN 114840361A CN 202210385670 A CN202210385670 A CN 202210385670A CN 114840361 A CN114840361 A CN 114840361A
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.)
Granted
Application number
CN202210385670.4A
Other languages
Chinese (zh)
Other versions
CN114840361B (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: at the time of database backup: initializing database files, respectively executing full backup and incremental backup, and generating a compressed backup set and backup metadata files; restoring the backup set and the backup metadata file to the initialization database file to generate an original format non-consistency database file; at database recovery time: restoring the original format non-consistent database file into an original format database file with data consistency through the REDO log in the backup set; and updating the magic number of the database, and copying the original format database file to a recovery directory to recover the database. The method can plan partial recovery steps of the database in the backup process, so that the original format file which ensures the data consistency is obtained after the backup is completed each time, and the recovery time of the database is shortened only by directly pulling up the database according to the original format file.

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 national enterprises, a large amount of databases often need hours for data recovery of TB level and even PB level, which means that the service system is in an unavailable state within hours from the failure of the databases to the availability of recovery production, and the maximum time required from a disaster to the normal recovery of the whole system reaches an hour level. Even with backup, each recovery of a production incident takes several hours, during which the economic losses due to service interruption are extremely large. Compared with the recovery which needs to be carried out for several hours, the backup time is usually relatively acceptable for enterprises, because most of the backup time of the enterprise planning production environment is put at night and the business is in the peak period.
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 skilled in the art.
Disclosure of Invention
The invention aims to provide a method and application for accelerating database recovery, which solve the problems that a plurality of recovery steps are required during the recovery of a database, and if a plurality of incremental backups are involved, backup sets are required to be sequentially recovered one by one during the recovery.
To achieve the above object, embodiments of the present invention provide a method for accelerating database recovery.
In one or more embodiments of the invention, the method comprises: at the time of database backup: initializing database files, respectively executing full backup and incremental backup, and generating a compressed backup set and backup metadata files; restoring the backup set and the backup metadata file to the initialization database file to generate an original format non-consistency database file; at database recovery time: restoring the original format non-consistent database file into an original format database file with data consistency through the REDO log in the backup set; and updating the magic number of the database, 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 to the initialization database file to generate an original format non-consistent 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 an original format non-consistency database file.
In one or more embodiments of the present invention, restoring the original-format non-consistent database file to an original-format database file with data consistency through the REDO log in the backup set includes: acquiring a target filing log file directory in the initialization database file; searching whether the REDO log exists in the target filing log file directory; and if so, restoring the original format non-consistent database file into an original format database file with data consistency.
To achieve the above object, an embodiment of the present invention provides another method for accelerating database recovery.
In one or more embodiments of the invention, the method comprises: at the time of database backup: initializing database files, respectively executing full backup and incremental backup, and generating a compressed backup set and backup metadata files; restoring the backup set and the backup metadata file to the initialization database file to generate an original format non-consistency database file; restoring the original format non-consistent database file into an original format database file with data consistency through the REDO log in the backup set; at database recovery time: and updating the magic number of the database, 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 to the initialization database file to generate an original format non-consistent 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 an original format non-consistency database file.
In one or more embodiments of the present invention, restoring the original-format non-consistent database file to an original-format database file with data consistency through the REDO log in the backup set includes: acquiring a target filing log file directory in the initialization database file; searching whether the REDO log exists in the target filing log file directory; and if so, restoring the original format non-consistent database file into an original format database file with data consistency.
In another aspect of the invention, an apparatus for expediting database recovery and restoration is provided that includes a backup module and a restore module.
The backup module is used for, during database backup: initializing database files, respectively executing full backup and incremental backup, and generating 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 an original format non-consistency database file.
A recovery module for, upon recovery of the database: restoring the original format non-consistent database file into an original format database file with data consistency through the REDO log in the backup set; and updating the magic number of the database, and copying the original format database file to a recovery directory to recover the database.
In one or more embodiments of the 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 an original format non-consistency database file.
In one or more embodiments of the invention, the recovery module is further configured to: acquiring a target filing log file directory in the initialization database file; searching whether the REDO log exists in the target filing log file directory; and if so, restoring the original format non-consistent database file into an 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 restore module.
The backup module is used for, during database backup: initializing database files, respectively executing full backup and incremental backup, and generating a compressed backup set and backup metadata files; restoring the backup set and the backup metadata file to the initialization database file to generate an original format non-consistency database file; and restoring the original format non-consistent database file into an original format database file with data consistency through the REDO log in the backup set.
A recovery module for, upon recovery of the database: and updating the magic number of the database, and copying the original format database file to a recovery directory to recover the database.
In one or more embodiments of the 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 an original format non-consistency database file.
In one or more embodiments of the invention, the backup module is further configured to: acquiring a target filing log file directory in the initialization database file; searching whether the REDO log exists in the target filing log file directory; and if so, restoring the original format non-consistent database file into an 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 recovery as described above.
In another aspect of the invention, a computer-readable storage medium is provided, having stored thereon a computer program, which when executed by a processor, carries out the steps of the method of expediting database recovery and recovery as described.
Compared with the prior art, according to the method and the application for accelerating database recovery and recovery, partial recovery steps of the database can be planned in the backup process, so that a compressed backup set and backup metadata files are not obtained after each backup, but original format files with data consistency are ensured, when a recovery task is initiated, only the original format files with data consistency need to be appointed to directly pull up the database service, the availability of minute-level recovery production can be realized, the RTO is shortened to the minute level, and the economic loss of an enterprise is greatly reduced.
Drawings
FIG. 1 is a first flow diagram of a method of expediting database recovery and recovery in accordance with an embodiment of the present invention;
FIG. 2 is a second flow diagram of a method of expediting database recovery and recovery in accordance with an embodiment of the present invention;
FIG. 3 is a schematic diagram of a full backup restore of a method of expediting database restore and recovery, according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an incremental backup restore of a method of expediting database restore and recovery, according to an embodiment of the present invention;
FIG. 5 is a block diagram of an apparatus for expediting database recovery and recovery in accordance with an embodiment of the present invention;
FIG. 6 is a hardware block diagram of a computing device that expedites database recovery and recovery according to one embodiment of the invention.
Detailed Description
The following detailed description of the present invention is provided in conjunction with the accompanying drawings, but it should be understood that the scope of the present invention is not limited to the specific embodiments.
Throughout the specification and claims, unless explicitly stated otherwise, the term "comprise" or variations such as "comprises" or "comprising", etc., will be understood to imply the inclusion of a stated element or component but not the exclusion of any other element or component.
The technical solutions provided by the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
Example 1
Referring to fig. 1-2, a method for accelerating database recovery in one embodiment of the invention is described, which includes the following steps.
In step S101, at the time of database backup: initializing database files, respectively executing full backup and incremental backup, and generating a compressed backup set and backup metadata files.
And (3) backup catalog planning: dmdata is used to initialize the database, full is used to deposit full backups, and inc is used to deposit 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
The database file is initialized 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 a backup metadata file.
Full backup:
[root@meijia-dm-2opt]#disql SYSDBA/SYSDBA@127.0.0.1:5236
server [ alpha ], [ alpha127.0.0.1:5236]In a normally open state
Login use time: 4.054(ms)
DisqlV8
SQL>BACKUP DATABASE FULL BACKUPSET’/opt/dmbak/full’;
The operation has been executed
The elapsed time is as follows: 00: 00: 26.736. execution number: 61300.
SQL>
incremental backup:
[root@meijia-dm-2opt]#disql SYSDBA/SYSDBA@127.0.0.1:5236
server [ alpha ], [ alpha127.0.0.1:5236]In a normally open state
Login use time: 3.508(ms)
DisqlV8
SQL>BACKUP DATABASE INCREMENT BACKUPSET’/opt/dmbak/inc’;
The operation has been executed
The elapsed time: 00: 00: 10.035. execution number: 61100.
SQL>
in step S102, the backup set and the backup metadata files are restored to the initialization database file to generate an original format non-consistent 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-consistency database file. RMAN > restore database '/opt/dmbak/dmdata/DBREST/dm. ini ' from backup set '/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 recovery: and restoring the original format non-consistent database file into an original format database file with data consistency through the REDO log in the backup set.
Specifically, a target filing log file directory in an initialized database file is obtained; searching whether an REDO log exists in a target filing log file directory; and if so, restoring the original format non-consistent database file into the original format database file with data consistency. The database can be restored according to the REDO log in the backup set to promote the generation of the serial number of the database log, 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 magic number of the database is updated, and the original format database file is copied to the recovery directory to recover the database.
Updating the database magic number and copying the magic number to a 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 recovery operation flow and long time consumption of the existing database, the invention redesigns and integrates the backup and recovery flow to realize simple and efficient recovery flow, can be used for quickly recovering the availability of a production system and realizes the minute-level RTO.
Example 2
Referring to fig. 1-2, a method for accelerating database recovery in one embodiment of the invention is described, which includes the following steps.
In step S201, at the time of database backup: initializing database files, respectively executing full backup and incremental backup, and generating a compressed backup set and backup metadata files.
And (3) backup catalog planning: dmdata is used to initialize the database, full is used to deposit full backups, and inc is used to deposit 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
The database file is initialized 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 backup:
[root@meijia-dm-2opt]#disql SYSDBA/SYSDBA@127.0.0.1:5236
server [ alpha ], [ alpha127.0.0.1:5236]In a normally open state
Login use time: 4.054(ms)
DisqlV8
SQL>BACKUP DATABASE FULLBACKUPSET’/opt/dmbak/full’;
The operation has been executed
The elapsed time is as follows: 00: 00: 26.736. execution number: 61300.
SQL>
incremental backup:
[root@meijia-dm-2opt]#disql SYSDBA/SYSDBA@127.0.0.1:5236
server [ alpha ], [ alpha127.0.0.1:5236]In a normally open state
Login use time: 3.508(ms)
DisqlV8
SQL>BACKUP DATABASE INCREMENT BACKUPSET’/opt/dmbak/inc’;
The operation has been executed
The elapsed time is as follows: 00: 00: 10.035. execution number: 61100.
SQL>
in step S202, the backup set and the backup metadata files are restored to the initialization database file to generate an original format non-consistent 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-consistency database file. The step takes longer, and the database recovery speed can be effectively accelerated 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-consistent database file is restored to the original format database file with data consistency through the REDO log in the backup set.
Specifically, a target filing log file directory in an initialized database file is obtained; searching whether an REDO log exists in a target filing log file directory; and if so, restoring the original format non-consistent database file into the original format database file with data consistency. The database can be restored according to the REDO log in the backup set to promote the generation of the serial number of the database log, so that the consistency of the database is ensured. RMAN > recovery database '/opt/dmbak/dmdata/DBREST/dm. ini ' from backup set '/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
when the full backup or incremental backup is completed, the original format database file with data consistency is generated under the backup directory. After each backup is finished, the compressed backup set and the backup metadata files are not obtained any more, but the original format files with the data consistency are ensured, and when a recovery task is initiated, the original format files with the specified data consistency only need to be directly pulled up for database service.
In step S204, upon database recovery: and updating the magic number of the database, and copying the database file in the original format to a recovery directory to recover the database.
Updating the database magic number and copying the magic number to a 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 reduce the recovery time by 80 percent, and the RTO time can be shortened to the level of minutes, thereby achieving the purpose of quickly recovering the availability of production.
Referring now to FIG. 5, an apparatus for expediting database recovery in accordance with an embodiment of the present invention is illustrated.
In an embodiment of the present invention, the apparatus 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, respectively executing full backup and incremental backup, and generating a compressed backup set and backup metadata files; and restoring the backup set and the backup metadata files to the initialized database file to generate an original format non-consistent database file.
A recovery module 502 for, upon database recovery: restoring the original format non-consistent database file into an original format database file with data consistency through the REDO log in the backup set; and updating the magic number of the database, and copying the database file in the original format 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-consistency database file.
The recovery module 502 is further configured to: acquiring a target filing log file directory in an initialized database file; searching whether an REDO log exists in a target filing log file directory; and if so, restoring the original format non-consistent database file into the original format database file with data consistency.
Referring now to FIG. 5, an apparatus for expediting database recovery in accordance with an embodiment of the present invention is illustrated.
In an embodiment of the present invention, the apparatus 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, respectively executing full backup and incremental backup, and generating a compressed backup set and backup metadata files; restoring the backup set and the backup metadata file into an initialization database file to generate an original format non-consistency database file; and restoring the original format non-consistent database file into an original format database file with data consistency through the REDO log in the backup set.
A recovery module 502 for, upon database recovery: and updating the magic number of the database, and copying the database file in the original format 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-consistency database file.
The backup module 502 is further configured to: acquiring a target filing log file directory in an initialized database file; searching whether an REDO log exists in a target filing log file directory; and if so, restoring the original format non-consistent database file into 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 recovery in accordance with embodiments of the present description. As shown in fig. 6, computing device 60 may include at least one processor 601, storage 602 (e.g., non-volatile storage), memory 603, and a communication interface 604, and the at least one processor 601, storage 602, memory 603, and communication interface 604 are connected together via a 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 the various embodiments of the present description.
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), handheld devices, messaging devices, wearable computing devices, consumer electronics, and so forth.
According to one embodiment, a program product, such as a machine-readable medium, is provided. A machine-readable medium may have instructions (i.e., elements described above as being implemented in software) that, when executed by a machine, cause the machine to perform various operations and functions described above in connection with fig. 1-6 in the various embodiments of the present specification. Specifically, a system or apparatus may be provided which is provided with a readable storage medium on which software program code implementing the functions of any of the above embodiments is stored, and causes a computer or processor of the system or apparatus to read out and execute instructions stored in the readable storage medium.
According to the method and the application for accelerating database recovery and recovery, provided by the embodiment of the invention, part of recovery steps of the database are planned in the backup process, so that a compressed backup set and backup metadata files are not obtained after each backup, but original format files with data consistency are ensured, when a recovery task is initiated, only the original format files with data consistency need to be appointed to directly pull up the database service, the available minute-level recovery production can be realized, the RTO is shortened to the minute level, and the economic loss of enterprises is greatly reduced.
As will be appreciated by one skilled in the art, 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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 have been 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 certain principles of the invention and its practical application to enable one skilled in the art to make and use various exemplary embodiments of the invention and various alternatives and 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 (10)

1. A method for expediting database recovery, the method comprising:
at the time of database backup: initializing database files, respectively executing full backup and incremental backup, and generating 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 an original format non-consistency database file;
at database recovery time: restoring the original format non-consistent database file into an original format database file with data consistency through the REDO log in the backup set; and
and updating the magic number of the database, and copying the original format database file to a recovery directory to recover the database.
2. A method for expediting database recovery, the method comprising:
at the time of database backup: initializing database files, respectively executing full backup and incremental backup, and generating a compressed backup set and backup metadata files;
restoring the backup set and the backup metadata file to the initialization database file to generate an original format non-consistency database file; and
restoring the original format non-consistent database file into an original format database file with data consistency through the REDO log in the backup set;
at database recovery time: and updating the magic number of the database, and copying the original format database file to a recovery directory to recover the database.
3. The method of accelerating database recovery as recited in claim 1 or 2 in which restoring the backup set and the backup metadata file to the initialization database file to generate an original format non-consistent 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 an original format non-consistency database file.
4. The method for accelerating database recovery according to claim 1 or 2, wherein the recovering the original format non-consistent database file into an original format database file with data consistency through the REDO log in the backup set comprises:
acquiring a target filing log file directory in the initialization database file;
searching whether the REDO log exists in the target filing log file directory; if so,
and restoring the original format non-consistent database file into an original format database file with data consistency.
5. An apparatus for expediting database recovery, the apparatus comprising:
a backup module for, during database backup: initializing database files, respectively executing full backup and incremental backup, and generating a compressed backup set and backup metadata files; restoring the backup set and the backup metadata file to the initialization database file to generate an original format non-consistency database file;
a recovery module for, upon recovery of the database: restoring the original format non-consistent database file into an original format database file with data consistency through the REDO log in the backup set; and updating the magic number of the database, and copying the original format database file to a recovery directory to recover the database.
6. An apparatus for expediting database recovery, the apparatus comprising:
the backup module is used for, during database backup: initializing database files, respectively executing full backup and incremental backup, and generating a compressed backup set and backup metadata files; restoring the backup set and the backup metadata file to the initialization database file to generate an original format non-consistency database file; restoring the original format non-consistent database file into an original format database file with data consistency through the REDO log in the backup set;
a recovery module for, upon recovery of the database: and updating the magic number of the database, and copying the original format database file to a recovery directory to recover the database.
7. The apparatus for expediting database recovery of claim 5 or 6, wherein the backup module is further configured 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 an original format non-consistency database file.
8. The apparatus for expediting database recovery of claim 5 or 6, wherein the backup module is further configured to:
acquiring a target filing log file directory in the initialization database file;
searching whether the REDO log exists in the target filing log file directory; if so,
and restoring the original format non-consistent database file into an original format database file with data consistency.
9. 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 4.
10. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of accelerating database recovery and recovery according to any one of claims 1 to 4.
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 true CN114840361A (en) 2022-08-02
CN114840361B 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)

Cited By (1)

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

Citations (7)

* 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
US20160246687A1 (en) * 2015-02-25 2016-08-25 Lexmark International Technology Sarl System and Methods of Backing Up and Restoring Database Objects
CN107506260A (en) * 2017-07-27 2017-12-22 南京南瑞集团公司 A kind of dynamic division database incremental backup method
CN108664359A (en) * 2018-05-23 2018-10-16 上海达梦数据库有限公司 A kind of database restoring method, device, equipment and storage medium
CN111078667A (en) * 2019-12-12 2020-04-28 腾讯科技(深圳)有限公司 Data migration method and related device
CN111488339A (en) * 2019-01-25 2020-08-04 上海哔哩哔哩科技有限公司 NoSQ L database based on node.JS, and establishing and processing method
CN112286728A (en) * 2020-10-30 2021-01-29 深圳前海微众银行股份有限公司 Data backup method, device, equipment and computer storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160246687A1 (en) * 2015-02-25 2016-08-25 Lexmark International Technology Sarl System and Methods of Backing Up and Restoring Database Objects
CN105045680A (en) * 2015-07-10 2015-11-11 上海爱数软件有限公司 Data backup method for DM database
CN107506260A (en) * 2017-07-27 2017-12-22 南京南瑞集团公司 A kind of dynamic division database incremental backup method
CN108664359A (en) * 2018-05-23 2018-10-16 上海达梦数据库有限公司 A kind of database restoring method, device, equipment and storage medium
CN111488339A (en) * 2019-01-25 2020-08-04 上海哔哩哔哩科技有限公司 NoSQ L database based on node.JS, and establishing and processing method
CN111078667A (en) * 2019-12-12 2020-04-28 腾讯科技(深圳)有限公司 Data migration method and related device
CN112286728A (en) * 2020-10-30 2021-01-29 深圳前海微众银行股份有限公司 Data backup method, device, equipment and computer storage medium

Cited By (2)

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

Also Published As

Publication number Publication date
CN114840361B (en) 2023-07-14

Similar Documents

Publication Publication Date Title
US11740974B2 (en) Restoring a database using a fully hydrated backup
US10055148B1 (en) Storing application data as an enhanced copy
US10310951B1 (en) Storage system asynchronous data replication cycle trigger with empty cycle detection
EP1907935B1 (en) System and method for virtualizing backup images
EP3234772B1 (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
KR100515890B1 (en) Method of efficiently recovering database
WO2016044403A1 (en) Copy data techniques
US8578203B2 (en) Providing a backup service from a remote backup data center to a computer through a network
CN105446828A (en) Database backup and recovery method, apparatus and system
JP6548663B2 (en) Method, system and computer program for maintaining source data in a repository
KR20110086732A (en) Application restore points
EP3796174B1 (en) Restoring a database using a fully hydrated backup
CN1877539A (en) Data backup/recovery system under cold start mode and implementing method therefor
CN102782639A (en) Systems and methods for enabling replication targets to reclaim unused storage space on thin-provisioned storage systems
CN109086425B (en) Data processing method and device for database
CN113918385B (en) Method, device, electronic equipment and medium for online incremental backup and recovery of virtual machine
CN105224422A (en) A kind of data back up method and equipment
CN114840361B (en) Method for accelerating database recovery and application
CN110597661A (en) Virtual machine backup method and device
CN113407380A (en) Method and device for rapidly recovering cross-cluster disaster recovery, electronic equipment and storage medium
US8677088B1 (en) Systems and methods for recovering primary sites after failovers to remote secondary sites
CN108089942B (en) Data backup and recovery method and device
CN110471796B (en) File directory-oriented full and incremental backup recovery method

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