Summary of the invention
Technical matters to be solved by this invention is to provide the database emergency processing method and system that database are carried out active-standby switch under emergency rating.
The technical scheme that the present invention solves the problems of the technologies described above is as follows: a kind of database emergency processing method, comprises the following steps:
Detect the running status of storage facility located at processing plant;
When storage facility located at processing plant is in normal condition, by the real time data synchronization of storage facility located at processing plant in emergent storehouse;
When storage facility located at processing plant breaks down, storage facility located at processing plant is switched to emergent storehouse, and by the DataBase combining address switchover of application system to emergent storehouse;
When storage facility located at processing plant recovers normal condition, storehouse of will meeting an urgent need switches back storage facility located at processing plant, and the reading and writing data reverse sync of carrying out meeting an urgent need within the time period that storage facility located at processing plant breaks down in storehouse is in storage facility located at processing plant.
The invention has the beneficial effects as follows: the mode of the present invention by using oracleActiveDataGuard to be oppositely synchronized to storage facility located at processing plant from emergent storehouse, the record that emergent database data is operated reduced, and effectively shorten the processing time in the past being covered data by sql.And the data of all business covering mode is consistent, convenient and swift, each system oneself is not needed to process covering data.
On the basis of technique scheme, the present invention can also do following improvement.
Further, when storage facility located at processing plant breaks down, also comprise the system identifier obtaining pending operation system, obtain the host information disposed in advance according to system identifier, call host interface according to host information.
Further, describedly storage facility located at processing plant is switched to emergent storehouse and is specially:
The host interface that calling JCF framework provides carries out withdrawing business, handed over service and opening service operations.
Further, described handed over service is realized by the configuration file of JCF framework amendment operation system.
It is further, described that storage facility located at processing plant to be switched to emergent storehouse to comprise emergent storehouse further from read-only status modifier be read/write status.
Further, a kind of database emergent treatment system, comprises detection module, synchronization module, handover module and reverse sync module;
Described detection module, for detecting the running status of storage facility located at processing plant;
Described synchronization module, for when storage facility located at processing plant is in normal condition, by the real time data synchronization of storage facility located at processing plant in emergent storehouse;
Described handover module, for when storage facility located at processing plant breaks down, is switched to emergent storehouse by storage facility located at processing plant, and by the DataBase combining address switchover of application system to emergent storehouse;
Described reverse sync module, for when storage facility located at processing plant recovers normal condition, storehouse of will meeting an urgent need switches back storage facility located at processing plant, and the reading and writing data reverse sync of carrying out meeting an urgent need within the time period that storage facility located at processing plant breaks down in storehouse is in storage facility located at processing plant.
Further, described handover module, when storage facility located at processing plant breaks down, also comprises the system identifier obtaining pending operation system, obtains the host information disposed in advance, call host interface according to host information according to system identifier.
Further, in described handover module, storage facility located at processing plant is switched to emergent storehouse to be specially:
The host interface that calling JCF framework provides carries out withdrawing business, handed over service and opening service operations.
Further, described handed over service is realized by the configuration file of JCF framework amendment operation system.
Further, in described handover module, storage facility located at processing plant being switched to that emergent storehouse to comprise emergent storehouse further from read-only status modifier is read/write status.
Embodiment
Be described principle of the present invention and feature below in conjunction with accompanying drawing, example, only for explaining the present invention, is not intended to limit scope of the present invention.
Embodiment 1
A kind of database emergency processing method, comprises the following steps:
Detect the running status of storage facility located at processing plant;
When storage facility located at processing plant is in normal condition, by the real time data synchronization of storage facility located at processing plant in emergent storehouse;
When storage facility located at processing plant breaks down, storage facility located at processing plant is switched to emergent storehouse, and by the DataBase combining address switchover of application system to emergent storehouse;
When storage facility located at processing plant recovers normal condition, storehouse of will meeting an urgent need switches back storage facility located at processing plant, and the reading and writing data reverse sync of carrying out meeting an urgent need within the time period that storage facility located at processing plant breaks down in storehouse is in storage facility located at processing plant.
The invention has the beneficial effects as follows: the mode of the present invention by using oracleActiveDataGuard to be oppositely synchronized to storage facility located at processing plant from emergent storehouse, the record that emergent database data is operated reduced, and effectively shorten the processing time in the past being covered data by sql.And the data of all business covering mode is consistent, convenient and swift, each system oneself is not needed to process covering data.
When storage facility located at processing plant breaks down, also comprise the system identifier obtaining pending operation system, obtain the host information disposed in advance according to system identifier, call host interface according to host information.
Describedly storage facility located at processing plant is switched to emergent storehouse and is specially:
The host interface that calling JCF framework provides carries out withdrawing business, handed over service and opening service operations.
Described handed over service is realized by the configuration file of JCF framework amendment operation system.
It is described that storage facility located at processing plant to be switched to emergent storehouse to comprise emergent storehouse further from read-only status modifier be read/write status.
As shown in Figure 4, a kind of database emergent treatment system, comprises detection module 1, synchronization module 2, handover module 3 and reverse sync module 4;
Described detection module 1, for detecting the running status of storage facility located at processing plant;
Described synchronization module 2, for when storage facility located at processing plant is in normal condition, by the real time data synchronization of storage facility located at processing plant in emergent storehouse;
Described handover module 3, for when storage facility located at processing plant breaks down, is switched to emergent storehouse by storage facility located at processing plant, and by the DataBase combining address switchover of application system to emergent storehouse;
Described reverse sync module 4, for when storage facility located at processing plant recovers normal condition, storehouse of will meeting an urgent need switches back storage facility located at processing plant, and the reading and writing data reverse sync of carrying out meeting an urgent need within the time period that storage facility located at processing plant breaks down in storehouse is in storage facility located at processing plant.
Described handover module 3, when storage facility located at processing plant breaks down, also comprises the system identifier obtaining pending operation system, obtains the host information disposed in advance, call host interface according to host information according to system identifier.
In described handover module 3, storage facility located at processing plant is switched to emergent storehouse to be specially:
The host interface that calling JCF framework provides carries out withdrawing business, handed over service and opening service operations.
Described handed over service is realized by the configuration file of JCF framework amendment operation system.
In described handover module 3, storage facility located at processing plant being switched to that emergent storehouse to comprise emergent storehouse further from read-only status modifier is read/write status.
In concrete enforcement, the step that program main flow performs is illustrated in figure 1:
When 1, needing that performing database is emergent to be switched, first get pending system identifier;
2, the host information of deployment is got according to ID;
3, call host interface, and implement to switch script, storage facility located at processing plant and emergent storehouse are switched;
4, applied business process is stopped;
5, when contingency management platform is switched to emergent storehouse to operation system from storage facility located at processing plant, step in concrete execution Fig. 2.When being switched to storage facility located at processing plant to operation system from emergent storehouse, perform step in Fig. 3.
Under normal condition, use oracleActiveDataGuard by the real time data synchronization of storage facility located at processing plant in emergent storehouse, now storage facility located at processing plant is read-write state, and emergent storehouse is a read states.
When storage facility located at processing plant breaks down, be first that the software systems be connected on oracle database carry out database switching, switch and comprise two steps:
The active and standby storehouse of oracle database switches;
Application system database connects points to switching;
Contingency management platform manages a lot of operation systems, each operation system is in order to ensure the stability of system, database is all provided with storage facility located at processing plant and sets of data storehouse, emergent storehouse two, when operation system carries out database write operation, be written in storage facility located at processing plant, pass through oracleActiveDataGuard technology again by real time data synchronization in emergent storehouse, data in such maintenance two sets of data storehouse are identical, cannot use once storage facility located at processing plant breaks down, contingency management platform is by a series of operation (flow processing shown in Fig. 2), storage facility located at processing plant is switched on emergent storehouse, to ensure that the operation system the fastest time recovers to use.Storehouse to be produced after recovering needs emergent storehouse to switch back storage facility located at processing plant again.
Fig. 2 is by after database storage facility located at processing plant fault, the active and standby storehouse of database switches by contingency management platform, namely be switched to the process in emergent storehouse from storage facility located at processing plant, the switching of the DataBase combining of system application, the namely handoff procedure of the DataBase combining address of front end applications.
The storage facility located at processing plant of operation system is switched in the concrete processing procedure of processing procedure in emergent storehouse by contingency management platform:
The interface that contingency management platform invoke JCF provides carries out the operation of withdrawing business, switching and opening service, wherein start the operation of service, be that the script provided by calling operation system performs, the switching that database is active and standby, only needs to revise the configuration file in operation system.
1, after JCF receives and stops Service Notification, call the script withdrawing business and perform, if period has call request can automatically to printed words such as foreground responses " emergent switch in, please after a while ";
2, after JCF receives the notice in switch data storehouse, JCF automatically revises the configuration file of operation system and changes the sensing in data in EMS memory storehouse;
3, after JCF receives the notice of the service of opening, the script calling the service of opening performs.
Fig. 3 be when storage facility located at processing plant recover normal after, the contingency management platform storehouse that needs to meet an urgent need switches back storage facility located at processing plant, and by the reading and writing data reverse sync in emergent storehouse to the process in storage facility located at processing plant.
Emergent storehouse to the synchronous implementation of data back of storage facility located at processing plant is, by storage facility located at processing plant being changed into standby storehouse, master library is changed in emergent storehouse into, just restart oracleActiveDataGuard and data are synchronously returned storage facility located at processing plant from emergent storehouse, the benefit of this scheme is that the data covering mode of all business is consistent, convenient and swift, do not need each system oneself to process covering data.
In this method, oracleActiveDataGuard technology is oppositely used for synchronous in storage facility located at processing plant of emergent storehouse, synchronous by bottom data, decreases the number of processes of database, decrease the processing time of data syn-chronization simultaneously.
The advantage of this method is from emergent storehouse to storage facility located at processing plant, and the data back method of synchronization of all business is consistent, convenient and swift, does not need each system oneself to process covering data.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.