CN105843707B - Database quick recovery method and equipment - Google Patents
Database quick recovery method and equipment Download PDFInfo
- Publication number
- CN105843707B CN105843707B CN201610182044.XA CN201610182044A CN105843707B CN 105843707 B CN105843707 B CN 105843707B CN 201610182044 A CN201610182044 A CN 201610182044A CN 105843707 B CN105843707 B CN 105843707B
- Authority
- CN
- China
- Prior art keywords
- database
- recovery
- data
- target
- type
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Quality & Reliability (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of database quick recovery method and equipment, and wherein method includes: to establish data backup collection;Establish target database;Trigger data library recovery request;Start the target database;The complete recovery of database to be restored is carried out according to database recovery request and source database data, or the incomplete recovery of database to be restored is carried out according to database recovery request and the data backup collection.By a kind of database quick recovery method of the invention and equipment, the fast quick-recovery of database is realized, has the advantages that flexibility is high, the database recovery time is short, easy to operate.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of database quick recovery method and equipment.
Background technique
With the arrival of big data era, data volume is being doubled and redoubled, and database application is in various industries, and to data
Analysis and test have increasingly higher demands.How when not influencing raw data base the use of complete paired data becomes
The problem that more and more enterprises face.Although database itself provides certain methods, it is difficult meet the needs of user.
Current database data use and database restoring method there are the problem of it is as follows:
(1) data imported into new database:
With being continuously increased for data volume, becomes to be increasingly difficult to from database export data, need to take considerable time, need
Disk space that will be bigger, and I/O the and CPU duration of database host is consumed, seriously affect database operation effect
Rate.Instant data can export, but for frequent data test and analysis, the time-consuming that mass data imports is to allow people can not
It endures, greatly reduces working efficiency, and this method can not make data be in some time dotted state of history.
(2) database copy method:
This method use for influencing whether source database first.Secondly duplication is by network transmission, even local area network is same
There is time-consuming too long problem in sample.Last this method needs more professional DBA (database administrator) to complete, for program development
Engineer or Data Analyst arbitrary can not complete this work.
(3) normal backup restoration methods:
This method recovery process uses Standby control file, after restore (recovery) Standby control file, it is also necessary to
Restore database (restores database), which is data file reproduction process, can consume the plenty of time, while to magnetic
The demand of disk space is equally very big.
Summary of the invention
It is an object of the invention to overcome the deficiencies of existing technologies, and a kind of database quick recovery method is provided and is set
It is standby, have the advantages that flexibility is high, the database recovery time is short, easy to operate.
Realizing the technical solution of above-mentioned purpose is:
A kind of database quick recovery method of the invention, comprising:
Establish data backup collection;
Establish target database;
Trigger data library recovery request;
Start the target database;
The complete recovery of database to be restored is carried out according to database recovery request and source database data, or according to
The database recovery request and the data backup collection carry out the incomplete recovery of database to be restored.
A further improvement of the present invention is that this method further include:
Keep the consistency of target database and source database.
A further improvement of the present invention is that it is described according to the database recovery request and source database data carry out to
Restore the complete recovery of database, or database to be restored is carried out according to database recovery request and the data backup collection
Incomplete recovery include:
The type that database recovery is judged according to database recovery request is complete recovery or incomplete recovery;
The type of database recovery is that when restoring completely, source database data are restored to the target database;
When the type of database recovery is incomplete recovery, data backup corresponding with the time point of required recovery is concentrated
Data restore to the target database.
A further improvement of the present invention is that the data backup collection includes: database data, database snapshot, data
Library archive log and online log.
A further improvement of the present invention is that the number that data backup corresponding with the time point of required recovery is concentrated
Include: according to recovery to the target database
Restore time point extremely needed for setting;
It chooses and the time point matched target database snapshot;
Corresponding database data and database archive log is called to restore the mesh according to the target database snapshot
Mark database.
A further improvement of the present invention is that the consistency for keeping target database and source database includes:
Judge that the type that current database restores is complete recovery or incomplete recovery;
It is when restoring completely, directly to open target database that current database, which restores type,;
When current database recovery type is incomplete recovery, passes through resetting target database and keep target database association
The consistency of data and source database associated data, the associated data include database-name and SCN numerical value.
A kind of database fast recovery equipment of the invention, comprising:
First device, for establishing data backup collection;
Second device, for establishing target database;
3rd device is used for trigger data library recovery request;
4th device, for starting the target database;
5th device, for carrying out the complete of database to be restored according to database recovery request and source database data
Restore entirely, or carries out the incomplete recovery of database to be restored according to database recovery request and the data backup collection.
A further improvement of the present invention is that the equipment further include:
6th device, for keeping the consistency of target database and source database.
A further improvement of the present invention is that the 5th device is used for:
The type that database recovery is judged according to database recovery request is complete recovery or incomplete recovery;
The type of database recovery is that when restoring completely, source database data are restored to the target database;
When the type of database recovery is incomplete recovery, data backup corresponding with the time point of required recovery is concentrated
Data restore to the target database.
A further improvement of the present invention is that the data backup collection includes: database data, database snapshot, data
Library archive log and online log.
A further improvement of the present invention is that the number that data backup corresponding with the time point of required recovery is concentrated
Include: according to recovery to the target database:
Restore time point extremely needed for setting;
It chooses and the time point matched target database snapshot;
Corresponding database data and database archive log is called to restore the mesh according to the target database snapshot
Mark database.
A further improvement of the present invention is that the 6th device is used for:
Judge that the type that current database restores is complete recovery or incomplete recovery;
It is when restoring completely, directly to open target database that current database, which restores type,;
When current database recovery type is incomplete recovery, passes through resetting target database and keep target database association
The consistency of data and source database associated data, the associated data include database-name and SCN numerical value.
Due to using above technical scheme, make it have following beneficial effect is the present invention:
It establishes data backup collection and provides basis to restore database.Database snapshot is used to be used as database data and data
The time point pointer of library archive log.The cooperation of data backup collection, source database and target database realizes the fast of database
Quick-recovery.And have the advantages that flexibility is high, the database recovery time is short, easy to operate.
Detailed description of the invention
Fig. 1 is the flow chart of the database quick recovery method of the embodiment of the present invention;
Fig. 2 is the structural schematic diagram of the database fast recovery equipment of the embodiment of the present invention;
Fig. 3 is that the database quick recovery method of the embodiment of the present invention can write the flow chart of sentence.
Specific embodiment
The present invention is further explained in the light of specific embodiments.
Referring to Fig. 1, a kind of database quick recovery method of the embodiment of the present invention, includes the following steps:
Firstly, establishing data backup collection.
Data backup collection refers to a series of set of database data backups that can be used to restore, and is incomplete recovery
Basis, data backup collection automated back-up generates in the present embodiment, and data backup, which collects, can store on target device, can also deposit
It is stored in the other equipment other than target device, is such as stored in other equipment, the modes such as NFS (Network File System) can be passed through
It is mounted on current machine.It establishes data backup collection and provides basis to restore database;
In the present embodiment, data backup collection includes: database data, database snapshot, database filing log and online
Log.
Data backup collection automated back-up in the present embodiment.Wherein, database data is backed up using timed increase.Each data
Database snapshot can be all created after the completion of the backup of library data increment.Archive log is backed up using real-time incremental.Database snapshot is used
It, can be by database snapshot to the number of object time point in the time point pointer as database data and database archive log
It is called according to library data and archive log.
Then, target database is established.
In the present embodiment, target database refers to will be used to restore data and uninstantiated database or
On database through existing database instance, but restore database name and example cannot with already existing database and
Example conflict.
Then, trigger data library recovery request.
In the present embodiment, database recovery request, which can be, to be triggered by web page by data user of service, can also be straight
Catcher is dynamic to call script triggering.
Restart target database example.
Starting target database example includes the starting of database process and the distribution of physical resource etc..
Later, it is requested to carry out data to be restored according to database recovery request and source database data according to database recovery
The complete recovery in library, or ask summed data backup set to carry out the incomplete recovery of database to be restored according to database recovery, into
One step includes:
The type that database recovery is judged according to database recovery request is complete recovery or incomplete recovery;
The type of database recovery is that when restoring completely, source database data are restored to target database;
When the type of database recovery is incomplete recovery, data backup corresponding with the time point of required recovery is concentrated
Data restore to target database.
Specifically, restoring the data that data backup corresponding with the time point of required recovery is concentrated to target database packet
It includes:
Restore time point extremely needed for setting;
It chooses and time point matched target database snapshot;
Corresponding database data and database archive log is called to restore target database according to target database snapshot.
Restore to refer to completely and is restored to the last one data cell that source database can restore;Incomplete recovery is
Refer to a time point for being restored to intermediate backup procedure.
A data are cloned by the snapshot of selection, which is mounted to target machine by way of Network File System
Device greatly reduces the time-consuming of data duplication in this way, only need to do corresponding configuration on web and trigger recovery operation.
Finally, keeping the consistency of target database and source database.
Target database and the consistency of source database is kept to ensure that the database after restoring can be normally-open.
In the present embodiment, the consistency of holding target database and source database includes:
Judge that the type that current database restores is complete recovery or incomplete recovery;
It is when restoring completely that current database, which restores type, and target database is with uniformity with source database, directly beats
Open target database;
When current database recovery type is incomplete recovery, passes through resetting target database and keep target database association
The consistency of data and source database associated data, associated data include database-name and SCN numerical value.
SCN (System Change Number) is to be safeguarded automatically by DBMS after oracle database updates and go to accumulate
An incremental number.
Referring to Fig. 3, in the present embodiment, to realize that this method can write following sentence:
(1) log-on data library is to nomount state
The process is carried out in two steps:
(a) according to current hosts situation configuration parameter file initSID.ora.
(b) and with changing Parameter File log-on data to nomunt state.
Startup nomount pfile='? / initSID.ora '
(2) creation control file
The process is carried out in two steps:
(a) the sql file trace.sql of modification creation control file
Non-fully restore:
CREATE CONTROLFILE REUSE DATABASE clone RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1'? / redo01.log'SIZE 50M,
GROUP 2'? / redo02.log'SIZE 50M,
GROUP 3'? / redo03.log'SIZE 50M
DATAFILE
'? / system01.dbf',
'? / sysaux01.dbf'
'? / undotbs01.dbf',
'? / users01.dbf'
CHARACTER SET AL32UTF8;
Restore completely:
CREATE CONTROLFILE REUSE DATABASE clone NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1'? / redo01.log'SIZE 50M,
GROUP 2'? / redo02.log'SIZE 50M,
GROUP 3'? / redo03.log'SIZE 50M
DATAFILE
'? / system01.dbf',
'? / sysaux01.dbf'
'? / undotbs01.dbf',
'? / users01.dbf'
CHARACTER SET AL32UTF8;
(b) sql creation control file is executed
sqlplus>@trace.sql
(3) recovery time point is set
The stop time point that rman order setting needs to restore according to demand.
SET UNTIL TIME"to_date('2015-04-22 20:38:03','yyyy-mm-dd
hh24:mi:ss')";
(4) restore database
Restore database by rman order.
RECOVER DATABASE;
(5) database is opened
The database for restoring to complete is opened using different modes according to type is restored.
(a) restore completely:
ALTER DATABASE OPEN;
(b) incomplete recovery:
ALTER DATABASE OPEN RESETLOGS;
Referring to Fig. 2, a kind of database fast recovery equipment of the invention, comprising:
First device 1, for establishing data backup collection;Data backup collection includes: database data, database snapshot, number
According to library archive log and online log;
Second device 2, for establishing target database;
3rd device 3 is used for trigger data library recovery request;
4th device 4, for starting target database;
5th device 5, for carrying out the complete of database to be restored according to database recovery request and source database data
Restore, or asks summed data backup set to carry out the incomplete recovery of database to be restored according to database recovery;
6th device 6, for keeping the consistency of target database and source database.
Wherein, the 5th device 5 is used for:
The type that database recovery is judged according to database recovery request is complete recovery or incomplete recovery;
The type of database recovery is that when restoring completely, source database data are restored to target database;
When the type of database recovery is incomplete recovery, data backup corresponding with the time point of required recovery is concentrated
Data restore to target database.
5th device 5 is further used for:
Restore time point extremely needed for setting;
It chooses and time point matched target database snapshot;
Corresponding database data and database archive log is called to restore target database according to target database snapshot.
In the present embodiment, the 6th device 6 is used for:
Judge that the type that current database restores is complete recovery or incomplete recovery;
It is when restoring completely, directly to open target database that current database, which restores type,;
When current database recovery type is incomplete recovery, passes through resetting target database and keep target database association
The consistency of data and source database associated data, associated data include database-name and SCN numerical value.
The present invention has been described in detail with reference to the accompanying drawings, those skilled in the art can be according to upper
It states and bright many variations example is made to the present invention.Thus, certain details in embodiment should not constitute limitation of the invention, this
Invention will be using the range that the appended claims define as protection scope of the present invention.
Claims (8)
1. a kind of database quick recovery method, comprising:
Establish data backup collection;
Establish target database;
Keep the consistency of target database and source database;
Trigger data library recovery request;
Start the target database;Database to be restored is carried out according to database recovery request and source database data
Restore completely, or the incomplete extensive of database to be restored is carried out according to database recovery request and the data backup collection
It is multiple;
Wherein, the complete recovery that database to be restored is carried out according to database recovery request and source database data,
Or include: according to the incomplete recovery that database recovery request and the data backup collection carry out database to be restored
The type that database recovery is judged according to database recovery request is complete recovery or incomplete recovery;
The type of database recovery is that when restoring completely, source database data are restored to the target database;
When the type of database recovery is incomplete recovery, by the number of data backup corresponding with the time point of required recovery concentration
According to recovery to the target database.
2. database quick recovery method according to claim 1, wherein the data backup collection includes: database number
According to, database snapshot, database filing log and online log.
3. database quick recovery method according to claim 2, wherein it is described will be corresponding with the time point of required recovery
Data backup concentrate data restore include: to the target database
Restore time point extremely needed for setting;
It chooses and the time point matched target database snapshot;
Corresponding database data and database archive log is called to restore the number of targets according to the target database snapshot
According to library.
4. according to the method described in claim 1, wherein, the consistency for keeping target database and source database includes:
Judge that the type that current database restores is complete recovery or incomplete recovery;
It is when restoring completely, directly to open target database that current database, which restores type,;
When current database recovery type is incomplete recovery, passes through resetting target database and keep target database associated data
With the consistency of source database associated data, the associated data includes database-name and SCN numerical value.
5. a kind of database fast recovery equipment characterized by comprising
First device, for establishing data backup collection;
Second device, for establishing target database;
3rd device is used for trigger data library recovery request;
4th device, for starting the target database;
5th device, for carrying out the complete extensive of database to be restored according to database recovery request and source database data
Again, or according to database recovery request and the data backup collection incomplete recovery of database to be restored is carried out;
6th device, for keeping the consistency of target database and source database;Wherein, the 5th device is used for:
The type that database recovery is judged according to database recovery request is complete recovery or incomplete recovery;
The type of database recovery is that when restoring completely, source database data are restored to the target database;
When the type of database recovery is incomplete recovery, by the number of data backup corresponding with the time point of required recovery concentration
According to recovery to the target database.
6. database fast recovery equipment according to claim 5, which is characterized in that the data backup collection includes: number
According to library data, database snapshot, database filing log and online log.
7. database fast recovery equipment according to claim 6, which is characterized in that the time by with required recovery
The data that the corresponding data backup of point is concentrated are restored
Restore time point extremely needed for setting;
It chooses and the time point matched target database snapshot;
Corresponding database data and database archive log is called to restore the number of targets according to the target database snapshot
According to library.
8. database fast recovery equipment according to claim 5, which is characterized in that the 6th device is used for:
Judge that the type that current database restores is complete recovery or incomplete recovery;
It is when restoring completely, directly to open target database that current database, which restores type,;
When current database recovery type is incomplete recovery, passes through resetting target database and keep target database associated data
With the consistency of source database associated data, the associated data includes database-name and SCN numerical value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610182044.XA CN105843707B (en) | 2016-03-28 | 2016-03-28 | Database quick recovery method and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610182044.XA CN105843707B (en) | 2016-03-28 | 2016-03-28 | Database quick recovery method and equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105843707A CN105843707A (en) | 2016-08-10 |
CN105843707B true CN105843707B (en) | 2019-05-14 |
Family
ID=56584503
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610182044.XA Active CN105843707B (en) | 2016-03-28 | 2016-03-28 | Database quick recovery method and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105843707B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106407039A (en) * | 2016-08-30 | 2017-02-15 | 广州鼎甲计算机科技有限公司 | Method for recovering Domino database to specified time point by different machine |
CN106326041A (en) * | 2016-08-31 | 2017-01-11 | 杭州沃趣科技股份有限公司 | Second-level recovery method for database |
WO2019080002A1 (en) * | 2017-10-25 | 2019-05-02 | 深圳市互盟科技股份有限公司 | Browser-based backup viewing system and method therefor |
CN107678892B (en) * | 2017-11-07 | 2021-05-04 | 黄淮学院 | Continuous data protection method based on jump recovery chain |
CN108255994A (en) * | 2017-12-29 | 2018-07-06 | 上海上讯信息技术股份有限公司 | A kind of database version management method based on database snapshot |
CN110895500A (en) * | 2019-11-18 | 2020-03-20 | 上海易点时空网络有限公司 | Data backtracking method and device based on mydump and storage medium |
CN111611108A (en) * | 2020-05-21 | 2020-09-01 | 云和恩墨(北京)信息技术有限公司 | Method and device for restoring virtual database |
CN112417033A (en) * | 2020-10-19 | 2021-02-26 | 中国科学院计算机网络信息中心 | Method and system for realizing multi-node data consistency of distributed graph database |
CN112380058A (en) * | 2020-11-12 | 2021-02-19 | 上海上讯信息技术股份有限公司 | File recovery method and equipment |
CN113590389A (en) * | 2021-09-27 | 2021-11-02 | 武汉四通信息服务有限公司 | Database backup method and device, electronic equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101650680A (en) * | 2009-07-27 | 2010-02-17 | 浪潮电子信息产业股份有限公司 | Continuous data protection method based on continuous snapshots |
US8095511B2 (en) * | 2003-06-30 | 2012-01-10 | Microsoft Corporation | Database data recovery system and method |
CN105389230A (en) * | 2015-10-21 | 2016-03-09 | 上海爱数信息技术股份有限公司 | Continuous data protection system and method combining with snapshot technology |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030208511A1 (en) * | 2002-05-02 | 2003-11-06 | Earl Leroy D. | Database replication system |
-
2016
- 2016-03-28 CN CN201610182044.XA patent/CN105843707B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8095511B2 (en) * | 2003-06-30 | 2012-01-10 | Microsoft Corporation | Database data recovery system and method |
CN101650680A (en) * | 2009-07-27 | 2010-02-17 | 浪潮电子信息产业股份有限公司 | Continuous data protection method based on continuous snapshots |
CN105389230A (en) * | 2015-10-21 | 2016-03-09 | 上海爱数信息技术股份有限公司 | Continuous data protection system and method combining with snapshot technology |
Non-Patent Citations (2)
Title |
---|
ORCLE数据库备份与恢复之四:RMAN(备份与恢复管理器);谷普下载;《http://www.gpxz.com/zt_497712.html》;20080825;第1-2页 |
控制文件快照和rman利用快照恢复;Dotaddjj;《http://www.blog.itpub.net/25362835/viewspace-1054571/》;20110830;第2-3页 |
Also Published As
Publication number | Publication date |
---|---|
CN105843707A (en) | 2016-08-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105843707B (en) | Database quick recovery method and equipment | |
US11914486B2 (en) | Cloning and recovery of data volumes | |
CN104346454B (en) | Data consistency verification method based on oracle database | |
CN107145403B (en) | Relational database data backtracking method oriented to Web development environment | |
WO2017162032A1 (en) | Method and device for executing data recovery operation | |
US8898113B2 (en) | Managing replicated data | |
CN104423960B (en) | A kind of method and system of project continuous integrating | |
CN111949633B (en) | ICT system operation log analysis method based on parallel stream processing | |
US20070083563A1 (en) | Online tablespace recovery for export | |
CN107656705B (en) | Computer storage medium and data migration method, device and system | |
US20080010496A1 (en) | System and Method to Create and Manage Multiple Virtualized Remote Mirroring Session Consistency Groups | |
US10809922B2 (en) | Providing data protection to destination storage objects on remote arrays in response to assignment of data protection to corresponding source storage objects on local arrays | |
CN104765651B (en) | A kind of data processing method and device | |
CN111078667A (en) | Data migration method and related device | |
CN105306581A (en) | Router and cloud disk based data synchronization method | |
US20200034041A1 (en) | Utilizing groups of data protection policies that are assignable to storage objects | |
JP2007140777A (en) | Computer system, management computer and data recovery method | |
CN112367186B (en) | Fault protection method and device based on 0penStack bare computer | |
US11079960B2 (en) | Object storage system with priority meta object replication | |
US11163799B2 (en) | Automatic rollback to target for synchronous replication | |
CN106445729A (en) | Backup virtualization-based method | |
US11074002B2 (en) | Object storage system with meta object replication | |
US11093465B2 (en) | Object storage system with versioned meta objects | |
CN114443356A (en) | Container cluster processing method and system | |
CN106775451A (en) | A kind of method and device for processing logical volume |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |