CN108520069A - A kind of database high availability implementation method and database server - Google Patents
A kind of database high availability implementation method and database server Download PDFInfo
- Publication number
- CN108520069A CN108520069A CN201810330668.0A CN201810330668A CN108520069A CN 108520069 A CN108520069 A CN 108520069A CN 201810330668 A CN201810330668 A CN 201810330668A CN 108520069 A CN108520069 A CN 108520069A
- Authority
- CN
- China
- Prior art keywords
- database
- instance
- client
- server
- operational order
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Abstract
The invention discloses a kind of database high availability implementation method and database server, including database instance is during reading and writing database, by itself to the modification operation note of database to database is corresponding redo log in;Redo log receive modification operation after, send carry modification operation operational order to database specify in the standby daily records in client database;After receiving operational order to the standby daily records of client database, by the modification operation write-in in operational order to client database;Wherein, database is consistent with the original state to client database.The present invention stores the modification operation of database to client database by redoing log standby daily records, realizes that the High Availabitity of database, reliability are high.
Description
Technical field
The present invention relates to database High Availabitity technical fields, more particularly to a kind of database high availability implementation method.This
Invention further relates to a kind of database server.
Background technology
K-DB databases are a kind of total relation type databases, and database server includes database and database instance,
Database instance includes memory and background process, and read-write for carrying out database and the record redo log, redoing log is
Change etc. the daily record of operations for additions and deletions in database of record.
K-DB database servers can only make the mode in more example lists library at this stage, i.e., packet in each database server
Containing a database instance, multiple database servers share a database, which is external storage assembly.At this
In kind of structure, database instance realizes High Availabitity, but shared database does not realize High Availabitity, in no disaster tolerance or
In the case of backup, database will be unable to restore once damaging, and entire database just is hung, and reliability is low.
Therefore, how to provide a kind of database high availability implementation method that reliability is high and database server is this field
The current problem to be solved of technical staff.
Invention content
The object of the present invention is to provide a kind of database high availability implementation method and database servers, by repairing for database
Change operation and stored to client database by redoing log-standby daily records, realizes that the High Availabitity of database, reliability are high.
In order to solve the above technical problems, the present invention provides a kind of database high availability implementation method, taken for database
Business device, including:
Database instance is during reading and writing database, by itself to the modification operation note of the database to described
Database is corresponding redo log in;
It is described redo log receive modification operation after, send and carry the operational order of the modification operation to institute
State database it is specified in the standby daily records in client database;
After the standby daily records to client database receive the operational order, by the institute in the operational order
It is described to client database to state modification operation write-in;Wherein, the database is consistent with the original state to client database.
Preferably, database exists in pairs, and two in each pair of database database is mutual to client database each other;
Correspondingly, the group number redo log, size and the standby daily records of two databases in each pair of database
Group number, size correspond to respectively it is identical.
Preferably, the database server includes a database instance and the database built in one, the number
The database instance for including in the database server is corresponded to according to library.
Preferably, the database is sharing storage sets part, and multiple database servers share the database, institute
It states database and corresponds to database instance in multiple database servers, it is described to redo log and the database instance one
One corresponds to.Preferably, database exists in pairs;In each pair of database, the corresponding database instance of a database only undertakes reading
Operation, the corresponding database instance of another database only undertake write operation.
In order to solve the above technical problems, the present invention also provides a kind of database servers, including:
Database instance, the database instance is used for during reading and writing database, by itself to the database
Modification operation note to the database it is corresponding redo log in;
Described to redo log, after receiving the modification operation, the operation that transmission carries the modification operation refers to
Enable to the database specify in the standby daily records in client database;Wherein, the database with it is described to end data
The original state in library is consistent;
The standby daily records write the modification operation in the operational order received after receiving operational order
Enter itself corresponding database;
The database.
Preferably, including a database instance and the database built in one, the database correspond to the data
The database instance for including in the server of library.
Preferably, the database is sharing storage sets part, and multiple database servers share the database, institute
It states database and corresponds to database instance in multiple database servers, it is described to redo log and the database instance one
One corresponds to.
Preferably, database exists in pairs;In each pair of database, the corresponding database instance of a database only undertakes reading
Operation, the corresponding database instance of another database only undertake write operation.
It is each data lab setting one to client database the present invention provides a kind of database high availability implementation method,
For database instance Yi Dan be written and read to database, database is corresponding to redo log the interior modification behaviour that can record database
Make, modification operation is sent to the standby daily records in client database later, by the standby days in client database
Will is by modification operation write-in to client database, so that opposite end databases contain the modification situation of the database as standby
Part, once the database corruption, can also subsequently use to the Backup Data in client database, avoid after database corruption it
The case where interior data are lost completely, realizes the High Availabitity of database, and the reliability of database server is high.The present invention also provides
A kind of database server, it may have above-mentioned advantage.
Description of the drawings
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to institute in the prior art and embodiment
Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the present invention
Example, for those of ordinary skill in the art, without creative efforts, can also obtain according to these attached drawings
Obtain other attached drawings.
Fig. 1 is a kind of flow chart of the process of database high availability implementation method provided by the invention;
Fig. 2 is a kind of database server course of work schematic diagram provided by the invention;
Fig. 3 is the schematic diagram of another database server course of work provided by the invention;
Fig. 4 is the schematic diagram of another database server course of work provided by the invention.
Specific implementation mode
Core of the invention is to provide a kind of database high availability implementation method and database server, by repairing for database
Change operation and stored to client database by redoing log-standby daily records, realizes that the High Availabitity of database, reliability are high.
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
The every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
The present invention provides a kind of database high availability implementation methods, are used for database server, shown in Figure 1, Fig. 1
For a kind of flow chart of the process of database high availability implementation method provided by the invention;This method includes:
Step s1:Database instance is during reading and writing database, extremely to the modification operation note of database by itself
Database is corresponding redo log in;
Wherein, redo log interior record is the content that database additions and deletions change operation, in database corruption, if reforming day
Will can completely retain, you can foundation redoes log carry out database recovery.
It should be noted that since the additions and deletions of database change operation executed by database instance, it redoes log
Record work be also to be completed by database instance.
Step s2:It redoes log after receiving modification operation, sends and carry the operational order for changing operation to database
It is specified in the standby daily records in client database;
Wherein, the function of standby daily records is redo log to what client database transmitted for receiving;That is standby days
The content of will is the content redo log to client database.In standby daily records operation is changed to the additions and deletions of client database can
To be applied to itself corresponding local data base, achieve the purpose that synchronize the data to client database in local data base.
Therefore, in the present invention, after receiving the redoing log of database to the standby daily records of client database, you can according to
According to this redo log by the additions and deletions of database change operation be synchronized to residing for standby daily records in client database.
In addition, in order to guarantee redoing log for database being sent to in client database, needing in database institute
Database server on specify:The destination for itself redoing log transmission is the standby daily records of opposite end server.
Step s3:After receiving operational order to the standby daily records of client database, the modification in operational order is operated
Write-in is to client database;Wherein, database is consistent with the original state to client database.
It should be noted that a database will also be consistent the framework of client database with it, and two data
The title in library cannot be identical.
It is understood that in a system, any one data in addition to itself may be selected in each database
Library is as opposite end;If but in the case that the database that includes in system is more, this elective mode can cause to back up
Very disorderly, it is not easy to be managed, if if each database chooses at random, may result in database while as more
The opposite end of a database, and then keep the database pressure excessive.Therefore, following two embodiments can be used and avoid the above problem:
In wherein a kind of preferred embodiment, database exists in pairs, and two in each pair of database database is each other
It is mutual to client database;
Correspondingly, the group number redo log, size and the standby daily records of two databases in each pair of database
Group number, size correspond to respectively it is identical.
It is understood that by the way of above-described embodiment, by database combination of two, two databases per centering
Each other as mutual to client database, that is, it is used as mutual backup, backup object is cheer and bright, greatly facilitates backup
Management.
In another embodiment, a kind of mode of cycle may be used, by taking 3 databases as an example:That is first data
Library selects second database as opposite end, and second database selects third database as opposite end, third database
Select first database as opposite end.Shown in Figure 3, Fig. 3 is another database server work provided by the invention
The schematic diagram of process.
It is understood that the unbalanced of database pressure can also be avoided under this mode, but need to record each
The sequence of a database avoids the occurrence of the chaotic situation of backup.
In a specific embodiment, database is sharing storage sets part, and each database server includes a data
Library example, multiple database server shared data banks, i.e. database correspond to the database instance in multiple database servers,
It redoes log and is corresponded with database instance.Shown in Figure 2, Fig. 2 is a kind of database server work provided by the invention
Make the schematic diagram of process.
It is understood that in this embodiment, using sharing storage sets part as database, can make to share the data
The shared data information being written each other of several database instances in library avoids the feelings that Data duplication storage occupies storage resource
Condition improves the resource utilization of storage.
In a further advantageous embodiment, database server includes a database instance and the data built in one
Library, the database instance for including in database correspondence database server.
It is understood that when database is sharing storage sets part, sharing storage sets part here refers to external deposit
Hardware is stored up, in this case, a system will also include storage hardware other than server hardware to be included, of high cost;On and
It states embodiment database is built into database server, therefore, a system only needs that server hardware, drop is arranged
Low cost.
It is further known that database exists in pairs;In each pair of database, the corresponding database instance of a database is only held
Read operation is carried on a shoulder pole, the corresponding database instance of another database only undertakes write operation.Shown in Figure 4, Fig. 4 carries for the present invention
The schematic diagram of another database server course of work supplied.
It is understood that in current database server, database is usually to undertake read-write operation, i.e. database is real
Database of regular meeting pair carries out read operation or write operation;Database pressure can be caused larger, especially in number in this case
When according to library as sharing storage sets part, the read-write operation of multiple database instances can be undertaken, database pressure is excessively concentrated;On and
It states in scheme, read operation and write operation is separated, undertaken respectively by different databases, to reduce the pressure of database.
It should be noted that the opposite end of the type (for shared data bank or internal database) of database, database is set
Set mode and action type (read operation or write operation or read-write operation) that database undertakes, three can be random group
It closes, the scheme combined is within protection scope of the present invention.
It is each data lab setting one to client database the present invention provides a kind of database high availability implementation method,
For database instance Yi Dan be written and read to database, database is corresponding to redo log the interior modification behaviour that can record database
Make, modification operation is sent to the standby daily records in client database later, by the standby days in client database
Will is by modification operation write-in to client database, so that opposite end databases contain the modification situation of the database as standby
Part, once the database corruption, can also subsequently use to the Backup Data in client database, avoid after database corruption it
The case where interior data are lost completely, realizes the High Availabitity of database, and the reliability of database server is high.
The present invention also provides a kind of database servers, including:
Database instance, database instance are used for during reading and writing database, itself grasps the modification of database
Note down to database it is corresponding redo log in;
It redoes log, after receiving modification operation, sends operational order to the database for carrying and changing and operating and refer to
It is fixed in the standby daily records in client database;Wherein, database is consistent with the original state to client database
Standby daily records, after receiving operational order, certainly by the modification operation write-in in the operational order received
The corresponding database of body;
Database.
Preferably, including a database instance and the database built in one, database correspondence database clothes
The database instance for including in business device.
Preferably, database is sharing storage sets part, multiple database server shared data banks, database correspondence
Database instance in multiple database servers redoes log and is corresponded with database instance.Preferably, database is pairs of
In the presence of;In each pair of database, the corresponding database instance of a database only undertakes read operation, another database is corresponding
Database instance only undertakes write operation.
It is each data lab setting one to client database the present invention provides a kind of database server, database is real
Example is Yi Dan be written and read database, and database is corresponding to redo log the interior modification operation that can record database, later
Modification operation is sent to the standby daily records in client database, by that will change the standby daily records in client database
Operation write-in is to client database, so that and opposite end databases contain the modification situation of the database as backup, once
The database corruption can also subsequently be used to the Backup Data in client database, avoid its interior data after database corruption
The case where losing completely, realizes the High Availabitity of database, and the reliability of database server is high.
Above several specific implementation modes are only the preferred embodiment of the present invention, and above several specific embodiments can be with
Arbitrary combination, the embodiment obtained after combination is also within protection scope of the present invention.It should be pointed out that for the art
For those of ordinary skill, relevant speciality technical staff deduced out in the case where not departing from spirit of that invention and concept thereof other change
Into and variation, should all be included in the protection scope of the present invention.
Each embodiment is described by the way of progressive in this specification, the highlights of each of the examples are with other
The difference of embodiment, just to refer each other for identical similar portion between each embodiment.For device disclosed in embodiment
For, since it is corresponded to the methods disclosed in the examples, so description is fairly simple, related place is said referring to method part
It is bright.
It should also be noted that, in the present specification, relational terms such as first and second and the like be used merely to by
One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning
Covering non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only that
A little elements, but also include other elements that are not explicitly listed, or further include for this process, method, article or
The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged
Except there is also other identical elements in the process, method, article or apparatus that includes the element.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention.
Various modifications to these embodiments will be apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest range caused.
Claims (9)
1. a kind of database high availability implementation method is used for database server, which is characterized in that including:
Database instance is during reading and writing database, by itself to the modification operation note of the database to the data
Library is corresponding redo log in;
It is described redo log receive modification operation after, send and carry the operational order of the modification operation to the number
According to library specify in the standby daily records in client database;
After the standby daily records to client database receive the operational order, it will repair described in the operational order
It is described to client database to change operation write-in;Wherein, the database is consistent with the original state to client database.
2. database high availability implementation method according to claim 1, which is characterized in that database exists in pairs, and every
It is mutual to client database each other to two databases in database;
Correspondingly, the group of the group number, size and the standby daily records that redo log of two databases in each pair of database
Number, size correspond to identical respectively.
3. database high availability implementation method according to claim 1, which is characterized in that the database server includes
One database instance and the database built in one, the database correspond to the data for including in the database server
Library example.
4. database high availability implementation method according to claim 1, which is characterized in that the database is shared storage
Component, multiple database servers share the database, and the database corresponds in multiple database servers
Database instance, it is described redo log and the database instance correspond.
5. database high availability implementation method according to claim 3 or 4, which is characterized in that database exists in pairs;Often
To in database, the corresponding database instance of a database only undertakes read operation, the corresponding database of another database
Example only undertakes write operation.
6. a kind of database server, which is characterized in that including:
Database instance, the database instance are used for during reading and writing database, itself repair the database
Change operation note to the database it is corresponding redo log in;
It is described to redo log, after receiving the modification operation, sends and carry the operational order for changing operation extremely
The database it is specified in the standby daily records in client database;Wherein, the database with described to client database
Original state is consistent;
The standby daily records, after receiving operational order, certainly by the modification operation write-in in the operational order received
The corresponding database of body;
The database.
7. database server according to claim 6, which is characterized in that including in a database instance and one
The database set, the database correspond to the database instance for including in the database server.
8. database server according to claim 6, which is characterized in that the database is sharing storage sets part, more
A database server shares the database, and the database corresponds to the database in multiple database servers
Example, described redo log correspond with the database instance.
9. database server according to claim 7 or 8, which is characterized in that database exists in pairs;Each pair of database
In, the corresponding database instance of a database only undertakes read operation, and the corresponding database instance of another database is only held
Carry on a shoulder pole write operation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810330668.0A CN108520069A (en) | 2018-04-13 | 2018-04-13 | A kind of database high availability implementation method and database server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810330668.0A CN108520069A (en) | 2018-04-13 | 2018-04-13 | A kind of database high availability implementation method and database server |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108520069A true CN108520069A (en) | 2018-09-11 |
Family
ID=63432520
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810330668.0A Pending CN108520069A (en) | 2018-04-13 | 2018-04-13 | A kind of database high availability implementation method and database server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108520069A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110764943A (en) * | 2019-10-21 | 2020-02-07 | 中国民航信息网络股份有限公司 | Data processing method and device for Oracle database |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030120669A1 (en) * | 2001-12-26 | 2003-06-26 | Han Mi Kyoung | Duplex structure of main-memory DBMS using log information in diskless environment and method for controlling consistency of data of main-memory DBMS |
CN101794247A (en) * | 2010-03-26 | 2010-08-04 | 天津理工大学 | Real-time database failure recovery method under nested transaction model |
CN102043686A (en) * | 2009-10-20 | 2011-05-04 | 华为技术有限公司 | Disaster tolerance method, backup server and system of memory database |
CN106708663A (en) * | 2016-12-16 | 2017-05-24 | 郑州云海信息技术有限公司 | Automatic backup method and device of database |
-
2018
- 2018-04-13 CN CN201810330668.0A patent/CN108520069A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030120669A1 (en) * | 2001-12-26 | 2003-06-26 | Han Mi Kyoung | Duplex structure of main-memory DBMS using log information in diskless environment and method for controlling consistency of data of main-memory DBMS |
CN102043686A (en) * | 2009-10-20 | 2011-05-04 | 华为技术有限公司 | Disaster tolerance method, backup server and system of memory database |
CN101794247A (en) * | 2010-03-26 | 2010-08-04 | 天津理工大学 | Real-time database failure recovery method under nested transaction model |
CN106708663A (en) * | 2016-12-16 | 2017-05-24 | 郑州云海信息技术有限公司 | Automatic backup method and device of database |
Non-Patent Citations (1)
Title |
---|
贺子_DBA时代: "oracle DG 日志传输小结", 《HTTP://BLOG.ITPUB.NET/29654823/VIEWSPACE-1463568/》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110764943A (en) * | 2019-10-21 | 2020-02-07 | 中国民航信息网络股份有限公司 | Data processing method and device for Oracle database |
CN110764943B (en) * | 2019-10-21 | 2023-05-05 | 中国民航信息网络股份有限公司 | Data processing method and device of Oracle database |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106201338B (en) | Date storage method and device | |
KR101547719B1 (en) | Maintaining data integrity in data servers across data centers | |
US7801846B2 (en) | Generating log sequence identifiers to apply a transaction to a storage system | |
CN107426265A (en) | The synchronous method and apparatus of data consistency | |
CN103051681B (en) | Collaborative type log system facing to distribution-type file system | |
KR20170097132A (en) | System for efficient processing of transaction requests related to an account in a database | |
EP4213038A1 (en) | Data processing method and apparatus based on distributed storage, device, and medium | |
CN105635311A (en) | Method for synchronizing resource pool information in cloud management platform | |
CN110472102A (en) | A kind of data processing method, device, equipment and storage medium | |
CN105677251A (en) | Storage system based on Redis cluster | |
CN106339387B (en) | Increase the method for data synchronization and device of server in a kind of data-base cluster newly | |
CN109144785A (en) | Method and apparatus for Backup Data | |
CN102200944A (en) | Test environment cloning method and system for enterprise resource planning (ERP) system | |
CN105955845A (en) | Data recovery method and device | |
CN108762982B (en) | A kind of database restoring method, apparatus and system | |
CN107580032A (en) | Data processing method, device and equipment | |
CN109862090A (en) | A kind of high degree of safety distribution cloud storage system | |
CN104348793A (en) | Storage server system and storage method for data information | |
US20180121531A1 (en) | Data Updating Method, Device, and Related System | |
CN107111534A (en) | A kind of method and apparatus of data processing | |
CN109408477A (en) | A kind of method, system and associated component that setting group document is locked | |
CN108520069A (en) | A kind of database high availability implementation method and database server | |
CN108776670A (en) | A kind of strange disaster recovery method, system and electronic equipment | |
CN105956046A (en) | Dictionary update method and system, and server | |
CN105488047B (en) | Metadata reading/writing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180911 |