CN105653532A - Method for synchronizing heterogeneous database - Google Patents

Method for synchronizing heterogeneous database Download PDF

Info

Publication number
CN105653532A
CN105653532A CN201410638666.XA CN201410638666A CN105653532A CN 105653532 A CN105653532 A CN 105653532A CN 201410638666 A CN201410638666 A CN 201410638666A CN 105653532 A CN105653532 A CN 105653532A
Authority
CN
China
Prior art keywords
data
database
jdbc
heterogeneous database
statement
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
CN201410638666.XA
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.)
ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD
Original Assignee
ZHENJIANG HUAYANG INFORMATION TECHNOLOGY 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 ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD filed Critical ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD
Priority to CN201410638666.XA priority Critical patent/CN105653532A/en
Publication of CN105653532A publication Critical patent/CN105653532A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

Provided is a method for synchronizing a heterogeneous database. The method is an extensible network application system which realizes resources integration and information sharing, and the method improves timeliness and accuracy of information acquisition, transmission, and processing of management, so as to establish a distributed heterogeneous multi-media resource system with interoperability.

Description

A kind of method that heterogeneous database synchronizes
Technical field
A kind of method that heterogeneous database synchronizes is directed primarily to Computer Database field.
Background technology
Along with the development of computer technology, the environment that modern enterprise faces becomes increasingly complex, and its information system great majority are complication system multi-platform, multisystem. This just requires that the enterprise solution of today has compatibility widely, it is possible to support different system platform, data form and multiple connected mode. In addition, when current distributed database environment is widely used, in the urgent need to a kind of Data Replication Technology in Mobile supporting distributed environment, to realize changing the data of a node transferring to other node up, thus ensure that in distributed environment the uniform synchronization of data on each node, each node can be carried out local autonomous, largely reduce the traffic load to network, enhance the redundancy ability of node simultaneously also by redundant data.
Under the leading that current information technology develops rapidly, information management technique is all stepped into the operational phase of profound level by each enterprise, the environment that enterprise faces becomes increasingly complex, market development and expansion due to enterprise, increasing enterprise has all marched toward the ranks of trans-regional distributed operation, and the result echoed mutually with Corporation Distributed operation creates distributed database environment exactly. The development of information technology is with rapid changepl. never-ending changes and improvements, and a lot of Information System configuration are different periods, and are each designed by different departments again so that the platform of these systems often presents isomerism, result in the discordance of data. In distributed database environment, if distributed data message can not get effectively sharing, so these independent data systems will become one by one " information island ", in addition, flourish along with ecommerce, data exchange between each application system is also day by day frequent, therefore the data in highly desirable each information system integrated of enterprise, eliminate " information island ", between guarantee information system, information exchange is unimpeded, ensure the concordance in data transmission and safety, really realize data sharing. For this, how flexibly and effectively the information processed in these heterogeneous databases becomes interesting studying a question.
For solving data sharing and the integration problem of distributed data base, spy introduces Heterogeneous Database Replication technology, is realized the data syn-chronization of data source and target database by reproduction technology. Data base's duplication refers at disparate databases node and safeguards its conforming method by multiple Replica placement of same data object automatically. This is the important technology improving system availability and reliability in distributed environment. Database synchronization replicates the distribution reproduction technology being the access of a kind of real time remote with real-time update data, most basic function is to improve the performance of database work, by the data in remote data base are copied to this locality, enable an application to access nearby data, avoid and remotely read data, thus reducing network transport load, improve efficiency. When change occurs the data in source database, replicate and can propagate target database updating immediately, as a part of issued transaction. So not only can reduce network transport overhead and shorten response time, moreover it is possible to ensureing that when node and communication failure system is still properly functioning, serve the effect of data backup.
Existing replication theme all relies on the support of data base management system, it is common to there is the premise meeting certain architecture or standard, therefore compatible shortcoming, therefore range of application is subject to certain restrictions.
In practical application, reproduction technology is in data warehouse, application integration, to mobile office, ecommerce, from highly available system, load balancing, has all played important effect to multiple field such as embedded system, internet device.
Summary of the invention
Do not have to find the application materials about this system aspects by national patent retrieval.
This method be the conversion of logical data carry out data syn-chronization itself particularly as follows: list of modification data on districts and cities data base that JDBC is remotely read, produced with dom4j.org increases income and resolves bag DOM4J and realize toward the data write of XML document and the parsing to XML. Dom4j is a storehouse easy-to-use, that increase income, and it is applied to JAVA platform, have employed JAVA and gathers framework and support DOM, SAX and JAXP completely.
In the XML structure of definition, each data of every record are provided with a type attribute, the value of this type be inside java.sql.Types, general data type is compiled number, corresponding type value will be returned according to its field type in data base when program reads data from source database time, then will transfer the type of corresponding target database when reading in data in target database according to this type value to.
The process that data transfer will be gone in needing the content of transmission from SQLServer database transmissions to oracle database exactly. After this synchronization module starts, initially set up and the connection of each SQLServer data base, after the data changing tables of data are changed into XML document, XML document is resolved and then the data parsed is performed with the form of SQL statement on oracle database, thus completing the transfer of data.
This synchronization is remotely to be connected SQLServer data base by JDBC, and obtains the data changed in tables of data, is also finally write data in Oracle data by JDBC.
DriverManager class is the management level of JDBC, acts between user and driver, and it can be followed the tracks of available driver and set up connection between data base and respective drive program. Additionally, DriverManager class also processes the affairs such as the display of the such as restriction of driver login time and login and tracking message;
Statement is for being sent in data base by SQL statement, it includes statement, PreStatement and CallableStatement three kinds, PreStatement is the subclass of statement, and CallableStatement is the subclass of PreStatement. Statement object is for performing the Simple SQL statement without parameter; PreparedStatement object is for performing the precompile SQL statement with or without IN parameter; CallableStatement object is for performing calling data base storing process.
Statement uses executeQuery perform SQL statement and returns ResultSet. ReslutSet comprises all row meeting SQL statement conditional, and it can go the data in access line by get method, and statement object is created by the method createStatement of Connection.
The operating procedure of data base is by JDBC: after calling the connection that DriverManager.getConnection method is set up with data base, create and perform java.sql.Statement, use executeQuery to perform SQL statement and be positioned in ResultSet by meeting all of SQL statement condition in connection, then by ResultSet call get method go to access or obtain the concrete row in the inside value.
In this method, multiple tables use associating major key, a primary key column is comprised owing to changing in tables of data, using the information as recovery SQL statement when being inserted in oracle database, structure (metadata) and the data of major key therefore will be obtained in the different stages. In this synchronization module, the processing mode to associating major key is to devise major key list of meta data and major key data list. Major key list of meta data mainly includes record corresponding to this major key sequence number in tables of data, column name and field type, and major key list of meta data class essentially describes the value list of the major key field for certain table. Value in Table_Delta.update_key can be resolved by major key data list, and correctly processes the situation of many major key fields.
It is taken based on the mode of trigger to obtain change data, what data conversion was taked is as intermediate form to complete the conversion of data using XML document, and the realization of data transfer is to set up the connection with SQLServer data base by JDBC thus reading change data and the data parsed being written in Oracle.

Claims (4)

1. its conversion being mainly characterized by being carried out data by XML of method that a heterogeneous database synchronizes.
2. according to claim 1, initially set up and the connection of each SQLServer data base, the data changing tables of data are changed into XML document.
3. then XML document is resolved according to claim 2 and then the data parsed are performed with the form of SQL statement on oracle database, thus completing the transfer of data.
4. remotely connect SQLServer data base by JDBC, and obtain the data that change in tables of data, be also finally write data into Oracle data by JDBC.
CN201410638666.XA 2014-11-13 2014-11-13 Method for synchronizing heterogeneous database Pending CN105653532A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410638666.XA CN105653532A (en) 2014-11-13 2014-11-13 Method for synchronizing heterogeneous database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410638666.XA CN105653532A (en) 2014-11-13 2014-11-13 Method for synchronizing heterogeneous database

Publications (1)

Publication Number Publication Date
CN105653532A true CN105653532A (en) 2016-06-08

Family

ID=56479222

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410638666.XA Pending CN105653532A (en) 2014-11-13 2014-11-13 Method for synchronizing heterogeneous database

Country Status (1)

Country Link
CN (1) CN105653532A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107301250A (en) * 2017-07-27 2017-10-27 南京南瑞集团公司 A kind of Various database cooperates with backup method
CN110069566A (en) * 2017-12-01 2019-07-30 北京京穗蓝盾信息安全技术有限公司 Heterogeneous database synchronization method in a kind of one-way import system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107301250A (en) * 2017-07-27 2017-10-27 南京南瑞集团公司 A kind of Various database cooperates with backup method
CN107301250B (en) * 2017-07-27 2020-06-26 南京南瑞集团公司 Multi-source database collaborative backup method
CN110069566A (en) * 2017-12-01 2019-07-30 北京京穗蓝盾信息安全技术有限公司 Heterogeneous database synchronization method in a kind of one-way import system

Similar Documents

Publication Publication Date Title
US10878064B2 (en) Clinical data management system
CN109906448B (en) Method, apparatus, and medium for facilitating operations on pluggable databases
US7577691B2 (en) Extending hierarchical synchronization scopes to non-hierarchical scenarios
US7099896B2 (en) Synchronizing data between disparate schemas using composite version
US8170981B1 (en) Computer method and system for combining OLTP database and OLAP database environments
US8886596B2 (en) Method for reorganizing or moving a database table
US8996458B2 (en) High volume, high speed adaptive data replication
US20070255763A1 (en) Database replication method and system
US9053117B2 (en) Storing application data with a unique ID
US9892185B2 (en) Method and system for syncing data structures
CN106021594A (en) Database table and XML message mapping processing method and system
WO2012068110A1 (en) Safely transporting legacy data to an object semantic form data grid
US9690825B2 (en) Relationship serialization and reconstruction for entities
CN105447051A (en) Database operation method and device
US9836503B2 (en) Integrating linked data with relational data
US20120078905A1 (en) Manipulating non-schema attributes for objects in a schema based directory
CN112131231A (en) Distributed database catalog management method, system, electronic equipment and readable storage medium
CN103853612A (en) Method for reading data based on digital family content under distributed storage
CN105653532A (en) Method for synchronizing heterogeneous database
CN105723365A (en) Method for optimizing index, master database node and subscriber database node
CN112416944A (en) Method and equipment for synchronizing service data
CN102147794A (en) Multi-database caption display method and device based on SQL (structured query language) sentence
TWI385543B (en) Data Synchronization System and Method for Establishing Mediation Data in Directory Service Format
CN102646118B (en) Data indexing method and device
CN103425673A (en) Method and device for synchronously searching indexes on basis of Lucene

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160608

WD01 Invention patent application deemed withdrawn after publication