CN107632906A - Database data backup method and device - Google Patents

Database data backup method and device Download PDF

Info

Publication number
CN107632906A
CN107632906A CN201710916910.8A CN201710916910A CN107632906A CN 107632906 A CN107632906 A CN 107632906A CN 201710916910 A CN201710916910 A CN 201710916910A CN 107632906 A CN107632906 A CN 107632906A
Authority
CN
China
Prior art keywords
database
data
source
target client
backup
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710916910.8A
Other languages
Chinese (zh)
Inventor
张健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Nine Bridge Synchronization Software Co Ltd
Original Assignee
Beijing Nine Bridge Synchronization 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 Beijing Nine Bridge Synchronization Software Co Ltd filed Critical Beijing Nine Bridge Synchronization Software Co Ltd
Priority to CN201710916910.8A priority Critical patent/CN107632906A/en
Publication of CN107632906A publication Critical patent/CN107632906A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

This disclosure relates to a kind of database data backup method and device, include detecting whether to need the switching for carrying out master/slave data storehouse, in the case where needing to carry out the switching in master/slave data storehouse, according to source database and the corresponding relation of the line identifier of target client database, source database is switched into backup database from primary database, target client database is switched into primary database from backup database.Using active and standby storehouse switching method, standby storehouse switching can be made master library, standby storehouse is made in the master library switching that will appear from problem, it is not necessary to produces the data syn-chronization in standby storehouse again to master library, improves the utilization ratio of database, ensure that the accuracy of data in database.

Description

Database data backup method and device
Technical field
This disclosure relates to field of computer technology, more particularly to a kind of database data backup method and device.
Background technology
In process of production, in order to prevent the loss of creation data, generally creation data is backed up.Storage production The database of data is master library, and the database backed up to creation data is standby storehouse.
When master library is preserving creation data, there is unpredictable mistake, cause master library to be delayed machine, it is at this moment common Way is by the data syn-chronization in standby storehouse to master library, then recycles master library to carry out production activity.So not only reduce production Efficiency, and the mistake of data may occur during from standby storehouse to master library synchronization.
The content of the invention
In view of this, the present disclosure proposes a kind of database data backup method and device.
According to the one side of the disclosure, there is provided a kind of database data backup method, methods described are applied to destination end, Including:
Detect whether to need the switching for carrying out master/slave data storehouse;
In the case where needing to carry out the switching in master/slave data storehouse, according to source database and the rower of target client database The corresponding relation of knowledge, source database is switched into backup database from primary database, by target client database from Backup Data Storehouse switches to primary database.
In a kind of possible implementation, closed according to source database is corresponding with the line identifier of target client database System, source database is switched into backup database from primary database, by target client database from backup database switching based on Database, including:
Mapping table is sent to source database, the mapping table includes each line identifier and mesh in source database Mark the corresponding relation of each line identifier in client database;
According to extracted from destination end database log file Transaction Identifier, object identity, action type, operation content And line identifier, each transaction file is generated in units of affairs;
Each transaction file is sent to source database, with according to each transaction file and mapping table by mesh The operation backed up in synchronization of client database is marked to source database.
In a kind of possible implementation, methods described also includes:
When target client database initializes, it is other to receive database rank, object rank or table level from source database Data, and generate mapping table in target client database.
In a kind of possible implementation, the action type includes at least one in DML operations and DDL operations.
According to another aspect of the present disclosure, there is provided a kind of database data back-up device, described device are applied to target End, including:
Detection module, for detecting whether needing to carry out the switching in master/slave data storehouse;
Handover module, in the case where needing to carry out the switching in master/slave data storehouse, according to source database and target The corresponding relation of the line identifier of client database, source database is switched into backup database from primary database, by destination end number According to storehouse primary database is switched to from backup database.
In a kind of possible implementation, the handover module includes:
First sending submodule, for sending mapping table to source database, the mapping table includes source The corresponding relation of each line identifier and each line identifier in target client database in database;
Submodule is generated, for according to the Transaction Identifier, object identity, behaviour extracted from destination end database log file Make type, operation content and line identifier, each transaction file is generated in units of affairs;
Second sending submodule, for each transaction file to be sent to source database, with according to each transaction File and mapping table are by the operation backed up in synchronization of target client database to source database.
In a kind of possible implementation, described device also includes:
Initial module, for when target client database initializes, database rank, object level to be received from source database The other or other data of table level, and generate mapping table in target client database.
In a kind of possible implementation, the action type includes at least one in DML operations and DDL operations.
According to another aspect of the present disclosure, there is provided a kind of device for database data backup, including:Processor; For storing the memory of processor-executable instruction;Wherein, the processor is configured as performing the above method.
According to another aspect of the present disclosure, there is provided a kind of non-volatile computer readable storage medium storing program for executing, be stored thereon with Computer program instructions, wherein, the computer program instructions realize the above method when being executed by processor.
The disclosure is by the case where needing to carry out the switching in master/slave data storehouse, according to source database and destination end number According to the corresponding relation of the line identifier in storehouse, source database is switched into backup database from primary database, by target client database Primary database is switched to from backup database, using active and standby storehouse switching method, standby storehouse switching can be made master library, will appear from problem Master library switching make standby storehouse, it is not necessary to the data syn-chronization in standby storehouse be produced again to master library, improve the utilization ratio of database, It ensure that the accuracy of data in database.
According to below with reference to the accompanying drawings becoming to detailed description of illustrative embodiments, the further feature and aspect of the disclosure It is clear.
Brief description of the drawings
Comprising in the description and the accompanying drawing of a part for constitution instruction and specification together illustrate the disclosure Exemplary embodiment, feature and aspect, and for explaining the principle of the disclosure.
Fig. 1 is a kind of flow chart of database data backup method according to an exemplary embodiment.
Fig. 2 is step in a kind of database data backup method according to an example of an exemplary embodiment S102 flow chart.
Fig. 3 is a kind of block diagram of database data back-up device according to an exemplary embodiment.
Fig. 4 is a kind of block diagram of database data back-up device according to an example of an exemplary embodiment.
Fig. 5 is a kind of block diagram of device for database data backup according to an exemplary embodiment.
Fig. 6 is a kind of block diagram of device for database data backup according to an exemplary embodiment.
Embodiment
Describe various exemplary embodiments, feature and the aspect of the disclosure in detail below with reference to accompanying drawing.It is identical in accompanying drawing Reference represent the same or analogous element of function.Although the various aspects of embodiment are shown in the drawings, remove Non-specifically point out, it is not necessary to accompanying drawing drawn to scale.
Special word " exemplary " is meant " being used as example, embodiment or illustrative " herein.Here as " exemplary " Illustrated any embodiment should not necessarily be construed as preferred or advantageous over other embodiments.
In addition, in order to better illustrate the disclosure, numerous details is given in embodiment below. It will be appreciated by those skilled in the art that without some details, the disclosure can equally be implemented.In some instances, for Method, means, element and circuit well known to those skilled in the art are not described in detail, in order to highlight the purport of the disclosure.
Fig. 1 is a kind of flow chart of database data backup method according to an exemplary embodiment, such as Fig. 1 institutes Show, methods described includes step S101 and step S102.
In step S101, detect whether to need the switching for carrying out master/slave data storehouse.
In step s 102, in the case where needing to carry out the switching in master/slave data storehouse, according to source database and target The corresponding relation of the line identifier of client database, source database is switched into backup database from primary database, by destination end number According to storehouse primary database is switched to from backup database.
In a kind of possible implementation, the type of database includes but is not limited to Types Below:Oracle data Storehouse, SQL (Structured Query Language, SQL) database D B2 databases, INFORMIX data Storehouse.
, it is necessary to which carrying out the situation of the switching in master/slave data storehouse can include in a kind of possible implementation:Master data Storehouse transaction failure, the system failure and media failure.
The present embodiment is by the case where needing to carry out the switching in master/slave data storehouse, according to source database and destination end The corresponding relation of the line identifier of database, source database is switched into backup database from primary database, by target end data Storehouse switches to primary database (abbreviation master library) from backup database (referred to as storehouse).Active and standby storehouse is carried out using disclosed method to cut Change, standby storehouse switching can be made master library, standby storehouse is made in the master library switching that will appear from problem, it is not necessary to by the data syn-chronization in standby storehouse to master library Produced again, improve the utilization ratio of database, ensure that the accuracy of data in database.
Fig. 2 is step in a kind of database data backup method according to an example of an exemplary embodiment S102 flow chart, as shown in Fig. 2 the step S102 includes step S201 to step S203.
In step s 201, mapping table is sent to source database, the mapping table includes source database In in each line identifier and target client database each line identifier (ROWID) corresponding relation.
In step S202, according to the Transaction Identifier, object identity, operation extracted from destination end database log file Type, operation content and line identifier, each transaction file is generated in units of affairs.
In step S203, each transaction file is sent to source database, with according to each transaction file and Mapping table is by the operation backed up in synchronization of target client database to source database.
As an example of the present embodiment, methods described also includes:When target client database initializes, from source number Database rank, object rank or the other data of table level are received according to storehouse, and mapping table is generated in target client database.Its In, the target client database, will be each in the other data of the database rank, object rank or table level that are received described in loading The data are corresponding in the line identifier of target database with each data in the line identifier of source database, form mapping and close It is table.
In the disclosure, multiple mapped files can be included in mapping table, each mapped file is with a table Affairs ID is the catalogue that name creates, and by the correspondence of destination end loading data and source database corresponding to the affairs per a line ROWID mapping relations are write in the file in this catalogue, so that inquiry next time uses.
In the disclosure, the action type includes DML (data manipulation language, database manipulation Language) operate and at least one in DDL (data definition language, data pattern definitional language) operations.
This example makes source by the way that the mapping table of target client database and transaction file are sent to source database Database can be run according to mapping table and transaction file as standby storehouse.So as to quickly realize active and standby storehouse switching, improve The utilization ratio of database.
To be run in source database as master library as applying example:
Source captures and analyzes the online daily record of target client database and archive log, in units of affairs, will analyze and Data formed transaction file by TCP/IP (Transmission Control Protocol/Internet Protocol, Transmission control protocol/Internet Protocol), it is transferred to destination end and forms corresponding transaction file.
Destination end carries out data syn-chronization according to the transaction file, and the mapping table is handled accordingly.
If for example, the transaction file includes insertion operation, obtain the insertion operation and business ID (marks are being acted corresponding to source Know), row data ID (mark) and ROWID (line identifier).Operation data (example corresponding to the insertion operation is being loaded from destination end Such as, destination end performs corresponding insertion operation) when, obtain it and deposit corresponding ROWID in destination end.Then, by the insertion operation It is added in the mapping relations of source, the ROWID of target client database in mapping table.
If for example, the transaction file includes deletion action, obtain the insertion operation and business ID (marks are being acted corresponding to source Know), row data ID (mark) and ROWID (line identifier).Operation data (example corresponding to the deletion action is being loaded from destination end Such as, destination end performs corresponding deletion action) when, obtain it and deposit corresponding ROWID in destination end.Then, from mapping table It is middle to delete the deletion action in source, the ROWID of target client database mapping relations.
If operated for example, the transaction file includes renewal, data syn-chronization only is carried out in target end data, does not change and reflects Penetrate relation table.
This example is reflected it is possible thereby to according to the simultaneously operating of target client database to what is formed during destination end data initialization Penetrate relation table to be updated, so that the mapping table after renewal can reflect the synchronous regime of target client database in real time, have When switching beneficial to active and standby storehouse, master library is switched fast as standby storehouse according to the mapping table after renewal.
When being switched with active and standby storehouse, target client database is used as master library operation and applies example:
Database switch mode is set respectively in source and destination end.When being broken down in source data, destination end number Primary database is can be used as according to storehouse to use.Meanwhile source database can switch to standby storehouse, specifically include:
First, source obtains the mapping table for coming from target client database and is stored in source database.
Secondly, when target client database is run as master library, capture and analyze the online daily record of target client database and return Shelves daily record.In units of affairs, the data formation transaction file come will be analyzed by ICP/IP protocol, source is transferred to and is formed Corresponding transaction file.
Source data carry out data according to the mapping table for coming from target client database and the transaction file It is synchronous, and the mapping table is updated, realize the backed up in synchronization function in standby storehouse.
Fig. 3 is a kind of block diagram of database data back-up device according to an exemplary embodiment.As shown in figure 3, Described device includes:Detection module 11 and handover module 12.
The detection module 11, for detecting whether needing to carry out the switching in master/slave data storehouse;
The handover module 12, in the case where needing to carry out the switching in master/slave data storehouse, according to source database with The corresponding relation of the line identifier of target client database, source database is switched into backup database from primary database, by target Client database switches to primary database from backup database.
Fig. 4 is a kind of block diagram of database data back-up device according to an example of an exemplary embodiment. Label has identical function with Fig. 3 identical components in Fig. 4, for brevity, omits the detailed description to these components. As shown in Figure 4:
In a kind of possible implementation, the handover module 12 includes:First sending submodule 121, generation submodule The sending submodule 123 of block 122 and second.
First sending submodule 121, for sending mapping table to source database, the mapping table includes The corresponding relation of each line identifier and each line identifier in target client database in source database;
The generation submodule 122, for according to Transaction Identifier, the object mark extracted from destination end database log file Knowledge, action type, operation content and line identifier, each transaction file is generated in units of affairs;
Second sending submodule 123, for each transaction file to be sent to source database, with according to each described Transaction file and mapping table are by the operation backed up in synchronization of target client database to source database.
In a kind of possible implementation, described device also includes:
Initial module 13, for when target client database initializes, database rank, object to be received from source database Rank or the other data of table level, and generate mapping table in target client database.
In a kind of possible implementation, the action type includes at least one in DML operations and DDL operations.
Fig. 5 is a kind of block diagram of device for database data backup according to an exemplary embodiment.For example, Device 800 can be mobile phone, computer, digital broadcast terminal, messaging devices, game console, tablet device, cure Treat equipment, body-building equipment, personal digital assistant etc..
Reference picture 5, device 800 can include following one or more assemblies:Processing component 802, memory 804, power supply Component 806, multimedia groupware 808, audio-frequency assembly 810, the interface 812 of input/output (I/O), sensor cluster 814, and Communication component 816.
The integrated operation of the usual control device 800 of processing component 802, such as communicated with display, call, data, phase The operation that machine operates and record operation is associated.Processing component 802 can refer to including one or more processors 820 to perform Order, to complete all or part of step of above-mentioned method.In addition, processing component 802 can include one or more modules, just Interaction between processing component 802 and other assemblies.For example, processing component 802 can include multi-media module, it is more to facilitate Interaction between media component 808 and processing component 802.
Memory 804 is configured as storing various types of data to support the operation in device 800.These data are shown Example includes the instruction of any application program or method for being operated on device 800, contact data, telephone book data, disappears Breath, picture, video etc..Memory 804 can be by any kind of volatibility or non-volatile memory device or their group Close and realize, as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM) are erasable to compile Journey read-only storage (EPROM), programmable read only memory (PROM), read-only storage (ROM), magnetic memory, flash Device, disk or CD.
Power supply module 806 provides electric power for the various assemblies of device 800.Power supply module 806 can include power management system System, one or more power supplys, and other components associated with generating, managing and distributing electric power for device 800.
Multimedia groupware 808 is included in the screen of one output interface of offer between described device 800 and user.One In a little embodiments, screen can include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen Curtain may be implemented as touch-screen, to receive the input signal from user.Touch panel includes one or more touch sensings Device is with the gesture on sensing touch, slip and touch panel.The touch sensor can not only sensing touch or sliding action Border, but also detect and touched or the related duration and pressure of slide with described.In certain embodiments, more matchmakers Body component 808 includes a front camera and/or rear camera.When device 800 is in operator scheme, such as screening-mode or During video mode, front camera and/or rear camera can receive outside multi-medium data.Each front camera and Rear camera can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio-frequency assembly 810 is configured as output and/or input audio signal.For example, audio-frequency assembly 810 includes a Mike Wind (MIC), when device 800 is in operator scheme, during such as call model, logging mode and speech recognition mode, microphone by with It is set to reception external audio signal.The audio signal received can be further stored in memory 804 or via communication set Part 816 is sent.In certain embodiments, audio-frequency assembly 810 also includes a loudspeaker, for exports audio signal.
I/O interfaces 812 provide interface between processing component 802 and peripheral interface module, and above-mentioned peripheral interface module can To be keyboard, click wheel, button etc..These buttons may include but be not limited to:Home button, volume button, start button and lock Determine button.
Sensor cluster 814 includes one or more sensors, and the state for providing various aspects for device 800 is commented Estimate.For example, sensor cluster 814 can detect opening/closed mode of device 800, and the relative positioning of component, for example, it is described Component is the display and keypad of device 800, and sensor cluster 814 can be with 800 1 components of detection means 800 or device Position change, the existence or non-existence that user contacts with device 800, the orientation of device 800 or acceleration/deceleration and device 800 Temperature change.Sensor cluster 814 can include proximity transducer, be configured to detect in no any physical contact The presence of neighbouring object.Sensor cluster 814 can also include optical sensor, such as CMOS or ccd image sensor, for into As being used in application.In certain embodiments, the sensor cluster 814 can also include acceleration transducer, gyro sensors Device, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 816 is configured to facilitate the communication of wired or wireless way between device 800 and other equipment.Device 800 can access the wireless network based on communication standard, such as WiFi, 2G or 3G, or combinations thereof.In an exemplary implementation In example, communication component 816 receives broadcast singal or broadcast related information from external broadcasting management system via broadcast channel. In one exemplary embodiment, the communication component 816 also includes near-field communication (NFC) module, to promote junction service.Example Such as, in NFC module radio frequency identification (RFID) technology can be based on, Infrared Data Association (IrDA) technology, ultra wide band (UWB) technology, Bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, device 800 can be believed by one or more application specific integrated circuits (ASIC), numeral Number processor (DSP), digital signal processing appts (DSPD), PLD (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for performing the above method.
In the exemplary embodiment, a kind of non-volatile computer readable storage medium storing program for executing is additionally provided, such as including calculating The memory 804 of machine programmed instruction, above computer programmed instruction can be performed above-mentioned to complete by the processor 820 of device 800 Method.
Fig. 6 is a kind of block diagram of device for database data backup according to an exemplary embodiment.For example, Device 1900 may be provided in a server.Reference picture 6, device 1900 include processing component 1922, and it further comprises one Individual or multiple processors, and as the memory resource representated by memory 1932, can be by processing component 1922 for storing The instruction of execution, such as application program.The application program stored in memory 1932 can include one or more every One module for corresponding to one group of instruction.In addition, processing component 1922 is configured as execute instruction, to perform the above method.
Device 1900 can also include a power supply module 1926 and be configured as the power management of performs device 1900, one Wired or wireless network interface 1950 is configured as device 1900 being connected to network, and input and output (I/O) interface 1958.Device 1900 can be operated based on the operating system for being stored in memory 1932, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or similar.
In the exemplary embodiment, a kind of non-volatile computer readable storage medium storing program for executing is additionally provided, such as including calculating The memory 1932 of machine programmed instruction, above computer programmed instruction can be performed by the processing component 1922 of device 1900 to complete The above method.
The disclosure can be system, method and/or computer program product.Computer program product can include computer Readable storage medium storing program for executing, containing for making processor realize the computer-readable program instructions of various aspects of the disclosure.
Computer-readable recording medium can keep and store to perform the tangible of the instruction that uses of equipment by instruction Equipment.Computer-readable recording medium for example can be-- but be not limited to-- storage device electric, magnetic storage apparatus, optical storage Equipment, electromagnetism storage device, semiconductor memory apparatus or above-mentioned any appropriate combination.Computer-readable recording medium More specifically example (non exhaustive list) includes:Portable computer diskette, hard disk, random access memory (RAM), read-only deposit It is reservoir (ROM), erasable programmable read only memory (EPROM or flash memory), static RAM (SRAM), portable Compact disk read-only storage (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanical coding equipment, for example thereon It is stored with punch card or groove internal projection structure and the above-mentioned any appropriate combination of instruction.Calculating used herein above Machine readable storage medium storing program for executing is not construed as instantaneous signal in itself, the electromagnetic wave of such as radio wave or other Free propagations, leads to Cross the electromagnetic wave (for example, the light pulse for passing through fiber optic cables) of waveguide or the propagation of other transmission mediums or transmitted by electric wire Electric signal.
Computer-readable program instructions as described herein can be downloaded to from computer-readable recording medium it is each calculate/ Processing equipment, or outer computer or outer is downloaded to by network, such as internet, LAN, wide area network and/or wireless network Portion's storage device.Network can include copper transmission cable, optical fiber is transmitted, is wirelessly transferred, router, fire wall, interchanger, gateway Computer and/or Edge Server.Adapter or network interface in each calculating/processing equipment receive from network to be counted Calculation machine readable program instructions, and the computer-readable program instructions are forwarded, for the meter being stored in each calculating/processing equipment In calculation machine readable storage medium storing program for executing.
For perform the disclosure operation computer program instructions can be assembly instruction, instruction set architecture (ISA) instruction, Machine instruction, machine-dependent instructions, microcode, firmware instructions, condition setup data or with one or more programming languages The source code or object code that any combination is write, programming language of the programming language including object-oriented-such as Smalltalk, C++ etc., and conventional procedural programming languages-such as " C " language or similar programming language.Computer Readable program instructions fully can on the user computer perform, partly perform on the user computer, be only as one Vertical software kit performs, part performs or completely in remote computer on the remote computer on the user computer for part Or performed on server.In the situation of remote computer is related to, remote computer can pass through network-bag of any kind LAN (LAN) or wide area network (WAN)-be connected to subscriber computer are included, or, it may be connected to outer computer (such as profit Pass through Internet connection with ISP).In certain embodiments, by using computer-readable program instructions Status information carry out personalized customization electronic circuit, such as PLD, field programmable gate array (FPGA) or can Programmed logic array (PLA) (PLA), the electronic circuit can perform computer-readable program instructions, so as to realize each side of the disclosure Face.
Referring herein to the method, apparatus (system) according to the embodiment of the present disclosure and the flow chart of computer program product and/ Or block diagram describes various aspects of the disclosure.It should be appreciated that each square frame and flow chart of flow chart and/or block diagram and/ Or in block diagram each square frame combination, can be realized by computer-readable program instructions.
These computer-readable program instructions can be supplied to all-purpose computer, special-purpose computer or other programmable datas The processor of processing unit, so as to produce a kind of machine so that these instructions are passing through computer or other programmable datas During the computing device of processing unit, work(specified in one or more of implementation process figure and/or block diagram square frame is generated The device of energy/action.These computer-readable program instructions can also be stored in a computer-readable storage medium, these refer to Order causes computer, programmable data processing unit and/or other equipment to work in a specific way, so as to be stored with instruction Computer-readable medium then includes a manufacture, and it is included in one or more of implementation process figure and/or block diagram square frame The instruction of the various aspects of defined function/action.
Computer-readable program instructions can also be loaded into computer, other programmable data processing units or other In equipment so that series of operation steps is performed on computer, other programmable data processing units or miscellaneous equipment, with production Raw computer implemented process, so that performed on computer, other programmable data processing units or miscellaneous equipment Instruct function/action specified in one or more of implementation process figure and/or block diagram square frame.
Flow chart and block diagram in accompanying drawing show the system, method and computer journey of multiple embodiments according to the disclosure Architectural framework in the cards, function and the operation of sequence product.At this point, each square frame in flow chart or block diagram can generation One module of table, program segment or a part for instruction, the module, program segment or a part for instruction include one or more use In the executable instruction of logic function as defined in realization.At some as the function of in the realization replaced, being marked in square frame Can be with different from the order marked in accompanying drawing generation.For example, two continuous square frames can essentially be held substantially in parallel OK, they can also be performed in the opposite order sometimes, and this is depending on involved function.It is also noted that block diagram and/or The combination of each square frame and block diagram in flow chart and/or the square frame in flow chart, function or dynamic as defined in performing can be used The special hardware based system made is realized, or can be realized with the combination of specialized hardware and computer instruction.
It is described above the presently disclosed embodiments, described above is exemplary, and non-exclusive, and It is not limited to disclosed each embodiment.In the case of without departing from the scope and spirit of illustrated each embodiment, for this skill Many modifications and changes will be apparent from for the those of ordinary skill in art field.The selection of term used herein, purport Best explaining the principle of each embodiment, practical application or to the technological improvement in market, or make the art its Its those of ordinary skill is understood that each embodiment disclosed herein.

Claims (10)

  1. A kind of 1. database data backup method, it is characterised in that methods described is applied to destination end, including:
    Detect whether to need the switching for carrying out master/slave data storehouse;
    In the case where needing to carry out the switching in master/slave data storehouse, according to source database and the line identifier of target client database Corresponding relation, backup database is switched to by source database from primary database, and target client database is cut from backup database It is changed to primary database.
  2. 2. according to the method for claim 1, it is characterised in that according to source database and the line identifier of target client database Corresponding relation, source database is switched into backup database from primary database, by target client database from backup database Primary database is switched to, including:
    Mapping table is sent to source database, the mapping table includes each line identifier and destination end in source database The corresponding relation of each line identifier in database;
    According to Transaction Identifier, object identity, action type, operation content and the row extracted from destination end database log file Mark, generates each transaction file in units of affairs;
    Each transaction file is sent to source database, with according to each transaction file and mapping table by destination end The operation backed up in synchronization of database is to source database.
  3. 3. according to the method for claim 2, it is characterised in that methods described also includes:
    When target client database initializes, database rank, object rank or the other data of table level are received from source database, And generate mapping table in target client database.
  4. 4. according to the method in any one of claims 1 to 3, it is characterised in that the action type include DML operation and At least one of in DDL operations.
  5. A kind of 5. database data back-up device, it is characterised in that described device is applied to destination end, including:
    Detection module, for detecting whether needing to carry out the switching in master/slave data storehouse;
    Handover module, in the case where needing to carry out the switching in master/slave data storehouse, according to source database and destination end number According to the corresponding relation of the line identifier in storehouse, source database is switched into backup database from primary database, by target client database Primary database is switched to from backup database.
  6. 6. device according to claim 5, it is characterised in that the handover module includes:
    First sending submodule, for sending mapping table to source database, the mapping table includes source data The corresponding relation of each line identifier and each line identifier in target client database in storehouse;
    Submodule is generated, for according to the Transaction Identifier, object identity, operation class extracted from destination end database log file Type, operation content and line identifier, each transaction file is generated in units of affairs;
    Second sending submodule, for each transaction file to be sent to source database, with according to each transaction file With mapping table by the operation backed up in synchronization of target client database to source database.
  7. 7. device according to claim 6, it is characterised in that described device also includes:
    Initial module, for when target client database initializes, from source database receive database rank, object rank or The other data of table level, and generate mapping table in target client database.
  8. 8. the device according to any one of claim 5 to 7, it is characterised in that the action type include DML operation and At least one of in DDL operations.
  9. A kind of 9. device for database data backup, it is characterised in that including:
    Processor;
    For storing the memory of processor-executable instruction;
    Wherein, the processor is configured as:
    Method in perform claim requirement 1 to 4 described in any one.
  10. 10. a kind of non-volatile computer readable storage medium storing program for executing, is stored thereon with computer program instructions, it is characterised in that institute State and method in Claims 1-4 described in any one is realized when computer program instructions are executed by processor.
CN201710916910.8A 2017-09-30 2017-09-30 Database data backup method and device Pending CN107632906A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710916910.8A CN107632906A (en) 2017-09-30 2017-09-30 Database data backup method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710916910.8A CN107632906A (en) 2017-09-30 2017-09-30 Database data backup method and device

Publications (1)

Publication Number Publication Date
CN107632906A true CN107632906A (en) 2018-01-26

Family

ID=61105094

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710916910.8A Pending CN107632906A (en) 2017-09-30 2017-09-30 Database data backup method and device

Country Status (1)

Country Link
CN (1) CN107632906A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362556A (en) * 2019-07-12 2019-10-22 优刻得科技股份有限公司 Operating method, system, equipment and the medium of database

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080086516A1 (en) * 2006-10-04 2008-04-10 Oracle International Automatically changing a database system's redo transport mode to dynamically adapt to changing workload and network conditions
CN102375890A (en) * 2011-11-02 2012-03-14 杭州合众信息工程有限公司 Data synchronization method for source terminal table of database without major key
CN103226502A (en) * 2013-05-21 2013-07-31 中国工商银行股份有限公司 Data disaster backup control system and data recovery method
CN103345470A (en) * 2013-05-31 2013-10-09 深圳市沃信科技有限公司 Database disaster tolerance method, database disaster tolerance system and server
CN104346479A (en) * 2014-11-26 2015-02-11 北京奇虎科技有限公司 Database synchronization method and database synchronization device
CN104572672A (en) * 2013-10-15 2015-04-29 北大方正集团有限公司 Heterogeneous database synchronization method and application system
CN106202075A (en) * 2015-04-29 2016-12-07 中兴通讯股份有限公司 A kind of method and device of data base's active-standby switch
CN106649378A (en) * 2015-11-02 2017-05-10 北大方正集团有限公司 Data synchronizing method and device
CN106909568A (en) * 2015-12-23 2017-06-30 北京奇虎科技有限公司 A kind of changing method and device of data-base cluster MDL
CN107066354A (en) * 2017-04-18 2017-08-18 中国银联股份有限公司 A kind of switching method of database, master server and from server

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080086516A1 (en) * 2006-10-04 2008-04-10 Oracle International Automatically changing a database system's redo transport mode to dynamically adapt to changing workload and network conditions
CN102375890A (en) * 2011-11-02 2012-03-14 杭州合众信息工程有限公司 Data synchronization method for source terminal table of database without major key
CN103226502A (en) * 2013-05-21 2013-07-31 中国工商银行股份有限公司 Data disaster backup control system and data recovery method
CN103345470A (en) * 2013-05-31 2013-10-09 深圳市沃信科技有限公司 Database disaster tolerance method, database disaster tolerance system and server
CN104572672A (en) * 2013-10-15 2015-04-29 北大方正集团有限公司 Heterogeneous database synchronization method and application system
CN104346479A (en) * 2014-11-26 2015-02-11 北京奇虎科技有限公司 Database synchronization method and database synchronization device
CN106202075A (en) * 2015-04-29 2016-12-07 中兴通讯股份有限公司 A kind of method and device of data base's active-standby switch
CN106649378A (en) * 2015-11-02 2017-05-10 北大方正集团有限公司 Data synchronizing method and device
CN106909568A (en) * 2015-12-23 2017-06-30 北京奇虎科技有限公司 A kind of changing method and device of data-base cluster MDL
CN107066354A (en) * 2017-04-18 2017-08-18 中国银联股份有限公司 A kind of switching method of database, master server and from server

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362556A (en) * 2019-07-12 2019-10-22 优刻得科技股份有限公司 Operating method, system, equipment and the medium of database

Similar Documents

Publication Publication Date Title
CN104219388B (en) Sound control method and device
CN105182784A (en) Method and device of controlling intelligent devices and terminal
CN107678888A (en) database data backup method and device
CN104503740A (en) Memory management method and device
CN104378441A (en) Schedule creating method and device
CN104793846A (en) Displaying method and device for interface of application program
CN104702762A (en) Incoming call reminding method and incoming call reminding device
CN104679599A (en) Application program duplicating method and device
CN104967683A (en) Message pushing method, terminal and server
CN105117207A (en) Album creating method and apparatus
CN106960014A (en) Association user recommends method and device
CN104636164A (en) Generating method and device for starting page
CN105354284A (en) Template processing method and apparatus and short message identification method and apparatus
CN108874585A (en) File backup method, apparatus and system
CN108156506A (en) The progress adjustment method and device of barrage information
CN107895190A (en) The weights quantization method and device of neural network model
CN108062364A (en) Information displaying method and device
CN106850813A (en) Network service address changing method and device
CN104038922B (en) File synchronisation method and relevant apparatus
CN104375760B (en) Method for information display and device
CN111857497A (en) Operation prompting method and electronic equipment
CN105468281A (en) Setup interface display method and device
CN106998493A (en) The method for previewing and device of video
CN104240274A (en) Face image processing method and device
CN107632906A (en) Database data backup 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: 20180126