CN113609107A - Database management method and device, electronic equipment and storage medium - Google Patents

Database management method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113609107A
CN113609107A CN202111157514.4A CN202111157514A CN113609107A CN 113609107 A CN113609107 A CN 113609107A CN 202111157514 A CN202111157514 A CN 202111157514A CN 113609107 A CN113609107 A CN 113609107A
Authority
CN
China
Prior art keywords
database
log
data
backup
environment node
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
CN202111157514.4A
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.)
Wuhan Sitong Information Service Co ltd
Original Assignee
Wuhan Sitong Information Service 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 Wuhan Sitong Information Service Co ltd filed Critical Wuhan Sitong Information Service Co ltd
Priority to CN202111157514.4A priority Critical patent/CN113609107A/en
Publication of CN113609107A publication Critical patent/CN113609107A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a database management method, a device, electronic equipment and a storage medium, wherein the method comprises the steps of responding to a takeover instruction to monitor a first filing log of a first database to generate a monitoring result, when the monitoring result represents that the first filing log has data updating, obtaining a second filing log obtained by the first database based on the first filing log for data updating, controlling the second database to update a stored backup log in real time according to the second filing log, and triggering the second database to execute synchronous operation according to the updated backup log, so that the second database is consistent with the first data, automatic takeover of the database is realized, complicated manual operation is not needed, and the technical problem that a large amount of human resources are consumed for takeover of the database is solved.

Description

Database management method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of database management technologies, and in particular, to a database management method and apparatus, an electronic device, and a storage medium.
Background
The existing takeover mode for the Windows system DB2 database mainly includes: the full-backed file is copied to the recovery environment and a full-backed recovery is then manually performed at the recovery environment. According to the actual needs of the application scene, the filing log file is copied to the recovery environment at intervals to perform forward rolling operation, so that the consistency of the recovery database and the production database is ensured.
According to the existing takeover mode, the existing takeover mode needs a worker to manually and continuously copy the log file of the production environment to the recovery environment for forward rolling operation, so that the consistency of the data in the two databases can be ensured. Therefore, the manual operation mode is complicated, a large amount of human resources are consumed, and the possibility of manual misoperation exists in the manual operation mode, so that the database synchronization error is caused.
Disclosure of Invention
The embodiment of the invention aims to provide a database management method, a database management device, electronic equipment and a storage medium, which can realize automatic take-over of a database without complicated manual operation so as to solve the technical problem that a large amount of human resources are consumed for take-over of the database.
In a first aspect, to achieve the above object, an embodiment of the present invention provides a database management method applied to a storage server in a database management system, where the database management system further includes a first database disposed on a production environment node and a second database disposed on a recovery environment node; the database management method comprises the following steps:
responding to a take-over instruction, monitoring a first filing log of the first database, and generating a monitoring result;
when the monitoring result indicates that the first archiving log has data updating, acquiring a second archiving log obtained by the first database through data updating based on the first archiving log;
and controlling the second database to update the stored backup log in real time according to the second filing log, and triggering the second database to execute synchronous operation according to the updated backup log.
Further, before the step of monitoring the first archive log of the first database and generating a monitoring result, the database management method further includes:
determining environment nodes corresponding to all IP addresses respectively according to at least two different IP address information, wherein the environment nodes comprise a production environment node and at least one recovery environment node, and the IP address information of the production environment node is different from the IP address information of any recovery environment node;
determining a first database on the production environment node and a second database on at least one recovery environment node according to the equipment information and the database information of each environment node;
acquiring database data and a first filing log of the first database, and respectively backing up the database data and the first filing log to correspondingly generate a data backup set and a backup log;
sending the backup set of data and the backup log to a second database on the at least one recovery environment node.
Further, the step of triggering the second database to execute the synchronization operation according to the updated backup log includes:
determining the data variation of the backup log updated in a preset time interval based on the preset time interval;
and triggering the second database to perform synchronous operation on the data backup set according to the data variation.
Further, the step of triggering the second database to perform the synchronous operation on the data backup set according to the data variation includes:
and when detecting that the backup log has the data variation, triggering the second database to perform forward rolling operation on the data backup set according to the data variation.
Further, the database management method further includes:
and when the production environment is detected to be abnormal, activating the second database to enable the second database to be in a read-write state, and exchanging the IP address of the activated second database with the IP address of the first database.
In a second aspect, to solve the same technical problem, an embodiment of the present invention provides a database management apparatus, applied to a storage server in a database management system, where the database management system further includes a first database disposed on a production environment node and a second database disposed on a recovery environment node; the database management apparatus includes:
the monitoring module is used for responding to a take-over instruction, monitoring a first filing log of the first database and generating a monitoring result;
the updating module is used for acquiring a second filing log obtained by the first database through data updating based on the first filing log when the monitoring result represents that the first filing log has data updating;
and the synchronization module is used for controlling the second database to update the stored backup log in real time according to the second filing log and triggering the second database to execute synchronization operation according to the updated backup log.
Further, the database management apparatus further includes:
the system comprises an address determining module, a recovery environment node and a storage module, wherein the address determining module is used for determining environment nodes corresponding to IP addresses respectively according to at least two different IP address information, each environment node comprises a production environment node and at least one recovery environment node, and the IP address information of the production environment node is different from the IP address information of any recovery environment node;
the database determining module is used for determining a first database on the production environment node and a second database on at least one recovery environment node according to the equipment information and the database information of each environment node;
the backup module is used for acquiring the database data and the first filing log of the first database, and respectively backing up the database data and the first filing log to correspondingly generate a data backup set and a backup log;
a sending module, configured to send the data backup set and the backup log to a second database on the at least one recovery environment node.
Further, the database management apparatus further includes:
and the activation module is used for activating the second database to enable the second database to be in a read-write state when the production environment is detected to be abnormal, and exchanging the IP address of the activated second database with the IP address of the first database.
In a third aspect, to solve the same technical problem, an embodiment of the present invention provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the memory is coupled to the processor, and the processor implements the steps in the database management method according to any one of the above when executing the computer program.
In a fourth aspect, to solve the same technical problem, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored, where the computer program, when running, controls an apparatus in which the computer-readable storage medium is located to perform any one of the steps in the database management method described above.
The embodiment of the invention provides a database management method, a database management device, electronic equipment and a storage medium, wherein when the situation that a first filing log of a first database on a production environment node has data updating is monitored, the updated filing log is obtained, and a second database on a recovery environment node is controlled in real time to update a backup log according to the log, so that the second database can execute synchronous operation according to the updated backup log, automatic take-over of the database can be realized, complicated manual operation is not needed, and the technical problem that a large amount of human resources are consumed for take-over of the database is solved.
Drawings
FIG. 1 is a schematic flow chart of a database management method according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a database management system according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a database management apparatus according to an embodiment of the present invention;
fig. 4 is another schematic structural diagram of a database management apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 6 is another schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
Because the existing takeover mode of the Windows system DB2 database is complicated and has the possibility of human misoperation, which can consume a large amount of human resources and cause the condition of database synchronization error, the embodiment of the invention provides a database management method, which is applied to a storage server of a database management system and is used for managing the database management system, wherein the database management system also comprises a first database arranged on a production environment node and a second database arranged on a recovery environment node, and the storage server is simultaneously hung on the first database and the second database.
Specifically, referring to fig. 1, fig. 1 is a schematic flowchart of a database management method according to an embodiment of the present invention, and as shown in fig. 1, the database management method according to the embodiment of the present invention includes steps 101 to 103;
step 101, responding to the takeover instruction, monitoring a first filing log of a first database, and generating a monitoring result.
In the embodiment, the takeover instruction includes a control instruction input by a user and an automatic triggering instruction stored in the database management system in advance. Specifically, the control instruction input by the user may be an instruction input by a manual input method, or an instruction input by a voice input method, for example, the instructions may be instructions composed of text or voice with the same meaning as "take over open", "take over automatically", and the like; the automatic triggering instruction pre-stored in the database management system may be a timing triggering instruction, for example, a timing triggering automatic takeover instruction of 24:00 every day, and a specific instruction is defined by those skilled in the art according to an actual application scenario, and is not specifically limited herein.
The archiving log is generated after a user executes archiving operation on the first database in advance; the monitoring result is a result generated by monitoring whether the first filing log has data updating or not, and specifically includes a first monitoring result and a second monitoring result, the first monitoring result indicates that the first filing log has data updating, and the second monitoring result indicates that the first filing log does not have data updating.
In this embodiment, before the step of monitoring the first archive log of the first database and generating the monitoring result, the database management method provided in this embodiment further includes: determining environment nodes respectively corresponding to the IP addresses according to at least two different IP address information, wherein the environment nodes comprise a production environment node and at least one recovery environment node, and the IP address information of the production environment node is different from the IP address information of any recovery environment node; determining a first database on the production environment node and a second database on at least one recovery environment node according to the equipment information and the database information of each environment node; acquiring database data and a first filing log of a first database, and respectively backing up the database data and the first filing log to correspondingly generate a data backup set and a backup log; and sending the data backup set and the backup log to at least one second database on the recovery environment node.
It should be noted that the production environment refers to a database environment actually applied by a client, the first database on the production environment node is mainly used for storing application data of the client, the recovery environment refers to a database environment capable of replacing the production environment, and the second database on the recovery environment node is mainly used for storing database data and archive logs, i.e., data backup sets and backup logs, of the first database.
In this embodiment, before performing the automatic takeover of the database, the IP addresses of the production environment node and the recovery environment node, such as nodes, need to be determined, after the production environment node and the recovery environment node are determined, the first database and the second database on the production environment node and the recovery environment node need to be determined according to the production equipment information and the recovery equipment information of the production environment node and the recovery environment node, such as equipment IDs, and the first database information and the second database information matched with each equipment, such as database instance names, database login users, and passwords, after the first database is determined on the production environment node, the database data and the archive log in the first database on the production environment node need to be backed up, and the backed-up database data and the archive log are sent to the second database on the recovery environment node, so that the second database is consistent with the first database.
Different IP addresses are set for the production environment nodes and the recovery environment nodes, such as the nodes, so that the recovery environment nodes can be prevented from occurring together with abnormal conditions when the production environment nodes are abnormal, and the success rate of automatic takeover is improved.
And 102, when the monitoring result indicates that the first archiving log has data updating, acquiring a second archiving log obtained by the first database through data updating based on the first archiving log.
In this embodiment, please refer to fig. 2, fig. 2 is a schematic structural diagram of a database management system according to an embodiment of the present invention, as shown in fig. 2, a database management system 10 includes a storage server 11, a first database 12 disposed on a node of a production environment, and a second database 13 disposed on a node of a recovery environment, where the storage server 11 is mounted on the first database 12, so that the storage server 11 monitors a first archive log of the first database 12, and when it is monitored that there is a data update in the first archive log of the first database 12 on the node of the production environment, the storage server 11 obtains a second archive log obtained by performing the data update; or, when monitoring that the first archive log of the first database 12 has data update, the first database copies the second archive log after data update to the local directory of the storage server 11 in real time.
By copying the archive log updated by the first database 12 into the storage server 11, it can be ensured that when the production environment is abnormal, the second database 13 on the recovery environment node can be subjected to data recovery according to the latest archive log in the storage server 11, so that the second database 13 is consistent with the first database 12 at the latest time as much as possible, thereby replacing the first database 12 on the production environment node, and reducing the loss of the application data of the user on the first database 12.
And 103, controlling the second database to update the stored backup log in real time according to the second filing log, and triggering the second database to execute synchronous operation according to the updated backup log.
Referring to fig. 2, since the storage server 11 is mounted on the second database 13 at the same time, the second database 13 can monitor whether a file in the directory of the storage server 11 mounted to the local is changed, and when the second database 13 monitors that a file in the directory of the storage server 11 is changed, the second archive log is copied to the local and the stored backup log is updated, and a synchronization operation is automatically performed according to the updated backup log, so that the second database 13 is consistent with the first database 12.
Compared with the method of acquiring the updated filing log of the first database in a manual operation mode, the method and the device for acquiring the updated filing log of the first database automatically copy the updated filing log from the directory of the storage server through the second database, can avoid misoperation existing in manual operation such as acquiring wrong log files, and greatly improve the speed and quality of operation and maintenance.
It should be noted that, in the embodiment of the present invention, all the execution commands related to the backup recovery are integrated into the database management system, so that all the process steps provided in the embodiment can be automatically executed, and the speed and quality of operation and maintenance are improved.
In some embodiments, the step of triggering the second database to execute the synchronization operation according to the updated backup log specifically includes: determining the data variation of the updated backup log in a time interval based on a preset time interval; and triggering the second database to perform synchronous operation on the data backup set according to the data variation.
In this embodiment, the preset time interval is a time interval preset by the user and used for triggering the second database to execute the synchronization operation, so that resource waste caused by continuous synchronization operation of the second database is avoided, and thus the operation and maintenance cost is effectively reduced.
Specifically, the preset time interval may be 10 seconds, 1 minute, 30 minutes, 60 minutes, and the like, and the specific time needs to be set according to an actual application scenario, which is not limited herein.
Optionally, in the embodiment of the present invention, a plurality of preset time intervals may be further set for the user to select, for example, the plurality of preset time intervals include a first time interval with the highest priority: 10 seconds, second time interval of general priority: 1 minute and third time interval of lowest priority: and (3) when the priority of the application data stored in the first database by the user is determined to be the highest, automatically adjusting the preset time interval to be the first time interval: and 5, when determining that the priority of the application data stored in the first database by the user is the lowest, automatically adjusting the preset time interval to be a third time interval: for 30 minutes.
According to the priority of the application data stored in the first database by the user, a plurality of different time intervals are set, and the actual requirements of different users can be met, so that the operation and maintenance cost can be reduced, more comprehensive protection can be provided for more important data, the important data of the user can be prevented from being lost, and the user experience is improved.
In other embodiments, the step of triggering the second database to perform the synchronization operation on the data backup set according to the data variation specifically further includes: and when detecting that the backup log has data variation, triggering the second database to perform forward rolling operation on the data backup set according to the data variation.
When the second database monitors that the data variation exists in the storage server directory mounted to the local, the data backup set is subjected to forward rolling operation within a preset time according to the data variation in the backup log, so that operations which exist in the backup log but do not exist in the second database are executed, for example, the transaction is submitted, data is written, and the like.
Optionally, the database management method provided in the embodiment of the present invention further includes: and when the production environment is detected to be abnormal, activating the second database to enable the second database to be in a read-write state, and exchanging the IP address of the activated second database with the IP address of the first database.
In this embodiment, when the first database on the production environment node has a problem and the second database on the production environment node needs to be recovered to provide services, the synchronization operation of the second database is stopped, and the second database is recovered to a read-write state, so that the services can be provided to the outside through the second database.
In summary, the database management method provided in the embodiment of the present invention includes monitoring a first archive log of a first database in response to a takeover instruction to generate a monitoring result, acquiring a second archive log obtained by the first database through data update based on the first archive log when the monitoring result indicates that the first archive log has data update, then controlling a second database to update a stored backup log in real time according to the second archive log, and triggering the second database to execute a synchronization operation according to the updated backup log, so that the second database is consistent with the first data, thereby implementing automatic takeover of the database without complicated manual operations, and solving the technical problem that a large amount of human resources are consumed for takeover of the database.
According to the method described in the foregoing embodiment, the embodiment will be further described from the perspective of a database management apparatus, which may be specifically implemented as an independent entity, or may be implemented by being integrated in an electronic device, such as a terminal, where the terminal may include a mobile phone, a tablet computer, and the like.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a database management apparatus according to an embodiment of the present invention, and as shown in fig. 3, a database management apparatus 300 according to an embodiment of the present invention is applied to a storage server in a database management system, where the database management system further includes a first database disposed on a production environment node and a second database disposed on a recovery environment node; the database management apparatus 300 includes:
the monitoring module 301 is configured to monitor the first archive log of the first database in response to the takeover instruction, and generate a monitoring result.
The updating module 302 is configured to, when the monitoring result indicates that the first archive log has data update, obtain a second archive log obtained by performing data update on the first database based on the first archive log.
And the synchronization module 303 is configured to control the second database to update the stored backup log in real time according to the second archived log, and trigger the second database to execute a synchronization operation according to the updated backup log.
In this embodiment, the synchronization module 303 includes a data amount determination unit and a synchronization unit, and the data amount determination unit is configured to: determining the data variation of the updated backup log in a time interval based on a preset time interval; the synchronization unit is used for: and triggering the second database to perform synchronous operation on the data backup set according to the data variation.
Optionally, the synchronization unit is further specifically configured to: and when detecting that the backup log has data variation, triggering the second database to perform forward rolling operation on the data backup set according to the data variation.
Referring to fig. 4, fig. 4 is another schematic structural diagram of a database management apparatus according to an embodiment of the present invention, and as shown in fig. 4, a database management apparatus 300 according to the embodiment further includes:
an address determining module 304, configured to determine, according to at least two different pieces of IP address information, an environment node corresponding to each IP address respectively.
In this embodiment, the environment nodes include a production environment node and at least one recovery environment node, and the IP address information of the production environment node is different from the IP address information of any recovery environment node.
A database determining module 305, configured to determine a first database on the production environment node and a second database on the at least one recovery environment node according to the device information and the database information of each environment node.
The backup module 306 is configured to obtain database data of the first database and the first archive log, and generate a data backup set and a backup log corresponding to the database data and the first archive log, respectively.
A sending module 307, configured to send the backup set of data and the second database on at least one restore environment node of the backup log.
The activating module 308 is configured to activate the second database to enable the second database to be in a read-write state when detecting that the production environment is abnormal, and exchange the IP address of the activated second database with the IP address of the first database.
In a specific implementation, each of the modules and/or units may be implemented as an independent entity, or may be implemented as one or several entities by any combination, where the specific implementation of each of the modules and/or units may refer to the foregoing method embodiment, and specific achievable beneficial effects also refer to the beneficial effects in the foregoing method embodiment, which are not described herein again.
In addition, referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device may be a mobile terminal such as a smart phone and a tablet computer. As shown in fig. 5, the electronic device 500 includes a processor 501, a memory 502. The processor 501 is electrically connected to the memory 502.
The processor 501 is a control center of the electronic device 500, connects various parts of the whole electronic device by using various interfaces and lines, executes various functions of the electronic device 500 and processes data by running or loading an application program stored in the memory 502 and calling the data stored in the memory 502, thereby monitoring the whole electronic device 500.
In this embodiment, the processor 501 in the electronic device 500 loads instructions corresponding to processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 runs the application programs stored in the memory 502, so as to implement various functions:
responding to the takeover instruction, monitoring a first filing log of a first database, and generating a monitoring result;
when the monitoring result indicates that the first archiving log has data updating, acquiring a second archiving log obtained by the first database through data updating based on the first archiving log;
and controlling the second database to update the stored backup log in real time according to the second filing log, and triggering the second database to execute synchronous operation according to the updated backup log.
The electronic device 500 may implement the steps in any embodiment of the database management method provided in the embodiment of the present invention, and therefore, the beneficial effects that can be achieved by any database management method provided in the embodiment of the present invention can be achieved, for details, see the foregoing embodiment, and are not described herein again.
Referring to fig. 6, fig. 6 is another schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 6, fig. 6 is a specific structural block diagram of the electronic device according to the embodiment of the present invention, where the electronic device may be used to implement the database management method provided in the foregoing embodiment. The electronic device 600 may be a mobile terminal such as a smart phone or a notebook computer.
The RF circuit 610 is used for receiving and transmitting electromagnetic waves, and performs interconversion between the electromagnetic waves and electrical signals, thereby communicating with a communication network or other devices. RF circuit 610 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The RF circuit 610 may communicate with various networks such as the internet, an intranet, a wireless network, or with other devices over a wireless network. The wireless network may comprise a cellular telephone network, a wireless local area network, or a metropolitan area network. The Wireless network may use various Communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (WCDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) (e.g., IEEE802.11 a, IEEE802.11 b, IEEE802.11g and/or IEEE802.11 n), Voice over Internet Protocol (VoIP), world wide Internet Protocol (Microwave Access for micro), and other short message protocols for instant messaging, as well as any other suitable communication protocols, and may even include those that have not yet been developed.
The memory 620 may be used for storing software programs and modules, such as program instructions/modules corresponding to the database management method in the above embodiment, and the processor 680 executes various functional applications and data processing by executing the software programs and modules stored in the memory 620, so as to implement the following functions:
responding to the takeover instruction, monitoring a first filing log of a first database, and generating a monitoring result;
when the monitoring result indicates that the first archiving log has data updating, acquiring a second archiving log obtained by the first database through data updating based on the first archiving log;
and controlling the second database to update the stored backup log in real time according to the second filing log, and triggering the second database to execute synchronous operation according to the updated backup log.
The memory 620 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 620 can further include memory located remotely from the processor 680, which can be connected to the electronic device 600 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input unit 630 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 630 may include a touch sensitive surface 631 as well as other input devices 632. The touch sensitive surface 631, also referred to as a touch display screen or a touch pad, may collect touch operations by a user (e.g., operations by a user on the touch sensitive surface 631 or near the touch sensitive surface 631 using any suitable object or attachment such as a finger, a stylus, etc.) on or near the touch sensitive surface 631 and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 631 may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 680, and can receive and execute commands sent by the processor 680. In addition, the touch sensitive surface 631 may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. The input unit 630 may include other input devices 632 in addition to the touch-sensitive surface 631. In particular, other input devices 632 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 640 may be used to display information input by or provided to a user and various graphical user interfaces of the electronic device 600, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 640 may include a Display panel 641, and optionally, the Display panel 641 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 631 may overlay the display panel 641, and when the touch-sensitive surface 631 detects a touch operation thereon or nearby, the touch operation is transmitted to the processor 680 to determine the type of the touch event, and then the processor 680 provides a corresponding visual output on the display panel 641 according to the type of the touch event. Although in the figure, the touch-sensitive surface 631 and the display panel 641 are shown as two separate components to implement input and output functions, in some embodiments, the touch-sensitive surface 631 and the display panel 641 may be integrated to implement input and output functions.
The electronic device 600 may also include at least one sensor 650, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 641 according to the brightness of ambient light, and a proximity sensor that may generate an interrupt when the folder is closed or closed. As one of the motion sensors, the gravity acceleration sensor may detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile phone is stationary, and may be used for applications of recognizing gestures of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and tapping), and other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor that are further configured to the electronic device 600, which are not described herein again.
Audio circuit 660, speaker 661, and microphone 662 can provide an audio interface between a user and electronic device 600. The audio circuit 660 may transmit the electrical signal converted from the received audio data to the speaker 661, and convert the electrical signal into an audio signal through the speaker 661 for output; on the other hand, the microphone 662 converts the collected sound signal into an electrical signal, which is received by the audio circuit 660 and converted into audio data, which is then processed by the audio data output processor 680 and then passed through the RF circuit 610 to be transmitted to, for example, another terminal, or output to the memory 620 for further processing. The audio circuit 660 may also include an earbud jack to provide communication of peripheral headphones with the electronic device 600.
The electronic device 600, via the transport module 670 (e.g., a Wi-Fi module), may assist the user in receiving requests, sending information, etc., which provides the user with wireless broadband internet access. Although the transmission module 670 is shown in the drawing, it is understood that it does not belong to the essential constitution of the electronic device 600 and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 680 is a control center of the electronic device 600, connects various parts of the entire cellular phone using various interfaces and lines, and performs various functions of the electronic device 600 and processes data by operating or executing software programs and/or modules stored in the memory 620 and calling data stored in the memory 620, thereby integrally monitoring the electronic device. Optionally, processor 680 may include one or more processing cores; in some embodiments, processor 680 may integrate an application processor, which handles primarily the operating system, user interface, applications, etc., and a modem processor, which handles primarily wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 680.
Electronic device 600 also includes a power supply 690 (e.g., a battery) that provides power to the various components, and in some embodiments may be logically coupled to processor 680 via a power management system that may perform functions such as managing charging, discharging, and power consumption. The power supply 690 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown, the electronic device 600 further includes a camera (e.g., a front camera, a rear camera), a bluetooth module, and the like, which are not described in detail herein. Specifically, in this embodiment, the display unit of the electronic device is a touch screen display, the mobile terminal further includes a memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for:
responding to the takeover instruction, monitoring a first filing log of a first database, and generating a monitoring result;
when the monitoring result indicates that the first archiving log has data updating, acquiring a second archiving log obtained by the first database through data updating based on the first archiving log;
and controlling the second database to update the stored backup log in real time according to the second filing log, and triggering the second database to execute synchronous operation according to the updated backup log.
In specific implementation, the above modules may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and specific implementation of the above modules may refer to the foregoing method embodiments, which are not described herein again.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor. To this end, the embodiment of the present invention provides a storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps of any embodiment of the database management method provided in the embodiment of the present invention.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Because the instructions stored in the storage medium can execute the steps in any embodiment of the database management method provided in the embodiment of the present invention, the beneficial effects that can be achieved by any database management method provided in the embodiment of the present invention can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The foregoing describes in detail a database management method, apparatus, electronic device, and storage medium provided in the embodiments of the present application, and specific examples are applied in the present application to explain the principles and implementations of the present application, and the descriptions of the foregoing embodiments are only used to help understand the method and core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application. Moreover, it will be apparent to those skilled in the art that various modifications and adaptations can be made without departing from the principles of the invention, and such modifications and adaptations are intended to be within the scope of the invention.

Claims (10)

1. A database management method is applied to a storage server in a database management system, and the database management system also comprises a first database arranged on a production environment node and a second database arranged on a recovery environment node; the database management method comprises the following steps:
responding to a take-over instruction, monitoring a first filing log of the first database, and generating a monitoring result;
when the monitoring result indicates that the first archiving log has data updating, acquiring a second archiving log obtained by the first database through data updating based on the first archiving log;
and controlling the second database to update the stored backup log in real time according to the second filing log, and triggering the second database to execute synchronous operation according to the updated backup log.
2. The database management method of claim 1, wherein prior to the step of monitoring the first archive log of the first database to generate monitoring results, the database management method further comprises:
determining environment nodes corresponding to all IP addresses respectively according to at least two different IP address information, wherein the environment nodes comprise a production environment node and at least one recovery environment node, and the IP address information of the production environment node is different from the IP address information of any recovery environment node;
determining a first database on the production environment node and a second database on at least one recovery environment node according to the equipment information and the database information of each environment node;
acquiring database data and a first filing log of the first database, and respectively backing up the database data and the first filing log to correspondingly generate a data backup set and a backup log;
sending the backup set of data and the backup log to a second database on the at least one recovery environment node.
3. The database management method of claim 2, wherein the step of triggering the second database to perform a synchronization operation based on the updated backup log comprises:
determining the data variation of the backup log updated in a preset time interval based on the preset time interval;
and triggering the second database to perform synchronous operation on the data backup set according to the data variation.
4. The database management method of claim 3, wherein the step of triggering the second database to synchronize the data backup set according to the data delta comprises:
and when detecting that the backup log has the data variation, triggering the second database to perform forward rolling operation on the data backup set according to the data variation.
5. The database management method of claim 4, further comprising:
and when the production environment is detected to be abnormal, activating the second database to enable the second database to be in a read-write state, and exchanging the IP address of the activated second database with the IP address of the first database.
6. A database management apparatus is applied to a storage server in a database management system, the database management system further comprises a first database arranged on a production environment node and a second database arranged on a recovery environment node; the database management apparatus includes:
the monitoring module is used for responding to a take-over instruction, monitoring a first filing log of the first database and generating a monitoring result;
the updating module is used for acquiring a second filing log obtained by the first database through data updating based on the first filing log when the monitoring result represents that the first filing log has data updating;
and the synchronization module is used for controlling the second database to update the stored backup log in real time according to the second filing log and triggering the second database to execute synchronization operation according to the updated backup log.
7. The database management apparatus of claim 6, further comprising:
the system comprises an address determining module, a recovery environment node and a storage module, wherein the address determining module is used for determining environment nodes corresponding to IP addresses respectively according to at least two different IP address information, each environment node comprises a production environment node and at least one recovery environment node, and the IP address information of the production environment node is different from the IP address information of any recovery environment node;
the database determining module is used for determining a first database on the production environment node and a second database on at least one recovery environment node according to the equipment information and the database information of each environment node;
the backup module is used for acquiring the database data and the first filing log of the first database, and respectively backing up the database data and the first filing log to correspondingly generate a data backup set and a backup log;
a sending module, configured to send the data backup set and the backup log to a second database on the at least one recovery environment node.
8. The database management apparatus of claim 6, further comprising:
and the activation module is used for activating the second database to enable the second database to be in a read-write state when the production environment is detected to be abnormal, and exchanging the IP address of the activated second database with the IP address of the first database.
9. An electronic device comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, the memory being coupled to the processor and the processor, when executing the computer program, implementing the steps in the database management method according to any of claims 1 to 7.
10. A computer-readable storage medium, storing a computer program, wherein when the computer program runs, the computer-readable storage medium controls an apparatus to execute the steps of the database management method according to any one of claims 1 to 7.
CN202111157514.4A 2021-09-30 2021-09-30 Database management method and device, electronic equipment and storage medium Pending CN113609107A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111157514.4A CN113609107A (en) 2021-09-30 2021-09-30 Database management method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111157514.4A CN113609107A (en) 2021-09-30 2021-09-30 Database management method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113609107A true CN113609107A (en) 2021-11-05

Family

ID=78343287

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111157514.4A Pending CN113609107A (en) 2021-09-30 2021-09-30 Database management method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113609107A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114661827A (en) * 2022-05-23 2022-06-24 武汉四通信息服务有限公司 Database taking-over method and device, electronic equipment and storage medium
CN115202929A (en) * 2022-06-22 2022-10-18 广州鼎甲计算机科技有限公司 Database cluster backup system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729290A (en) * 2009-11-04 2010-06-09 中兴通讯股份有限公司 Method and device for realizing business system protection
US8117165B1 (en) * 2008-04-30 2012-02-14 Netapp, Inc. Disk-to-disk backup of database archive logs
CN104239476A (en) * 2014-09-04 2014-12-24 上海天脉聚源文化传媒有限公司 Method, device and system for synchronizing databases
CN106502823A (en) * 2016-09-29 2017-03-15 北京许继电气有限公司 data cloud backup method and system
CN107193871A (en) * 2017-04-12 2017-09-22 腾讯科技(深圳)有限公司 Database recovering method and device
CN107688584A (en) * 2016-08-05 2018-02-13 华为技术有限公司 A kind of method, node and the system of disaster tolerance switching
CN109885426A (en) * 2019-01-29 2019-06-14 广东华伦招标有限公司 Call for bid business datum backup method and system
CN111858184A (en) * 2020-07-31 2020-10-30 深信服科技股份有限公司 Disaster recovery system, disaster recovery method, storage medium and computing device
CN112363807A (en) * 2020-11-27 2021-02-12 上海爱数信息技术股份有限公司 Production system arbitrary time pipe taking system and method thereof
CN112764890A (en) * 2019-10-21 2021-05-07 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for scheduling backup tasks

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8117165B1 (en) * 2008-04-30 2012-02-14 Netapp, Inc. Disk-to-disk backup of database archive logs
CN101729290A (en) * 2009-11-04 2010-06-09 中兴通讯股份有限公司 Method and device for realizing business system protection
CN104239476A (en) * 2014-09-04 2014-12-24 上海天脉聚源文化传媒有限公司 Method, device and system for synchronizing databases
CN107688584A (en) * 2016-08-05 2018-02-13 华为技术有限公司 A kind of method, node and the system of disaster tolerance switching
CN106502823A (en) * 2016-09-29 2017-03-15 北京许继电气有限公司 data cloud backup method and system
CN107193871A (en) * 2017-04-12 2017-09-22 腾讯科技(深圳)有限公司 Database recovering method and device
CN109885426A (en) * 2019-01-29 2019-06-14 广东华伦招标有限公司 Call for bid business datum backup method and system
CN112764890A (en) * 2019-10-21 2021-05-07 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for scheduling backup tasks
CN111858184A (en) * 2020-07-31 2020-10-30 深信服科技股份有限公司 Disaster recovery system, disaster recovery method, storage medium and computing device
CN112363807A (en) * 2020-11-27 2021-02-12 上海爱数信息技术股份有限公司 Production system arbitrary time pipe taking system and method thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114661827A (en) * 2022-05-23 2022-06-24 武汉四通信息服务有限公司 Database taking-over method and device, electronic equipment and storage medium
CN115202929A (en) * 2022-06-22 2022-10-18 广州鼎甲计算机科技有限公司 Database cluster backup system

Similar Documents

Publication Publication Date Title
US10732696B2 (en) Method and apparatus for wake-up control of intelligent terminal
EP3761621B1 (en) Terminal control method and apparatus, and terminal
WO2020192311A1 (en) Master-slave server switching method and apparatus, electronic device and storage medium
EP3499786B1 (en) Data synchronization method, apparatus, storage medium and electronic device
US20160314219A1 (en) Method and apparatus for invoking application programming interface
CN104980455B (en) A kind of multiple terminals method of data synchronization based on cloud storage, device and system
CN108039963B (en) Container configuration method and device and storage medium
WO2014206138A1 (en) Webpage data update method, apparatus and terminal device
CN113609107A (en) Database management method and device, electronic equipment and storage medium
CN111273955A (en) Thermal restoration plug-in optimization method and device, storage medium and electronic equipment
CN107770449B (en) Continuous shooting method, electronic device and storage medium
CN110225106B (en) Data transmission method, device and storage medium
CN112003978A (en) Conference management interface display method and device, storage medium and terminal equipment
CN111935255A (en) Information processing method, device and storage medium
CN106357522B (en) Data sharing method and device
WO2023123614A1 (en) Data processing method and apparatus, terminal, and storage medium
CN113590272A (en) Virtual machine deployment method, device, electronic device and storage medium
WO2021168800A1 (en) Data synchronization method and related product
CN113961380A (en) Cross-application repair method, device, equipment and storage medium
CN112732548A (en) Interface testing method and device
CN106681845B (en) Method and device for managing communication messages
CN109995441B (en) Communication information processing method, device and storage medium
CN108563516A (en) Using data anti-lost method and device, storage medium, electronic equipment
CN114189436B (en) Multi-cluster configuration deployment method and device, electronic equipment and storage medium
CN113032361B (en) Database configuration changing method and device, electronic equipment and storage medium

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

Application publication date: 20211105

RJ01 Rejection of invention patent application after publication