CN113157701A - Dual-activity mechanism deployment method and device of ORACLE database - Google Patents
Dual-activity mechanism deployment method and device of ORACLE database Download PDFInfo
- Publication number
- CN113157701A CN113157701A CN202110458301.9A CN202110458301A CN113157701A CN 113157701 A CN113157701 A CN 113157701A CN 202110458301 A CN202110458301 A CN 202110458301A CN 113157701 A CN113157701 A CN 113157701A
- Authority
- CN
- China
- Prior art keywords
- database
- data
- synchronized
- transaction
- oracle
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000007246 mechanism Effects 0.000 title claims abstract description 47
- 238000000034 method Methods 0.000 title claims abstract description 39
- 230000009977 dual effect Effects 0.000 title claims abstract description 13
- 230000001360 synchronised effect Effects 0.000 claims abstract description 67
- 230000002085 persistent effect Effects 0.000 claims abstract description 7
- 238000004590 computer program Methods 0.000 claims description 21
- 230000002159 abnormal effect Effects 0.000 claims description 13
- 230000008676 import Effects 0.000 claims description 6
- 230000002688 persistence Effects 0.000 claims description 4
- 230000000694 effects Effects 0.000 claims description 3
- 238000012545 processing Methods 0.000 abstract description 9
- 238000010586 diagram Methods 0.000 description 16
- 230000006870 function Effects 0.000 description 9
- 230000005856 abnormality Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000000926 separation method Methods 0.000 description 2
- 230000002411 adverse Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24553—Query execution of query operations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/02—Banking, e.g. interest calculation or account maintenance
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Data Mining & Analysis (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Economics (AREA)
- General Business, Economics & Management (AREA)
- Technology Law (AREA)
- Computational Linguistics (AREA)
- Strategic Management (AREA)
- Marketing (AREA)
- Development Economics (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a dual-activity mechanism deployment method and a device of an ORACLE database, which can be used in the technical field of data processing and comprises the following steps: building a second database; creating a Topic needing a synchronization table by using a distributed message service; setting a database synchronization component, and introducing transaction application in a Maven mode; judging a transaction occurrence park, a database table and an operation type according to a transaction occurring in the transaction application, and selecting the database to access according to a judgment result; after the transaction execution of the transaction application is completed, inquiring the full information of the data to be synchronized by referring to the annotation provided by the database synchronization component, and writing the data to be synchronized into the appointed Topic by the database synchronization component; and newly establishing a consumer group of the data to be synchronized, subscribing the appointed Topic by the consumer group, pulling the message to be synchronized, and persisting the message to the current database according to the data in the current database and the data timestamp in the message to be synchronized.
Description
Technical Field
The invention relates to the technical field of data processing, in particular to a method and a device for deploying a dual-activity mechanism of an Oracle database.
Background
Currently, the transaction application from the bank uses an Oracle database when storing the application transaction data, such as "merchant's" of a business bank. Referring to fig. 6, a schematic diagram of a prior art arrangement of merchants is shown. The database is usually deployed in a master-standby mode, and database synchronization between the master database and the standby database is realized through Oracle DataGuard. When the hardware of the main database system or the resource domain where the main database system is located is abnormal, the main-standby switching is completed through a main-standby switching mechanism provided by Oracle, and at least 30 minutes are required from the emergency main-standby switching work to the normal service providing of the standby database, and the application cannot provide the service to the outside normally.
The transaction application is a main tool for bank service bill receiving merchants, so that services required by daily business such as payment success notification, detailed inquiry, statement inquiry and the like are provided for the merchants, and service interruption caused by abnormal software and hardware of the database causes adverse effects on daily production life of the merchants and also affects bank reputation.
In view of the above, a technical solution is needed to overcome the above-mentioned drawbacks, and to ensure stable operation of the system by keeping the service uninterrupted when the database is abnormal.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides a dual-activity mechanism deployment method and device of an Oracle database. The method realizes the quasi-real-time data synchronization from the first database to the newly-built second database by newly building the second database and based on a bank distributed message service platform and by utilizing the characteristics of high concurrency, high throughput and high efficiency of distributed messages; the application side realizes the read-write separation of the access of the transaction level database by expanding the MyBatis database access middleware, solves the problem of service interruption caused by database abnormality, reduces the service influence on users caused by service interruption caused by database software and hardware abnormality, and effectively improves the stability and the usability.
In a first aspect of an embodiment of the present invention, a method for deploying a live-active mechanism of an Oracle database is provided, where the method includes:
building a second database, wherein the second database and the first database are two independent databases and are positioned in different parks;
creating a Topic needing a synchronization table by using a distributed message service;
setting a database synchronization component, and introducing transaction application in a Maven mode;
judging a transaction occurrence park, a database table and an operation type according to a transaction occurring in the transaction application, and selecting a first database or a second database to access according to a judgment result;
after the transaction execution of the transaction application is completed, inquiring the full information of the data to be synchronized by referring to the annotation provided by the database synchronization component, and writing the data to be synchronized into the appointed Topic by the database synchronization component;
and newly establishing a consumer group of the data to be synchronized, subscribing the appointed Topic by the consumer group, pulling the message to be synchronized, and persisting the message to the current database according to the data in the current database and the data timestamp in the message to be synchronized.
Further, building a second database, comprising:
and (3) establishing a second database by using Oracle DataGuard, and executing FailOver operation on the second database to form an independent database.
Further, according to the transaction that the transaction application takes place, judge that the trade takes place garden, database table and operation type, select first database or second database to visit according to the judged result, include:
and judging the park, the database table and the operation type of the transaction application in which the transaction occurs by expanding the MyBatis interceptor, and selecting the first database or the second database to access according to the judgment result.
Further, according to the transaction that the transaction application takes place, judge that the trade takes place garden, database table and operation type, select first database or second database to visit according to the judged result, still include:
and setting a fusing mechanism, and carrying out manual data source real-time switching through a configuration center or carrying out automatic data source switching based on a preset strategy according to the fusing mechanism when abnormal conditions occur in database access.
Further, the method further comprises:
when the database synchronization component writes the data to be synchronized into the designated Topic, if the writing fails, the data synchronization task table is registered, the record of the writing failure is scanned by using the timing task, and the data to be synchronized is tried to be written into the designated Topic.
Further, after the execution of the transaction occurring in the transaction application is completed, the full amount information of the data to be synchronized is queried by referring to the annotation provided by the database synchronization component, and the database synchronization component writes the data to be synchronized into the designated Topic, further comprising:
and carrying out batch data synchronization on the basis of application-level quasi-real-time data synchronization by setting the daily end batch file export and import operation of the table to be synchronized.
In a second aspect of the embodiments of the present invention, a dual-live mechanism deployment apparatus for an Oracle database is provided, where the apparatus includes:
the building unit is used for building a second database, wherein the second database and the first database are two independent databases and are positioned in different parks;
the creating unit is used for creating the Topic needing to carry out the synchronization table by utilizing the distributed message service;
the system comprises an introduction unit, a database synchronization component and a transaction application unit, wherein the introduction unit is used for setting the database synchronization component and introducing the transaction application in a Maven mode;
the database access unit is used for judging a transaction occurrence park, a database table and an operation type according to a transaction occurring in the transaction application and selecting a first database or a second database to access according to a judgment result;
the data writing unit is used for inquiring the full information of the data to be synchronized by referring to the annotation provided by the database synchronization component after the transaction execution generated by the transaction application is finished, and the database synchronization component writes the data to be synchronized into the appointed Topic;
and the message persistence unit is used for newly building a consumer group of the data to be synchronized, subscribing the appointed Topic by the consumer group, pulling the message to be synchronized, and persisting the message to the current database according to the data in the current database and the data timestamp in the message to be synchronized.
Further, the building unit is specifically configured to:
and (3) establishing a second database by using Oracle DataGuard, and executing FailOver operation on the second database to form an independent database.
Further, the database access unit is specifically configured to:
and judging the park, the database table and the operation type of the transaction application in which the transaction occurs by expanding the MyBatis interceptor, and selecting the first database or the second database to access according to the judgment result.
Further, the database access unit is further configured to:
and setting a fusing mechanism, and carrying out manual data source real-time switching through a configuration center or carrying out automatic data source switching based on a preset strategy according to the fusing mechanism when abnormal conditions occur in database access.
Further, the data writing unit is further configured to:
when the database synchronization component writes the data to be synchronized into the designated Topic, if the writing fails, the data synchronization task table is registered, the record of the writing failure is scanned by using the timing task, and the data to be synchronized is tried to be written into the designated Topic.
Further, the data writing unit is further configured to:
and carrying out batch data synchronization on the basis of application-level quasi-real-time data synchronization by setting the daily end batch file export and import operation of the table to be synchronized.
In a third aspect of the embodiments of the present invention, a computer device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements a dual-live mechanism deployment method of an Oracle database when executing the computer program.
In a fourth aspect of the embodiments of the present invention, a computer-readable storage medium is provided, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements a dual-live mechanism deployment method for an Oracle database.
The Oracle database dual-activity mechanism deployment method and device provided by the invention realize the quasi-real-time data synchronization from the original database to the newly-built database by using the characteristics of high concurrency, high throughput and high efficiency of a distributed message service platform through the newly-built database, reduce the service influence on users caused by service interruption due to the abnormal software and hardware of the database, and effectively improve the stability and the availability of an application system.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a dual live mechanism deployment method of an Oracle database according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of a merchant database double-living deployment improved based on the present invention according to an embodiment of the present invention.
FIG. 3 is a diagram illustrating processing of data to be synchronized according to an embodiment of the present invention.
Fig. 4 is a schematic diagram of a dual-live mechanism deployment device of an Oracle database according to an embodiment of the present invention.
Fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Fig. 6 is a schematic diagram of a prior art merchant deployment.
Detailed Description
The principles and spirit of the present invention will be described with reference to a number of exemplary embodiments. It is understood that these embodiments are given solely for the purpose of enabling those skilled in the art to better understand and to practice the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to the embodiment of the invention, a method and a device for deploying a double-live mechanism of an Oracle database are provided, and the technical field of data processing is involved.
The terms referred to in the examples of the present invention are explained below as follows:
oracle database: a relational database management system of oracle corporation.
Oracle DataGuard: the basic principle of the data synchronization function of Oracle is to transmit log files from an original database to a target database, and then apply the log files to the target database, so that the target database and the original database are kept synchronous, and the data synchronization function is a database-level high-availability scheme.
Primary and Standby (Primary-Standby) modes: the application accesses the Primary database, and realizes data synchronization between the Primary database and the Standard database through the DataGuard.
The merchant's family: the bank bill receiving merchant service platform provides services such as payment success message notification, detail inquiry, bill checking and the like for the bank bill receiving merchant.
Distributed message service: the method integrates two mature open source message Middleware (MQ) products of ActiveMQ and Kafka industries, and provides functions of automatic installation and deployment, one-key operation and maintenance, message service monitoring and the like so as to realize the platformization and automation of the message service.
Kafka: an open source message Middleware (MQ) product.
Kafka Topic: the message destination.
A configuration center: the system, the network and the application technical parameter configuration related to the application version are managed in a centralized mode, unified and centralized configuration services are provided for the bank open platform application, the configuration is managed according to the environment and the cluster, and the flexible updating and the real-time effect of the configuration are supported.
MyBatis: an excellent persistence tier framework supports customized SQL, stored procedures, and advanced mapping.
The principles and spirit of the present invention are explained in detail below with reference to several representative embodiments of the invention.
Fig. 1 is a schematic flow chart of a dual live mechanism deployment method of an Oracle database according to an embodiment of the present invention. As shown in fig. 1, the method includes:
step S1, a second database is set up, wherein the second database and the first database are two independent databases and are located in different parks;
step S2, using distributed message service to create the Topic needing synchronous list;
step S3, setting a database synchronization component, and introducing transaction application in a Maven mode;
step S4, according to the transaction generated by the transaction application, judging the generation park of the transaction, the database table and the operation type, and selecting the first database or the second database to access according to the judgment result;
step S5, after the transaction execution of the transaction application is completed, the full information of the data to be synchronized is inquired by referring to the annotation provided by the database synchronization component, and the database synchronization component writes the data to be synchronized into the designated Topic;
step S6, a consumer group of the data to be synchronized is newly built, the consumer group subscribes the appointed Topic, the message to be synchronized is pulled, and the message is duralized to the current database according to the data in the current database and the data timestamp in the message to be synchronized.
In order to explain the above dual-live mechanism deployment method of the Oracle database more clearly, the following detailed description is made with reference to a specific embodiment.
Step S1:
and (3) establishing a second database by using Oracle DataGuard, and executing FailOver operation on the second database to form an independent database.
Step S2:
creating Topic that needs to synchronize table with distributed message service.
Step S3:
and developing a database synchronization component, and introducing the project of the merchant in a Maven mode.
Step S4:
and judging the park, the database table and the operation type of the transaction application in which the transaction occurs by expanding the MyBatis interceptor, and selecting the first database or the second database to access according to the judgment result.
In this embodiment, a fusing mechanism may be set for an abnormal condition of the database, and when an abnormal condition occurs during database access, a configuration center performs real-time switching of manual data sources according to the fusing mechanism, or performs automatic data source switching based on a preset policy.
Step S5:
after the transaction execution of the transaction application is completed, inquiring the full information of the data to be synchronized by referring to the annotation provided by the database synchronization component, and writing the data to be synchronized into the appointed Topic by the database synchronization component; for example, Kafka Producer is used to send the message to the specified Topic.
When the database synchronization component writes the data to be synchronized into the designated Topic, if the writing fails, the data synchronization task table is registered, the record of the writing failure is scanned by using the timing task, and the data to be synchronized is tried to be written into the designated Topic.
In this embodiment, batch data synchronization can be performed on the basis of application-level quasi-real-time data synchronization by setting the daily end batch file export and import operation of the table to be synchronized, so that the consistency and integrity of data synchronization are further improved.
Step S6:
and newly establishing a consumer group of the data to be synchronized, subscribing the appointed Topic by the consumer group, pulling the message to be synchronized, and persisting the message to the current database according to the data in the current database and the data timestamp in the message to be synchronized.
In this embodiment, a Kafka Consumer may be employed to pull a message from a given Topic.
For a clearer explanation of the above dual-live mechanism deployment method of the Oracle database, a specific embodiment is described below, but it should be noted that the embodiment is only for better explaining the present invention, and is not to be construed as an undue limitation on the present invention.
Fig. 2 is a schematic diagram of a merchant database double-living deployment improved based on the present invention according to an embodiment of the present invention.
Compared with the merchant deployment in the prior art (shown in fig. 6), the invention provides the newly-built database a, and based on the bank distributed message service platform, the quasi-real-time data synchronization from the database B to the newly-built database a is realized by using the characteristics of high concurrency, high throughput and high efficiency of distributed messages. The application side realizes the read-write separation of the access of the transaction level database by expanding the MyBatis database access middleware, solves the problem of service interruption when the database is abnormal, and effectively improves the stability and the availability of the system.
Fig. 3 is a schematic diagram of processing data to be synchronized according to an embodiment of the invention.
One Topic is usually composed of the recommendations scattered on each service node, multiple producers send messages to each recommendation according to a certain algorithm, and a provider consumes messages on different recommendations according to a certain algorithm. Wherein each recommendation maximally allows a consumer to consume, and a consumer can consume multiple recommendations.
The merchant transaction queries the full amount information of the data to be synchronized after the transaction is executed through the annotation provided by the reference component, and the component writes the data to be synchronized into the designated Topic. And subscribing the appointed Topic by the consumer group, pulling the message to be processed, and judging whether the message is persistent to the database A or not by judging the freshness of the data in the database A and the data time stamp in the message to be synchronized.
In another embodiment, for the database synchronization mode, the changed data can be written into the task table with synchronization through the database trigger, and the data is synchronized to the database a after the task to be processed is read through the background thread. Or by means of a third party tool, such as the IBM CDC, data synchronization of database B with database a is achieved.
It should be noted that although the operations of the method of the present invention have been described in the above embodiments and the accompanying drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the operations shown must be performed, to achieve the desired results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
Having described the method of the exemplary embodiment of the present invention, the dual active mechanism deployment apparatus of Oracle database of the exemplary embodiment of the present invention is described next with reference to fig. 4.
The implementation of the dual-live mechanism deployment device of the Oracle database can be referred to the implementation of the above method, and repeated details are omitted.
The term "module" or "unit" used hereinafter may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Based on the same inventive concept, the invention also provides a dual-live mechanism deployment device of the Oracle database, as shown in FIG. 4, the device comprises:
the building unit 410 is used for building a second database, wherein the second database and the first database are two independent databases and are located in different parks;
a creating unit 420, configured to create, by using a distributed message service, a Topic that needs to perform a synchronization table;
the introducing unit 430 is used for setting a database synchronization component and introducing the transaction application in a Maven mode;
the database access unit 440 is configured to determine a transaction occurrence park, a database table, and an operation type according to a transaction occurring in the transaction application, and select the first database or the second database for access according to a determination result;
the data writing unit 450 is configured to query full amount information of the data to be synchronized by referring to the annotation provided by the database synchronization component after the transaction execution of the transaction application is completed, and write the data to be synchronized into the designated Topic by the database synchronization component;
and the message persistence unit 460 is configured to create a new consumer group of the to-be-synchronized data, subscribe to the designated Topic by the consumer group, pull the to-be-synchronized message, and persist the message to the current database according to the data in the current database and the data timestamp in the to-be-synchronized message.
In an embodiment, the building unit 410 is specifically configured to:
and (3) establishing a second database by using Oracle DataGuard, and executing FailOver operation on the second database to form an independent database.
In an embodiment, the database access unit 440 is specifically configured to:
and judging the park, the database table and the operation type of the transaction application in which the transaction occurs by expanding the MyBatis interceptor, and selecting the first database or the second database to access according to the judgment result.
In an embodiment, the database access unit 440 is further configured to:
and setting a fusing mechanism, and carrying out manual data source real-time switching through a configuration center or carrying out automatic data source switching based on a preset strategy according to the fusing mechanism when abnormal conditions occur in database access.
In an embodiment, the data writing unit 450 is further configured to:
when the database synchronization component writes the data to be synchronized into the designated Topic, if the writing fails, the data synchronization task table is registered, the record of the writing failure is scanned by using the timing task, and the data to be synchronized is tried to be written into the designated Topic.
In an embodiment, the data writing unit 450 is further configured to:
and carrying out batch data synchronization on the basis of application-level quasi-real-time data synchronization by setting the daily end batch file export and import operation of the table to be synchronized.
It should be noted that although several modules of the apparatus are referred to in the above detailed description as a live-active mechanism of the Oracle database, such partitioning is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the modules described above may be embodied in one module according to embodiments of the invention. Conversely, the features and functions of one module described above may be further divided into embodiments by a plurality of modules.
Based on the aforementioned inventive concept, as shown in fig. 5, the present invention further provides a computer device 500, which includes a memory 510, a processor 520, and a computer program 530 stored in the memory 510 and capable of running on the processor 520, wherein the processor 520 executes the computer program 530 to implement the aforementioned dual-active mechanism deployment method of the Oracle database.
Based on the above inventive concept, the present invention provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the dual-live mechanism deployment method of the Oracle database.
The Oracle database dual-activity mechanism deployment method and device provided by the invention realize the quasi-real-time data synchronization from the original database to the newly-built database by using the characteristics of high concurrency, high throughput and high efficiency of a distributed message service platform through the newly-built database, reduce the service influence on users caused by service interruption due to the abnormal software and hardware of the database, and effectively improve the stability and the availability of an application system.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (14)
1. A dual-live mechanism deployment method of an Oracle database is characterized by comprising the following steps:
building a second database, wherein the second database and the first database are two independent databases and are positioned in different parks;
creating a Topic needing a synchronization table by using a distributed message service;
setting a database synchronization component, and introducing transaction application in a Maven mode;
judging a transaction occurrence park, a database table and an operation type according to a transaction occurring in the transaction application, and selecting a first database or a second database to access according to a judgment result;
after the transaction execution of the transaction application is completed, inquiring the full information of the data to be synchronized by referring to the annotation provided by the database synchronization component, and writing the data to be synchronized into the appointed Topic by the database synchronization component;
and newly establishing a consumer group of the data to be synchronized, subscribing the appointed Topic by the consumer group, pulling the message to be synchronized, and persisting the message to the current database according to the data in the current database and the data timestamp in the message to be synchronized.
2. The Oracle database double-live mechanism deployment method according to claim 1, wherein building a second database comprises:
and (3) establishing a second database by using Oracle DataGuard, and executing FailOver operation on the second database to form an independent database.
3. The Oracle database double-activity mechanism deployment method according to claim 1, wherein the steps of judging a transaction occurrence park, a database table and an operation type according to a transaction occurring in a transaction application, and selecting the first database or the second database to access according to a judgment result comprise:
and judging the park, the database table and the operation type of the transaction application in which the transaction occurs by expanding the MyBatis interceptor, and selecting the first database or the second database to access according to the judgment result.
4. The Oracle database dual-activity mechanism deployment method of claim 3, wherein the method comprises the steps of judging a transaction occurrence park, a database table and an operation type according to a transaction occurring in a transaction application, and selecting the first database or the second database to access according to a judgment result, and further comprising:
and setting a fusing mechanism, and carrying out manual data source real-time switching through a configuration center or carrying out automatic data source switching based on a preset strategy according to the fusing mechanism when abnormal conditions occur in database access.
5. The Oracle database double-live mechanism deployment method according to claim 1, further comprising:
when the database synchronization component writes the data to be synchronized into the designated Topic, if the writing fails, the data synchronization task table is registered, the record of the writing failure is scanned by using the timing task, and the data to be synchronized is tried to be written into the designated Topic.
6. The Oracle database dual-live mechanism deployment method according to claim 5, wherein after the execution of the transaction by the transaction application is completed, the full amount information of the data to be synchronized is queried by referring to the annotation provided by the database synchronization component, and the data to be synchronized is written into the designated Topic by the database synchronization component, further comprising:
and carrying out batch data synchronization on the basis of application-level quasi-real-time data synchronization by setting the daily end batch file export and import operation of the table to be synchronized.
7. A dual-live mechanism deployment device of an Oracle database is characterized by comprising:
the building unit is used for building a second database, wherein the second database and the first database are two independent databases and are positioned in different parks;
the creating unit is used for creating the Topic needing to carry out the synchronization table by utilizing the distributed message service;
the system comprises an introduction unit, a database synchronization component and a transaction application unit, wherein the introduction unit is used for setting the database synchronization component and introducing the transaction application in a Maven mode;
the database access unit is used for judging a transaction occurrence park, a database table and an operation type according to a transaction occurring in the transaction application and selecting a first database or a second database to access according to a judgment result;
the data writing unit is used for inquiring the full information of the data to be synchronized by referring to the annotation provided by the database synchronization component after the transaction execution generated by the transaction application is finished, and the database synchronization component writes the data to be synchronized into the appointed Topic;
and the message persistence unit is used for newly building a consumer group of the data to be synchronized, subscribing the appointed Topic by the consumer group, pulling the message to be synchronized, and persisting the message to the current database according to the data in the current database and the data timestamp in the message to be synchronized.
8. The Oracle database double-live-mechanism deployment device according to claim 7, wherein the building unit is specifically configured to:
and (3) establishing a second database by using Oracle DataGuard, and executing FailOver operation on the second database to form an independent database.
9. The Oracle database dual-live mechanism deployment device according to claim 7, wherein the database access unit is specifically configured to:
and judging the park, the database table and the operation type of the transaction application in which the transaction occurs by expanding the MyBatis interceptor, and selecting the first database or the second database to access according to the judgment result.
10. The Oracle database dual live mechanism deployment apparatus according to claim 9, wherein the database access unit is further configured to:
and setting a fusing mechanism, and carrying out manual data source real-time switching through a configuration center or carrying out automatic data source switching based on a preset strategy according to the fusing mechanism when abnormal conditions occur in database access.
11. The Oracle database double live mechanism deployment apparatus of claim 7, wherein the data writing unit is further configured to:
when the database synchronization component writes the data to be synchronized into the designated Topic, if the writing fails, the data synchronization task table is registered, the record of the writing failure is scanned by using the timing task, and the data to be synchronized is tried to be written into the designated Topic.
12. The Oracle database dual live mechanism deployment apparatus according to claim 11, wherein the data writing unit is further configured to:
and carrying out batch data synchronization on the basis of application-level quasi-real-time data synchronization by setting the daily end batch file export and import operation of the table to be synchronized.
13. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 6 when executing the computer program.
14. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110458301.9A CN113157701A (en) | 2021-04-27 | 2021-04-27 | Dual-activity mechanism deployment method and device of ORACLE database |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110458301.9A CN113157701A (en) | 2021-04-27 | 2021-04-27 | Dual-activity mechanism deployment method and device of ORACLE database |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113157701A true CN113157701A (en) | 2021-07-23 |
Family
ID=76871205
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110458301.9A Pending CN113157701A (en) | 2021-04-27 | 2021-04-27 | Dual-activity mechanism deployment method and device of ORACLE database |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113157701A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115277610A (en) * | 2022-07-25 | 2022-11-01 | 平安科技(深圳)有限公司 | Message distribution sending method, device, equipment and medium based on dual-activity environment |
CN115599868A (en) * | 2022-12-14 | 2023-01-13 | 广州睿帆科技有限公司(Cn) | Data real-time synchronous processing method, system, equipment and medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7290015B1 (en) * | 2003-10-02 | 2007-10-30 | Progress Software Corporation | High availability via data services |
WO2016127903A1 (en) * | 2015-02-13 | 2016-08-18 | 阿里巴巴集团控股有限公司 | Data synchronization method, device and system |
CN107465767A (en) * | 2017-09-29 | 2017-12-12 | 网宿科技股份有限公司 | A kind of method and system of data syn-chronization |
CN107783975A (en) * | 2016-08-24 | 2018-03-09 | 北京京东尚科信息技术有限公司 | The method and apparatus of distributed data base synchronization process |
CN109710699A (en) * | 2019-01-02 | 2019-05-03 | 神州数码融信软件有限公司 | The back method of the method for recording of transaction data, transaction data |
CN111930529A (en) * | 2020-10-09 | 2020-11-13 | 上海富友支付服务股份有限公司 | Data synchronization method, module and system based on message queue and micro-service |
CN112015815A (en) * | 2020-08-27 | 2020-12-01 | 中国平安财产保险股份有限公司 | Data synchronization method, device and computer readable storage medium |
CN112307121A (en) * | 2020-10-30 | 2021-02-02 | 中国平安人寿保险股份有限公司 | Data synchronization method and device based on Oracle and computer equipment |
-
2021
- 2021-04-27 CN CN202110458301.9A patent/CN113157701A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7290015B1 (en) * | 2003-10-02 | 2007-10-30 | Progress Software Corporation | High availability via data services |
WO2016127903A1 (en) * | 2015-02-13 | 2016-08-18 | 阿里巴巴集团控股有限公司 | Data synchronization method, device and system |
CN107783975A (en) * | 2016-08-24 | 2018-03-09 | 北京京东尚科信息技术有限公司 | The method and apparatus of distributed data base synchronization process |
CN107465767A (en) * | 2017-09-29 | 2017-12-12 | 网宿科技股份有限公司 | A kind of method and system of data syn-chronization |
CN109710699A (en) * | 2019-01-02 | 2019-05-03 | 神州数码融信软件有限公司 | The back method of the method for recording of transaction data, transaction data |
CN112015815A (en) * | 2020-08-27 | 2020-12-01 | 中国平安财产保险股份有限公司 | Data synchronization method, device and computer readable storage medium |
CN111930529A (en) * | 2020-10-09 | 2020-11-13 | 上海富友支付服务股份有限公司 | Data synchronization method, module and system based on message queue and micro-service |
CN112307121A (en) * | 2020-10-30 | 2021-02-02 | 中国平安人寿保险股份有限公司 | Data synchronization method and device based on Oracle and computer equipment |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115277610A (en) * | 2022-07-25 | 2022-11-01 | 平安科技(深圳)有限公司 | Message distribution sending method, device, equipment and medium based on dual-activity environment |
CN115277610B (en) * | 2022-07-25 | 2024-06-04 | 平安科技(深圳)有限公司 | Message split sending method, device, equipment and medium based on dual-activity environment |
CN115599868A (en) * | 2022-12-14 | 2023-01-13 | 广州睿帆科技有限公司(Cn) | Data real-time synchronous processing method, system, equipment and medium |
CN115599868B (en) * | 2022-12-14 | 2023-03-14 | 广州睿帆科技有限公司 | Data real-time synchronous processing method, system, equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9317555B2 (en) | Query method for a distributed database system and query apparatus | |
US8108623B2 (en) | Poll based cache event notifications in a distributed cache | |
CN113515499B (en) | Database service method and system | |
CN110968603B (en) | Data access method and device | |
CN105701099B (en) | For executing the method, apparatus and system of task in distributed environment | |
CN113157701A (en) | Dual-activity mechanism deployment method and device of ORACLE database | |
CN113220795B (en) | Data processing method, device, equipment and medium based on distributed storage | |
US20140156596A1 (en) | Replication control using eventually consistent meta-data | |
CN106339387B (en) | Increase the method for data synchronization and device of server in a kind of data-base cluster newly | |
US11755627B1 (en) | Systems and methods for centralized database cluster management | |
CN113934792B (en) | Processing method and device of distributed database, network equipment and storage medium | |
CN115562676B (en) | Triggering method of graph calculation engine | |
CN111651302B (en) | Distributed database backup method, device and system | |
CN111680017A (en) | Data synchronization method and device | |
CN112527801A (en) | Data synchronization method and system between relational database and big data system | |
CN113297173B (en) | Distributed database cluster management method and device and electronic equipment | |
CN115587141A (en) | Database synchronization method and device | |
CN116150263B (en) | Distributed graph calculation engine | |
CN106789941B (en) | A kind of database and the implementation method of system application heartbeat unified management | |
CN115934252A (en) | Method and system for realizing full-automatic load balancing consumption message based on Kafka | |
CN115587147A (en) | Data processing method and system | |
CN115080309A (en) | Data backup system, method, storage medium, and electronic device | |
CN115455121A (en) | Real-time reliable data synchronous transmission method, equipment and medium | |
CN114168545A (en) | Data migration method and device | |
CN117009434A (en) | Data synchronization method and device, storage medium and electronic equipment |
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 |