WO2004090726A1 - Database copying program and database copying device - Google Patents

Database copying program and database copying device Download PDF

Info

Publication number
WO2004090726A1
WO2004090726A1 PCT/JP2003/004343 JP0304343W WO2004090726A1 WO 2004090726 A1 WO2004090726 A1 WO 2004090726A1 JP 0304343 W JP0304343 W JP 0304343W WO 2004090726 A1 WO2004090726 A1 WO 2004090726A1
Authority
WO
WIPO (PCT)
Prior art keywords
log
difference
database
primary key
difference log
Prior art date
Application number
PCT/JP2003/004343
Other languages
French (fr)
Japanese (ja)
Inventor
Shotaro Okada
Original Assignee
Fujitsu Limited
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 Fujitsu Limited filed Critical Fujitsu Limited
Priority to JP2004570551A priority Critical patent/JP4268141B2/en
Priority to PCT/JP2003/004343 priority patent/WO2004090726A1/en
Publication of WO2004090726A1 publication Critical patent/WO2004090726A1/en

Links

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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/278Data partitioning, e.g. horizontal or vertical partitioning
    • 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

Definitions

  • the present invention relates to a database duplication program and a database duplication device that receive, as a differential log, the update contents of a database performed in a master system, and apply the received differential log to a database of a clone system.
  • the present invention relates to a database duplication program and a database duplication device that do not require synchronization between parallel processes and can thereby process difference logs at high speed.
  • the same clone system as the master system is installed in a disaster response center, etc., and if the master system cannot be used due to disaster or maintenance, The system has been constructed so that online operations can be continued using the clone system.
  • the clone system receives the update contents of the database performed by the master system as a difference log via the network, etc., and applies the received difference log to the database of the clone system to always take over the online business.
  • Such a technique for reflecting a database update at one site in a database at another site is disclosed in, for example, Japanese Patent Application Laid-Open No. 2001-7585.
  • No. 2 discloses this.
  • the processing speed of the difference log is slower than that of the master system, and when the load of the online operation of the master system is high, the difference log is accumulated and the clone system has a high speed. Switching could not be performed.
  • the cause is that, in the master system, multiple processes execute transaction processing in parallel to generate a difference log, whereas in the clone system, only one process processes the difference log. .
  • the present invention which had a problem, was made in order to solve the above-mentioned problem of the prior art, and eliminates the need for synchronization between parallel processing of a plurality of differential ports, thereby processing the differential ports at high speed. It is intended to provide a database duplication program and a database duplication device that can perform the operations. Disclosure of the invention
  • the present invention provides a database which receives, as a difference log, an update content of a database performed in a master system, and applies the received difference log to a database of a clone system.
  • a difference log distribution procedure for allocating the difference log to a plurality of parallel processing targets based on predetermined information of the difference log, and a plurality of parallel processing targets by the difference log distribution procedure.
  • a difference log parallel application procedure for performing in parallel a process of applying each of the sorted differential logs to the database of the clone system;
  • the present invention is a database replication device that receives, as a difference log, the update content of a database performed in a master system, and applies the received difference log to a database of a clone system.
  • a difference log distribution means for allocating the difference group to a plurality of parallel processing targets based on predetermined information; and a plurality of parallel processing objects allocated to the plurality of parallel processing targets by the difference group distribution means.
  • a plurality of difference log parallel application means for performing processing for applying the difference log to the database of the quenching system in parallel.
  • the differential group is allocated to a plurality of parallel processing targets based on predetermined information of the differential group, and the difference logs of the respective parallel processing targets allocated to the plurality of parallel processing targets are stored in a database of a clone system. Since the processing to be applied is performed in parallel, the difference can be processed at high speed.
  • the difference log to be distributed is an update of the primary key
  • the difference log is deleted and the record identified by the primary key before the update is replaced with the deleted log and the primary key of the record is replaced with the updated primary key.
  • the record is divided into the entry and the entry to be imported, and the divided entry and the entry are divided.
  • the difference log to be distributed when the difference log to be distributed is an update of the primary key, the difference log deletes the record identified by the primary key before the update, and the deletion log and the primary key after the update of the primary key of the record.
  • the records replaced in step 4 are divided into the input logs to be imported, and the divided deletion ports and input ports are distributed.Therefore, synchronization between multiple parallel processing of multiple difference logs is not required, and the difference Logs can be processed at high speed.
  • FIG. 1 is an explanatory diagram for explaining a concept of a primary key update by the database duplication device according to the present embodiment
  • FIG. 2 is a function showing a configuration of the database duplication device according to the present embodiment
  • FIG. 3 is a diagram showing an example of the difference log stored in the difference log file shown in FIG. 2
  • FIG. 4 is a diagram showing the difference log distribution unit shown in FIG.
  • FIG. 5 is a flowchart showing a processing procedure.
  • FIG. 6 is a flowchart showing a processing procedure of the difference log application unit shown in FIG. 6,
  • FIG. 6 is a diagram showing a computer system that executes a database duplication program according to the present embodiment
  • FIG. FIG. 3 is a functional block diagram showing a functional configuration of the main body shown.
  • FIG. 1 is an explanatory diagram for explaining the concept of updating a primary key by the database duplication device according to the present embodiment.
  • a plurality of difference log application units for applying the difference log to the database are provided, and the processing of the difference log is speeded up by operating the plurality of difference log application units in parallel.
  • one difference log application unit is selected from the plurality of difference log application units based on the primary key of each difference log, and the selected difference log application unit applies the difference log to the database.
  • the primary key A update unit is a difference log application unit that applies the difference key whose primary key is A to the database
  • the primary key C update unit is a difference log application unit whose primary key is C
  • the primary key D updating unit is a differential log applying unit that applies a differential log whose primary key is D to a database.
  • the force S, and one difference log application unit can process a plurality of primary keys.
  • the first log is a differential log that updates primary key C to D.
  • the second log is a difference log that updates “column 1” of primary key D
  • the third log is a difference log that updates primary key A to C, as shown in Fig. 1 (a)
  • the difference log application unit is selected based on the value of the primary key before update, and the primary key C update unit processes the first log
  • the primary key C update unit processes the first log. Only after that, the primary key D updating unit cannot process the second log, and the primary key A updating unit cannot process the third log. Therefore, the primary key updating unit and the primary key updating unit cannot take advantage of the fact that they can operate in parallel with the primary key updating unit C, and the effect of parallelization cannot be obtained.
  • the primary key C updating unit cannot process the third port until the D updating unit processes the first port. Therefore, the primary key C updating unit cannot take advantage of the fact that it can operate in parallel with the primary key D updating unit, and the effect of parallelization cannot be obtained.
  • a difference key for updating the primary key, a deletion key for deleting the record having the primary key before the update The record having the updated primary key is divided into an entry and an entry for processing.
  • the first log that updates primary key C to D is divided into a delete log for records with primary key C and an import log for records with primary key D, and is processed.
  • the third log to be updated to C is divided into a deletion log for the record with the primary key A and an entry for the record with the primary key C for processing.
  • FIG. 2 is a functional block diagram showing the configuration of the database duplication device according to the present embodiment.
  • This database replication device is used as a part of the clone system.
  • the database 'replicating device 200 includes a difference log file 210, a difference log distribution unit 220, and n difference log application units 23 ( ⁇ to 230). n and a database 240.
  • the difference log file 210 is a file in which the master system updates the database of the master system as a difference log and is transferred from the master system via a network or the like.
  • the difference opening grayed distribution unit 2 2 0 is a processing unit that distributes the difference log in the difference log apply for part 2 3 0 ⁇ 2 3 0 n based on the primary key of the difference opening grayed, the difference the difference log Rogufuai Le 2 1
  • the difference log reading unit 2 2 1 to read from 0, the charge determination unit 2 2 2 that determines the difference log application unit by applying the hash function to the primary key of the difference log, and the difference log ,
  • the main key update converter 2 23 that divides the difference query into a deletion query and an insertion query, and the difference query application module 2 3 0 to 2 3 0 n. Delivery difference Log delivery unit 2 2 4
  • the difference log distribution unit 220 divides the difference log for updating the primary key into a deletion log and an entry log, and divides the divided deletion log and insertion log into a difference log application block 230. 2 3 0 by allocation to n, the synchronization process between the differential log application unit 2 3 0 I ⁇ 2 3 0 n is not required, the difference port grayed application unit 2 3 0 i to 2 3 0 n is the difference port grayed Can be processed completely in parallel.
  • the difference log distribution unit 220 determines the difference log application unit by applying a hash function to the primary key of the difference log, and thereby determines the number of the difference log application units 23 C ⁇ S 30 n . It can be kept small compared to the number of primary keys.
  • Difference log application unit 2 3 0 21 to 3 0 11 is a processing unit for applying the difference log, which is distributed by the difference log distribution unit 2 2 0 in the database 2 4 0, parallel to each difference log application unit Operate.
  • each difference log application unit respectively, A difference log receiving unit 231, which receives the minute log, a transaction control unit 232, which processes the received difference log, and a database reflection unit 23, which reflects the processing result of the difference log in the database 240.
  • the database 240 is a database that replicates the database of the master system, and is used when the clone system takes over online operations in the event of a disaster occurring in the master system.
  • FIG. 3 is a diagram showing an example of a difference log stored in the difference log file 210 shown in FIG. (A) shows the insertion log, (b) shows the deletion log, and (c) shows the update log.
  • the input log has a log type, a record identifier, and a first to a k-th columns.
  • the log type indicates the type of the difference log. In the case of the input log, it is ⁇ INS ERTJ.
  • the record identifier is the primary key of the record to be inserted into the database, and is used to identify the record to be inserted.
  • the first to k-th columns are the data of the record to be inserted.
  • the record identifier and the first to k-th columns constitute a record to be inserted into the database 240.
  • the deletion log has a log type and a record identifier.
  • the entry type indicates the type of the difference log. In the case of the deletion log, it is "DELETEJ.
  • the record identifier is the primary key of the record to be deleted from the database, and is used to identify the record to be deleted. .
  • the update log has a log type, a record identifier, and first to k-th columns.
  • the log type indicates the type of the difference log. For an update log, it is "UPDATE".
  • the record identifier is the primary key of the record to be updated, and is used to identify the record to be updated. When updating the primary key, this record identifier is composed of the primary key before the update and the primary key after the update. Columns 1 to k are the updated data of the record to be updated. It is.
  • FIG. 4 is a flowchart showing a processing procedure of the difference group distribution unit 220 shown in FIG.
  • the difference log reading unit 222 reads the difference log sequentially from the difference log file 210 (step S401), and when there is no difference log. (No at Step S402), and the process ends.
  • the charge determination unit 222 is in charge of processing the difference log based on the result of applying the hash function to the primary key. Is determined (step S 4 0 3), and if the difference is not the update of the primary key (No at step S 4 04), the difference log delivery unit 2 2 4 is responsible for the difference log. 22 Deliver to the difference log application unit determined in 2. And the difference log distribution unit 2
  • step S40 the process returns to step S401 to process the next difference log.
  • the primary key update conversion unit 222 deletes the difference log using the primary key before update as a record identifier. (Step S 406), and handover to the difference log application unit determined by the responsible unit 222 (Step S 407). Also, the primary key update converter 2 2 3
  • the difference key is changed to the entry key using the updated primary key as the record identifier (step S408), and is transferred to the difference log application unit determined by the responsible unit 222 (step S408).
  • step S409 the difference log distribution unit 220 returns to step S401 to process the next difference log.
  • the primary key update conversion unit 2 23 records the primary key before update from the differential key as the record identifier and the primary key after update as the record identifier. Create an insertion log as an identifier, and apply the difference log application part 2 3 ( ⁇ ⁇ ?
  • FIG. 5 is a flowchart showing a processing procedure of the difference log application unit 23 shown in FIG.
  • the difference log application unit 230 i receives the difference log from the difference log distribution unit 220 (step S 5 0 1).
  • the transaction type of the difference received by the transaction control unit 232 is determined (step S502), and a transaction process according to the log type is performed. That is, if the entry type is “IN SERT”, the transaction control unit 232 inserts the record specified in the difference log into the database 240 (step S503), and If the type is "DELETE", the record specified by the difference log is deleted from the database 240 (step S504), and if the log type is "UPDATE", the database 24 is deleted. The designated record is updated in the difference log of 0 (step S550).
  • step S506 it is checked whether or not the number of processed difference logs exceeds the specified number.
  • the specified number is the number of transactions for which the transaction end processing is performed collectively, specified by a parameter, and the transaction log end processing is performed collectively to speed up the difference log application processing. Can be.
  • the number of processed cases of the difference entry does not exceed the specified number, “1” is added to the number of processed cases (step S507), and the process ends.
  • the database reflection unit 233 collects the processing results of the specified number of difference logs and terminates the transaction.
  • the commit process reflecting the data in 240 is performed (step S 508), the number of processes is initialized (step S 509), and the process ends.
  • the database reflection unit 233 performs the commit process of reflecting the processing results of the difference log in a fixed number of cases and reflecting the result in the database 240, thereby speeding up the difference log application process.
  • the difference log distribution unit 220 uses the primary key before update from the difference log as a record identifier, and the primary key after updating to create a ⁇ log to record identifier, by passing to the difference log application unit 2 3 0! ⁇ 2 3 O n, between the difference log application unit 2 3 ⁇ ⁇ ⁇ 2 3 ⁇ ⁇ This eliminates the need for synchronizing the processing, thereby speeding up the processing of the difference log.
  • the difference log application unit 23 C ⁇ S 30 n performs a commit process in which the processing result of the difference log is collectively reflected in a fixed number of cases and reflected in the database 240 so that the difference The speed of the lip application process can be increased.
  • the difference key is sorted using the primary key in the difference word.
  • the present invention is not limited to this. The same can be applied to the case of distributing difference logs using a key for specifying a physical location in order to achieve distribution.
  • FIG. 6 is a diagram showing a computer system that executes the database duplication program according to the present embodiment.
  • the computer system 100 includes a main body 101, and a display 102 that displays information such as images on a display screen 102a according to an instruction from the main body 101.
  • a keyboard 103 for inputting various information to the computer system 100, a mouse 104 for designating an arbitrary position on the display screen 102a of the display 102, and a local area.
  • LAN 106 has a LAN interface that connects to a network (LAN) 106 or a wide area network (WAN), and a modem 105 that connects to a public line 107 such as the Internet.
  • LAN 106 is the other computer system (P C) 111, server 112, printer 113, etc. are connected to computer system 100.
  • FIG. 7 is a functional block diagram showing the configuration of the main body 101 shown in FIG.
  • the main unit 101 includes a CPU 121, a RAMI 22, a ROM 123, a hard disk drive (HDD) 124, a CD-ROM drive 125, an FD drive 126, and an I / O interface 127. And a LAN interface 128.
  • the database duplication program executed in the computer system 100 is stored in a portable storage medium such as a floppy disk (FD) 108, a CD-ROM 109, a DVD disk, a magneto-optical disk, or an IC card. It is read from the medium and installed in the computer system 100.
  • a portable storage medium such as a floppy disk (FD) 108, a CD-ROM 109, a DVD disk, a magneto-optical disk, or an IC card.
  • the database duplication program may include a database of the server 112 connected via the LAN interface 128, a database of another computer system (PC) 111, and another database connected via the public line 107.
  • the data is stored in a data base system database or the like, read from these data bases, and installed in the computer system 100.
  • the installed database duplication program is stored in the HDD 124, and is executed by the CPU 121 using the RAMI 22, the ROM 123, and the like.
  • a difference log is distributed to a plurality of parallel processing targets based on predetermined information of a difference log, and the difference between the respective parallel processing targets distributed to the plurality of parallel processing targets is determined. Since the process of applying the log to the database of the clone system is configured to be performed in parallel, the effect is obtained that the difference log can be processed at high speed.
  • the difference log to be distributed is an update of the primary key
  • the difference log is deleted by deleting the record identified by the primary key before the update.
  • the record in which the primary key was replaced with the updated primary key is divided into the insertion log to be imported, and the divided deletion log and the entrance log are configured to be distributed. This eliminates the need for synchronization, and thus has the effect of processing differential logs at high speed.
  • the database duplication program and the database duplication device according to the present invention are suitable for updating a database by a clone system that takes over an online job whose master system has been stopped due to a disaster or the like.

Landscapes

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

Abstract

A database copying program for receiving a content of database updating performed in a master system as a difference log and applying the received difference log to a database of a clone system. A plurality of difference logs are processed in parallel and applied to a database. When the difference log is a main key updating, the program causes a computer to execute a processing to create a deletion log using the main key before the updating as a record identifier and an insertion log using the main key after the updating as a record identifier from the difference log. Moreover, the program causes the computer to execute a processing to terminate a transaction by collecting a predetermined number of difference log processing results.

Description

明 細 書 データベース複製プログラムおよびデータベース複製装置  Description Database replication program and database replication device
技術分野 Technical field
この発明は、 マスタシステムでおこなわれたデータベースの更新内容を差分口 グとして受け取り、 受け取った差分ログをクローンシステムのデータベースに適 用するデータベース複製プログラムおよびデータベース複製装置に関し、 特に、 複数の差分ログの並列処理間での同期を不要とし、 もって差分ログを高速に処理 することができるデータベース複製プログラムおよぴデータベース複製装置に関 するものである。  The present invention relates to a database duplication program and a database duplication device that receive, as a differential log, the update contents of a database performed in a master system, and apply the received differential log to a database of a clone system. The present invention relates to a database duplication program and a database duplication device that do not require synchronization between parallel processes and can thereby process difference logs at high speed.
背景技術 Background art
従来、 2 4時間停止することなく稼動する必要があるオンラインシステムでは 、 災害対策センターなどにマスタシステムと同一のクローンシステムを設け、 災 害や保守などによってマスタシステムが利用できなレ、場合に、 クローンシステム を用いてオンライン業務を継続できるようにシステムが構築されている。 クロー ンシステムは、 マスタシステムでおこなわれたデータベースの更新内容をネット ワークなどを経由して差分口グとして受け取り、 受け取った差分ログをクローン システムのデータベースに適用することによって、 常にオンラィン業務の引き継 ぎに備えている。 このような、 あるサイトのデータベースの更新を他のサイトの データベースに反映させる技術については、 たとえば、 特開 2 0 0 1— 7 5 8 5 Conventionally, in online systems that need to be operated without interruption for 24 hours, the same clone system as the master system is installed in a disaster response center, etc., and if the master system cannot be used due to disaster or maintenance, The system has been constructed so that online operations can be continued using the clone system. The clone system receives the update contents of the database performed by the master system as a difference log via the network, etc., and applies the received difference log to the database of the clone system to always take over the online business. To prepare Such a technique for reflecting a database update at one site in a database at another site is disclosed in, for example, Japanese Patent Application Laid-Open No. 2001-7585.
2号公報に開示されている。 No. 2 discloses this.
クローンシステムを用いる場合、 マスタシステムからクローンシステムへの切 り替えにともなうオンライン業務の停止時間を短くするために、 マスタシステム のデータベースの更新内容をできるだけ短い時間でクローンシステムのデータベ ースに反映させる必要がある。 このため、 差分ログをできるだけ速くクローンシ ステムに転送するとともに、 クローンシステムでの差分ログの処理を高速化する ことが重要となる。 When a clone system is used, the updated contents of the master system database are reflected in the clone system database as quickly as possible in order to reduce the downtime of online operations when switching from the master system to the clone system. There is a need. For this reason, clone the difference log as quickly as possible. It is important to transfer differential logs to the clone system and to speed up processing of difference logs in the clone system.
しかし、 これまでのクローンシステムでは、 マスタシステムと比較して差分口 グを処理する速度が遅く、 マスタシステムのオンライン業務の負荷が高い場合に は、 差分ログが滞留し、 クローンシステムへの高速な切り替えをおこなうことが できなかった。 その原因は、 マスタシステムでは複数のプロセスが並列にトラン ザクション処理を実行して差分口グを生成するのに対して、 クローンシステムで は一つのプロセスだけが差分ログを処理している点にある。  However, in the conventional clone system, the processing speed of the difference log is slower than that of the master system, and when the load of the online operation of the master system is high, the difference log is accumulated and the clone system has a high speed. Switching could not be performed. The cause is that, in the master system, multiple processes execute transaction processing in parallel to generate a difference log, whereas in the clone system, only one process processes the difference log. .
そこで、 クローンシステムにおいても、 複数のプロセスによつて並列に差分口 グを処理することが考えられる。 しかしながら、 単に複数のプロセスに差分ログ の処理を分散させるだけでは、 差分口グ間の処理順序を守る必要がある場合にプ 口セス問の同期が必要となり、 並列処理の効果が得られないという問題があった この発明は、 上述した従来技術による問題点を解消するためになされたもので あり、 複数の差分口グの並列処理間での同期を不要とし、 もって差分口グを高速 に処理することができるデータベース複製プログラムおよびデータベース複製装 置を提供することを目的としている。 発明の開示  Therefore, even in a clone system, it is conceivable to process difference logs in parallel by multiple processes. However, simply distributing the difference log processing to multiple processes requires synchronization of the process questions when it is necessary to keep the processing order between the difference logs, and the effect of parallel processing cannot be obtained. SUMMARY OF THE INVENTION The present invention, which had a problem, was made in order to solve the above-mentioned problem of the prior art, and eliminates the need for synchronization between parallel processing of a plurality of differential ports, thereby processing the differential ports at high speed. It is intended to provide a database duplication program and a database duplication device that can perform the operations. Disclosure of the invention
上述した課題を解決し、 目的を達成するため、 本発明は、 マスタシステムでお こなわれたデータベースの更新内容を差分ログとして受け取り、 該受け取った差 分ログをクローンシステムのデータベースに適用するデータベース複製プログラ ムであって、 前記差分口グの所定の情報に基づいて該差分口グを複数の並列処理 対象に振り分ける差分ログ振分手順と、 前記差分ログ振分手順により複数の並列 処理対象に振り分けられたそれぞれの並列処理対象の差分口グを前記クローンシ ステムのデータベースに適用する処理を並列におこなう差分口グ並列適用手順と In order to solve the above-described problems and achieve the object, the present invention provides a database which receives, as a difference log, an update content of a database performed in a master system, and applies the received difference log to a database of a clone system. A difference log distribution procedure for allocating the difference log to a plurality of parallel processing targets based on predetermined information of the difference log, and a plurality of parallel processing targets by the difference log distribution procedure. A difference log parallel application procedure for performing in parallel a process of applying each of the sorted differential logs to the database of the clone system;
、 をコンピュータに実行させることを特徴とする。 また、 本発明は、 マスタシステムでおこなわれたデータベースの更新内容を差 分ログとして受け取り、 該受け取った差分ログをクローンシステムのデータべ一 スに適用するデータベース複製装置であって、 前記差分ログの所定の情報に基づ いて該差分口グを複数の並列処理対象に振り分ける差分ログ振分手段と、 前記差 分口グ振分手段により複数の並列処理対象に振り分けられたそれぞれの並列処理 対象の差分口グを前記ク口ーンシステムのデータベースに適用する処理を並列に おこなう複数の差分口グ並列適用手段と、 を備えたことを特徴とする。 , Is executed by a computer. Also, the present invention is a database replication device that receives, as a difference log, the update content of a database performed in a master system, and applies the received difference log to a database of a clone system. A difference log distribution means for allocating the difference group to a plurality of parallel processing targets based on predetermined information; and a plurality of parallel processing objects allocated to the plurality of parallel processing targets by the difference group distribution means. And a plurality of difference log parallel application means for performing processing for applying the difference log to the database of the quenching system in parallel.
力かる発明によれば、 差分口グの所定の情報に基づいて差分口グを複数の並列 処理対象に振り分け、 複数の並列処理対象に振り分けたそれぞれの並列処理対象 の差分ログをクローンシステムのデータベースに適用する処理を並列におこなう こととしたので、 差分口グを高速に処理することができる。  According to the powerful invention, the differential group is allocated to a plurality of parallel processing targets based on predetermined information of the differential group, and the difference logs of the respective parallel processing targets allocated to the plurality of parallel processing targets are stored in a database of a clone system. Since the processing to be applied is performed in parallel, the difference can be processed at high speed.
また、 本発明は、 振り分ける差分ログが主キーの更新である場合に、 差分ログ を更新前の主キーで識別されるレコードを削除する削除ログとレコードの主キー を更新後の主キーで置き換えたレコードを揷入する揷入口グとに分割し、 分割し た削除口グと揷入口グを振り分けることを特徴とする。  Also, according to the present invention, when the difference log to be distributed is an update of the primary key, the difference log is deleted and the record identified by the primary key before the update is replaced with the deleted log and the primary key of the record is replaced with the updated primary key. The record is divided into the entry and the entry to be imported, and the divided entry and the entry are divided.
この発明によれば、 振り分ける差分ログが主キーの更新である場合に、 差分口 グを更新前の主キーで識別されるレコードを削除する削除ログとレコードの主キ 一を更新後の主キーで置き換えたレコードを揷入する揷入ログとに分割し、 分割 した削除口グと揷入口グを振り分けることとしたので、 複数の差分ログの並列処 理間での同期を不要とし、 もって差分ログを高速に処理することができる。 図面の簡単な説明  According to the present invention, when the difference log to be distributed is an update of the primary key, the difference log deletes the record identified by the primary key before the update, and the deletion log and the primary key after the update of the primary key of the record. The records replaced in step 4 are divided into the input logs to be imported, and the divided deletion ports and input ports are distributed.Therefore, synchronization between multiple parallel processing of multiple difference logs is not required, and the difference Logs can be processed at high speed. BRIEF DESCRIPTION OF THE FIGURES
第 1図は、 本実施の形態に係るデータベース複製装置による主キー更新の概念 を説明するための説明図であり、 第 2図は、 本実施の形態に係るデータベース複 製装置の構成を示す機能プロック図であり、 第 3図は、 第 2図に示した差分ログ ファイルに格納される差分ログの一例を示す図であり、 第 4図は、 第 2図に示し た差分ログ振分部の処理手順を示すフローチャートであり、 第 5図は、 第 2図に 示した差分ログ適用部の処理手順を示すフローチャートであり、 第 6図は、 本実 施の形態に係るデータベース複製プログラムを実行するコンピュータシステムを 示す図であり、 第 7図は、 第 6図に示した本体部の機能構成を示す機能ブロック 図である。 FIG. 1 is an explanatory diagram for explaining a concept of a primary key update by the database duplication device according to the present embodiment, and FIG. 2 is a function showing a configuration of the database duplication device according to the present embodiment. FIG. 3 is a diagram showing an example of the difference log stored in the difference log file shown in FIG. 2, and FIG. 4 is a diagram showing the difference log distribution unit shown in FIG. FIG. 5 is a flowchart showing a processing procedure. FIG. 6 is a flowchart showing a processing procedure of the difference log application unit shown in FIG. 6, FIG. 6 is a diagram showing a computer system that executes a database duplication program according to the present embodiment, and FIG. FIG. 3 is a functional block diagram showing a functional configuration of the main body shown.
発明を実施するための最良の形態 BEST MODE FOR CARRYING OUT THE INVENTION
以下、 添付図面を参照して、 この発明に係るデータベース複製プログラムおよ びデータベース複製装置の好適な実施の形態を詳細に説明する。 まず、 本実施の形態に係るデータベース複製装置による主キー更新の概念につ いて説明する。 第 1図は、 本実施の形態に係るデータベース複製装置による主キ 一更新の概念を説明するための説明図である。 本実施の形態では、 差分ログをデ ータベースへ適用する差分ログ適用部を複数設け、 複数の差分口グ適用部を並列 に動作させることによって差分口グの処理を高速化している。 そして、 各差分口 グが有する主キーに基づいて複数の差分口グ適用部の中から一つの差分ログ適用 部を選択し、 選択した差分口グ適用部が差分口グをデータベースに適用している  Hereinafter, preferred embodiments of a database duplication program and a database duplication device according to the present invention will be described in detail with reference to the accompanying drawings. First, the concept of primary key updating by the database duplication device according to the present embodiment will be described. FIG. 1 is an explanatory diagram for explaining the concept of updating a primary key by the database duplication device according to the present embodiment. In the present embodiment, a plurality of difference log application units for applying the difference log to the database are provided, and the processing of the difference log is speeded up by operating the plurality of difference log application units in parallel. Then, one difference log application unit is selected from the plurality of difference log application units based on the primary key of each difference log, and the selected difference log application unit applies the difference log to the database. Is
たとえば、 第 1図において、 主キー A更新部は、 主キーが Aである差分口グを データベースに適用する差分ログ適用部であり、 主キー C更新部は、 主キーが C である差分口グをデ一タベースに適用する差分口グ適用部であり、 主キ一 D更新 部は、 主キーが Dである差分ログをデータベースに適用する差分ログ適用部であ る。 なお、 ここでは、 主キーの数だけ差分ログ適用部を設ける場合を示している 力 S、 一つの差分ログ適用部が複数の主キーを処理することもできる。 For example, in FIG. 1, the primary key A update unit is a difference log application unit that applies the difference key whose primary key is A to the database, and the primary key C update unit is a difference log application unit whose primary key is C. The primary key D updating unit is a differential log applying unit that applies a differential log whose primary key is D to a database. Here, the case where the difference log application units are provided by the number of primary keys is shown. The force S, and one difference log application unit can process a plurality of primary keys.
このように、 複数の差分ログ適用部を設けて差分ログを並列に処理することに よって差分口グの処理を高速化することができる力 差分口グが主キーを更新す る場合には、 差分ログ適用部間での同期が必要となり、 並列処理を十分に活力す ことができない。  In this way, by providing a plurality of difference log application units and processing the difference logs in parallel, it is possible to speed up the processing of the difference logs. Synchronization is required between the difference log application units, and parallel processing cannot be fully utilized.
たとえば、 第 1図において、 第 1ログが主キー Cを Dに更新する差分ログであ り、 第 2ログが主キー Dの 「カラム 1」 を更新する差分ログであり、 第 3ログが 主キー Aを Cに更新する差分ログである場合に、 第 1図 (a ) に示すように、 更 新前の主キーの値に基づいて差分ログ適用部を選択し、 主キー C更新部が第 1口 グを処理することとすると、 主キー C更新部が第 1口グを処理した後でなければ 、 主キー D更新部は第 2ログを処理することができず、 また、 主キー A更新部は 第 3ログを処理することができない。 したがって、 主キー D更新部および主キー A更新部は、 主キー更新部 Cと並列に動作できる利点を活かすことができず、 並 列化による効果が得られない。 For example, in Fig. 1, the first log is a differential log that updates primary key C to D. If the second log is a difference log that updates “column 1” of primary key D and the third log is a difference log that updates primary key A to C, as shown in Fig. 1 (a) Then, if the difference log application unit is selected based on the value of the primary key before update, and the primary key C update unit processes the first log, the primary key C update unit processes the first log. Only after that, the primary key D updating unit cannot process the second log, and the primary key A updating unit cannot process the third log. Therefore, the primary key updating unit and the primary key updating unit cannot take advantage of the fact that they can operate in parallel with the primary key updating unit C, and the effect of parallelization cannot be obtained.
また、 第 1図 (b ) に示すように、 更新後の主キーの値に基づいて差分ログ適 用部を選択し、 主キー D更新部が第 1ログを処理することとすると、 主キー D更 新部が第 1口グを処理した後でなければ、 主キー C更新部は第 3口グを処理する ことができない。 したがって、 主キー C更新部は、 主キー D更新部と並列に動作 できる利点を活かすことができず、 並列化による効果が得られない。  Also, as shown in Fig. 1 (b), if the difference log application unit is selected based on the updated primary key value, and the primary key D update unit processes the first log, the primary key The primary key C updating unit cannot process the third port until the D updating unit processes the first port. Therefore, the primary key C updating unit cannot take advantage of the fact that it can operate in parallel with the primary key D updating unit, and the effect of parallelization cannot be obtained.
このように、 三つの差分ログ適用部を設けて差分ログを並列に処理したとして も、 単に差分口グを分散させるだけでは、 差分口グが主キーを更新する場合に、 関連する差分口グ処理間での同期が必要となり、 差分口グの並列処理ができず、 処理速度を向上することができない。  As described above, even if three difference log application units are provided and the difference logs are processed in parallel, if the difference logs are simply updated, the related difference logs are updated when the difference logs update the primary key. Synchronization between processes is required, so that parallel processing of difference logs cannot be performed, and the processing speed cannot be improved.
そこで、 本実施の形態に係るデータベース複製装置では、 第 1図 (c ) に示す ように、 主キーを更新する差分口グを、 更新前の主キーを有するレコードを削除 する削除口グと、 更新後の主キーを有するレコードを揷入する揷入口グとに分割 して処理する。 具体的には、 主キー Cを Dに更新する第 1ログを、 主キー Cを有 するレコードの削除ログと主キー Dを有するレコードの揷入ログに分割して処理 し、 主キー Aを Cに更新する第 3ログを、 主キー Aを有するレコードの削除ログ と主キー Cを有するレコードの揷入口グに分割して処理する。  Therefore, in the database duplication apparatus according to the present embodiment, as shown in FIG. 1 (c), a difference key for updating the primary key, a deletion key for deleting the record having the primary key before the update, The record having the updated primary key is divided into an entry and an entry for processing. Specifically, the first log that updates primary key C to D is divided into a delete log for records with primary key C and an import log for records with primary key D, and is processed. The third log to be updated to C is divided into a deletion log for the record with the primary key A and an entry for the record with the primary key C for processing.
このように、 本実施の形態に係るデータベース複製装置では、 主キーを更新す る差分口グを、 削除口グと挿入口グに分割して処理することにより、 差分口グ処 理部間での同期を不要とし、'もって差分ログ処理の高速化を図っている。 次に、 本実施の形態に係るデータベース複製装置の構成について説明する。 第 2図は、 本実施の形態に係るデータベース複製装置の構成を示す機能プロック図 である。 なお、 このデータベース複製装置は、 クローンシステムの一部として使 用される。 同図に示すように、 このデータベース'複製装置 2 0 0は、 差分ログフ アイル 2 1 0と、 差分ログ振分部 2 2 0と、 n個の差分ログ適用部 2 3 (^〜 2 3 0 nと、 データベース 2 4 0とを有する。 As described above, in the database duplication apparatus according to the present embodiment, the difference key for updating the primary key is divided into the deletion port and the insertion port and processed, so that the difference port processing unit This eliminates the need for synchronization, thereby speeding up differential log processing. Next, the configuration of the database duplication device according to the present embodiment will be described. FIG. 2 is a functional block diagram showing the configuration of the database duplication device according to the present embodiment. This database replication device is used as a part of the clone system. As shown in the figure, the database 'replicating device 200 includes a difference log file 210, a difference log distribution unit 220, and n difference log application units 23 (^ to 230). n and a database 240.
差分ログフアイノレ 2 1 0は、 マスタシステムがマスタシステムのデータベース を更新した内容を差分口グとして蓄積したフアイルであり、 マスタシステムから ネットワークなどを介して転送される。  The difference log file 210 is a file in which the master system updates the database of the master system as a difference log and is transferred from the master system via a network or the like.
差分口グ振分部 2 2 0は、 差分口グの主キーに基づいて差分ログを差分ログ適 用部 2 3 0 ^ 2 3 0 nに振り分ける処理部であり、 差分ログを差分ログフアイ ル 2 1 0から読み込む差分口グ読込部 2 2 1と、 差分ログの主キーにハッシュ関 数を適用して差分ログ適用部を決定する担当決定部 2 2 2と、 差分ログが主キー 更新口グである場合にその差分口グを削除口グと挿入口グとに分割する主キ一更 新変換部 2 2 3と、 差分口グ適用部 2 3 0 〜 2 3 0 nに差分口グを引渡す差分 ログ引渡し部 2 2 4とを有する。 The difference opening grayed distribution unit 2 2 0 is a processing unit that distributes the difference log in the difference log apply for part 2 3 0 ^ 2 3 0 n based on the primary key of the difference opening grayed, the difference the difference log Rogufuai Le 2 1 The difference log reading unit 2 2 1 to read from 0, the charge determination unit 2 2 2 that determines the difference log application unit by applying the hash function to the primary key of the difference log, and the difference log , The main key update converter 2 23 that divides the difference query into a deletion query and an insertion query, and the difference query application module 2 3 0 to 2 3 0 n. Delivery difference Log delivery unit 2 2 4
この差分ログ振分部 2 2 0が、 主キーを更新する差分ログを削除ログと揷入口 グとに分割し、 分割した削除口グと挿入口グとを差分口グ適用部 2 3 0 〜 2 3 0 nに振り分けることによって、 差分ログ適用部 2 3 0 i〜2 3 0 n間での処理の 同期が不要となり、 差分口グ適用部 2 3 0 i〜 2 3 0 nが差分口グを完全に並列 に処理することができる。 The difference log distribution unit 220 divides the difference log for updating the primary key into a deletion log and an entry log, and divides the divided deletion log and insertion log into a difference log application block 230. 2 3 0 by allocation to n, the synchronization process between the differential log application unit 2 3 0 I~2 3 0 n is not required, the difference port grayed application unit 2 3 0 i to 2 3 0 n is the difference port grayed Can be processed completely in parallel.
また、 この差分ログ振分部 2 2 0が、 差分ログの主キーにハッシュ関数を適用 して差分ログ適用部を決定することによって、 差分ログ適用部 2 3 C^ S 3 0 nの数を主キーの数と比較して少なく抑えることができる。 Also, the difference log distribution unit 220 determines the difference log application unit by applying a hash function to the primary key of the difference log, and thereby determines the number of the difference log application units 23 C ^ S 30 n . It can be kept small compared to the number of primary keys.
差分ログ適用部2 3 0 1〜2 3 0 11は、 差分ログ振分部 2 2 0により振り分け られた差分ログをデータベース 2 4 0に適用する処理部であり、 各差分ログ適用 部は並列に動作する。 また、 各差分ログ適用部は、 それぞれ、 振り分けられた差 分ログを受け取る差分ログ受取部 2 3 1と、 受け取った差分ログを処理するトラ ンザクション制御部 2 3 2と、 差分口グの処理結果をデータベース 2 4 0に反映 するデータベース反映部 2 3 3とを有する。 Difference log application unit 2 3 0 21 to 3 0 11 is a processing unit for applying the difference log, which is distributed by the difference log distribution unit 2 2 0 in the database 2 4 0, parallel to each difference log application unit Operate. In addition, each difference log application unit, respectively, A difference log receiving unit 231, which receives the minute log, a transaction control unit 232, which processes the received difference log, and a database reflection unit 23, which reflects the processing result of the difference log in the database 240. Having.
データベース 2 4 0は、 マスタシステムが有するデータべ一スを複製したデー タベースであり、 マスタシステムに災害が発生した場合などにクローンシステム がオンライン業務を引き継ぐ場合に使用される。  The database 240 is a database that replicates the database of the master system, and is used when the clone system takes over online operations in the event of a disaster occurring in the master system.
次に、 第 2図に示した差分ログフアイノレ 2 1 0に格納される差分口グについて 説明する。 第 3図は、 第 2図に示した差分ログフアイノレ 2 1 0に格納される差分 ログの一例を示す図である。 同図 (a ) は挿入ログを示し、 同図 (b ) は削除口 グを示し、 同図 (c ) は更新ログを示している。  Next, the difference log stored in the difference log file 210 shown in FIG. 2 will be described. FIG. 3 is a diagram showing an example of a difference log stored in the difference log file 210 shown in FIG. (A) shows the insertion log, (b) shows the deletion log, and (c) shows the update log.
同図 (a ) に示すように、 揷入ログは、 ログ種別と、 レコード識別子と、 第 1 力ラム〜第 kカラムとを有する。 口グ種別は、 差分ログの種別を示し、 揷入ログ の場合には、 Γ I N S E R T J である。 レコード識別子は、 データベースに揷入 するレコードの主キ一であり、 挿入するレコードを識別するために用いられる。 第 1カラム〜第 kカラムは、 挿入するレコードのデータである。 そして、 レコー ド識別子と第 1カラム〜第 kカラムがデータベース 2 4 0に挿入するレコードを 構成する。  As shown in FIG. 7A, the input log has a log type, a record identifier, and a first to a k-th columns. The log type indicates the type of the difference log. In the case of the input log, it is ΓINS ERTJ. The record identifier is the primary key of the record to be inserted into the database, and is used to identify the record to be inserted. The first to k-th columns are the data of the record to be inserted. The record identifier and the first to k-th columns constitute a record to be inserted into the database 240.
また、 同図 (b ) に示すように、 削除ログは、 ログ種別と、 レコード識別子と を有する。 口グ種別は、 差分ログの種別を示し、 削除ログの場合には、 「D E L E T E J である。 レコード識別子は、 データベースから削除するレコードの主キ 一であり、 削除するレコードを識別するために用いられる。  Also, as shown in FIG. 14B, the deletion log has a log type and a record identifier. The entry type indicates the type of the difference log. In the case of the deletion log, it is "DELETEJ. The record identifier is the primary key of the record to be deleted from the database, and is used to identify the record to be deleted. .
また、 同図 (c ) に示すように、 更新ログは、 ログ種別と、 レコード識別子と 、 第 1カラム〜第 kカラムとを有する。 ログ種別は、 差分ログの種別を示し、 更 新ログの場合には、 「U P D A T E」 である。 レコード識別子は、 更新するレコ 一ドの主キーであり、 更新するレコードを識別するために用いられる。 このレコ ード識別子は、 主キーを更新する場合には、 更新前の主キーと更新後の主キーと 力 ら構成される。 第 1カラム〜第 kカラムは、 更新するレコードの更新後のデー タである。 Also, as shown in FIG. 14C, the update log has a log type, a record identifier, and first to k-th columns. The log type indicates the type of the difference log. For an update log, it is "UPDATE". The record identifier is the primary key of the record to be updated, and is used to identify the record to be updated. When updating the primary key, this record identifier is composed of the primary key before the update and the primary key after the update. Columns 1 to k are the updated data of the record to be updated. It is.
次に、 第 2図に示した差分ログ振分部 2 2 0の処理手順について説明する。 第 4図は、 第 2図に示した差分口グ振分部 2 2 0の処理手順を示すフ口一チヤ一ト である。 同図に示すように、 この差分ログ振分部 2 2 0は、 差分ログ読込部 2 2 1が差分ログフアイノレ 2 1 0から差分ログを順に読み込み (ステップ S 4 0 1 ) 、 差分ログが無くなると (ステップ S 4 0 2の否定) 、 処理を終了する。  Next, the processing procedure of the difference log distribution unit 220 shown in FIG. 2 will be described. FIG. 4 is a flowchart showing a processing procedure of the difference group distribution unit 220 shown in FIG. As shown in the figure, in the difference log distribution unit 220, the difference log reading unit 222 reads the difference log sequentially from the difference log file 210 (step S401), and when there is no difference log. (No at Step S402), and the process ends.
一方、 差分ログが有る場合には (ステップ S 4 0 2の肯定) 、 担当決定部 2 2 2が主キーにハッシュ関数を適用した結果に基づいて差分口グの処理を担当する 差分ログ適用部を決定し (ステップ S 4 0 3 ) 、 差分口グが主キーの更新でない 場合には (ステップ S 4 0 4の否定) 、 差分口グ引渡し部 2 2 4が差分ログを担 当決定部 2 2 2が決定した差分ログ適用部に引渡す。 そして、 差分ログ振分部 2 On the other hand, if there is a difference log (Yes at step S402), the charge determination unit 222 is in charge of processing the difference log based on the result of applying the hash function to the primary key. Is determined (step S 4 0 3), and if the difference is not the update of the primary key (No at step S 4 04), the difference log delivery unit 2 2 4 is responsible for the difference log. 22 Deliver to the difference log application unit determined in 2. And the difference log distribution unit 2
2 0は、 ステップ S 4 0 1に戻って次の差分口グを処理する。 In step S40, the process returns to step S401 to process the next difference log.
これに対して、 差分ログが主キーの更新である場合には (ステップ S 4 0 4の 肯定) 、 主キー更新変換部 2 2 3が更新前の主キーをレコード識別子として差分 ログを削除ログに変更し (ステップ S 4 0 6 ) 、 担当決定部 2 2 2が決定した差 分ログ適用部に引渡す (ステップ S 4 0 7 ) 。 また、 主キー更新変換部 2 2 3は On the other hand, when the difference log is an update of the primary key (Yes at step S404), the primary key update conversion unit 222 deletes the difference log using the primary key before update as a record identifier. (Step S 406), and handover to the difference log application unit determined by the responsible unit 222 (Step S 407). Also, the primary key update converter 2 2 3
、 更新後の主キーをレコード識別子として差分口グを揷入口グに変更し (ステツ プ S 4 0 8 ) 、 担当決定部 2 2 2が決定した差分ログ適用部に引渡す (ステップThen, the difference key is changed to the entry key using the updated primary key as the record identifier (step S408), and is transferred to the difference log application unit determined by the responsible unit 222 (step S408).
S 4 0 9 ) 。 そして、 差分ログ振分部 2 2 0は、 ステップ S 4 0 1に戻って次の 差分ログを処理する。 S409). Then, the difference log distribution unit 220 returns to step S401 to process the next difference log.
このように、 差分ログが主キーの更新である場合に、 主キー更新変換部 2 2 3 が差分口グから更新前の主キーをレコード識別子とする削除口グおよび更新後の 主キーをレコード識別子とする挿入ログを作成し、 差分ログ適用部 2 3 (^〜?  As described above, when the difference log is an update of the primary key, the primary key update conversion unit 2 23 records the primary key before update from the differential key as the record identifier and the primary key after update as the record identifier. Create an insertion log as an identifier, and apply the difference log application part 2 3 (^ ~?
3 0„に引渡すことにより、 差分ログ適用部 2 3 0 3 0 n間での処理の同期 を不要とし、 もって差分ログの処理を高速化することができる。 By passing the 3 0 ", the synchronization process between the differential log application unit 2 3 0 3 0 n is unnecessary, it is possible to speed up the process of difference log has.
次に、 第 2図に示した差分ログ適用部 2 3 0 i〜2 3 0 nの処理手順について 説明する。 なお、 これらの差分ログ適用部 2 3 0 〜2 3 0 nはいずれも同様の 処理をおこなうので、 ここでは差分口グ適用部 2 3 0 を例にとって説明する。 第 5図は、 第 2図に示した差分ログ適用部 2 3 の処理手順を示すフローチヤ 一トである。 Next, the processing procedure of the difference log application unit 230 i to 230 n shown in FIG. 2 will be described. Note that these difference log application units 230 to 230 n all have the same Since the processing is performed, a description will be given here by taking the difference keyword application unit 230 as an example. FIG. 5 is a flowchart showing a processing procedure of the difference log application unit 23 shown in FIG.
同図に示すように、 この差分口グ適用部 2 3 0 iは、 差分口グ受取部 2 3 1が 差分ログ振分部 2 2 0から差分口グを受け取り (ステップ S 5 0 1 ) 、 トランザ クション制御部 2 3 2が受け取つた差分口グの口グ種別を判定し (ステップ S 5 0 2 ) 、 ログ種別に応じたトランザクション処理をおこなう。 すなわち、 トラン ザクション制御部 2 3 2は、 口グ種別が 「IN S E R T」 である場合には、 デー タベース 2 4 0に差分ログで指定されたレコードを挿入し (ステップ S 5 0 3 ) 、 ログ種別が 「D E L E T E」 である場合には、 データベース 2 4 0から差分口 グで指定されたレコードを削除し (ステップ S 5 0 4 ) 、 ログ種別が 「U P D A T E」 である場合には、 データベース 2 4 0の差分ログで指定されたレコードを 更新する (ステップ S 5 0 5 ) 。  As shown in the figure, the difference log application unit 230 i receives the difference log from the difference log distribution unit 220 (step S 5 0 1). The transaction type of the difference received by the transaction control unit 232 is determined (step S502), and a transaction process according to the log type is performed. That is, if the entry type is “IN SERT”, the transaction control unit 232 inserts the record specified in the difference log into the database 240 (step S503), and If the type is "DELETE", the record specified by the difference log is deleted from the database 240 (step S504), and if the log type is "UPDATE", the database 24 is deleted. The designated record is updated in the difference log of 0 (step S550).
そして、 差分ログの処理件数が指定件数を超えたか否かを調べる (ステップ S 5 0 6 ) 。 ここで、 指定件数とは、 トランザクションの終了処理をまとめておこ なう トランザクション数をパラメータによって指定したものであり、 トランザク ションの終了処理をまとめておこなうことにより、 差分ログ適用処理を高速化す ることができる。 そして、 差分口グの処理件数が指定件数を超えていない場合に は、 処理件数に 「1」 を加え (ステップ S 5 0 7 ) 、 処理を終了する。  Then, it is checked whether or not the number of processed difference logs exceeds the specified number (step S506). Here, the specified number is the number of transactions for which the transaction end processing is performed collectively, specified by a parameter, and the transaction log end processing is performed collectively to speed up the difference log application processing. Can be. Then, if the number of processed cases of the difference entry does not exceed the specified number, “1” is added to the number of processed cases (step S507), and the process ends.
一方、 差分ログの処理件数が指定件数を超えた場合には、 データベース反映部 2 3 3が指定件数の差分口グの処理結果をまとめてトランザクションの終了処理 、 すなわち、 差分ログの処理結果をデータベース 2 4 0に反映する commit処理を おこない (ステップ S 5 0 8 ) 、 処理件数を初期化し (ステップ S 5 0 9 ) 、 処 理を終了する。  On the other hand, if the number of processed difference logs exceeds the specified number, the database reflection unit 233 collects the processing results of the specified number of difference logs and terminates the transaction. The commit process reflecting the data in 240 is performed (step S 508), the number of processes is initialized (step S 509), and the process ends.
このように、 このデータベース反映部 2 3 3が差分ログの処理結果を一定の件 数まとめてデータベース 2 4 0に反映する commit処理をおこなうことによって、 差分ログ適用処理を高速化することができる。 上述したように、 本実施の形態では、 差分ログが主キーの更新である場合に、 差分ログ振分部 2 2 0が、 差分ログから更新前の主キーをレコード識別子とする 削除口グおよび更新後の主キーをレコード識別子とする揷入ログを作成し、 差分 ログ適用部 2 3 0 ! ~ 2 3 O nに引渡すことによって、 差分ログ適用部 2 3 Ο χ ~ 2 3 Ο η間での処理の同期を不要とし、 もって差分ログの処理を高速ィ匕すること ができる。 As described above, the database reflection unit 233 performs the commit process of reflecting the processing results of the difference log in a fixed number of cases and reflecting the result in the database 240, thereby speeding up the difference log application process. As described above, in the present embodiment, when the difference log is an update of the primary key, the difference log distribution unit 220 uses the primary key before update from the difference log as a record identifier, and the primary key after updating to create a揷入log to record identifier, by passing to the difference log application unit 2 3 0! ~ 2 3 O n, between the difference log application unit 2 3 Ο χ ~ 2 3 Ο η This eliminates the need for synchronizing the processing, thereby speeding up the processing of the difference log.
また、 本実施の形態では、 差分ログ適用部 2 3 C^ S 3 0 nが差分ログの処 理結果を一定の件数まとめてデータベース 2 4 0に反映する commit処理をおこな うことによって、 差分口グ適用処理を高速化することができる。 Also, in the present embodiment, the difference log application unit 23 C ^ S 30 n performs a commit process in which the processing result of the difference log is collectively reflected in a fixed number of cases and reflected in the database 240 so that the difference The speed of the lip application process can be increased.
なお、 本実施の形態では、 差分口グの中の主キーを用いて差分口グを振り分け る場合について説明したが、 本発明はこれに限定されるものではなく、 たとえば 、 データベースの入出力処理分散を図るために、 物理位置を特定するキーを用い て差分ログを振り分ける場合にも同様に適用することができる。  In the present embodiment, a case has been described in which the difference key is sorted using the primary key in the difference word. However, the present invention is not limited to this. The same can be applied to the case of distributing difference logs using a key for specifying a physical location in order to achieve distribution.
また、 本実施の形態では、 データベース複製装置について説明したが、 このデ ータベース複製装置が有する構成をソフトウェアによって実現することで、 同様 の機能を有するデータベース複製プログラムを得ることができる。 そこで、 この デ一タベース複製プログラムを実行するコンピュータシステムについて説明する 第 6図は、 本実施の形態に係るデータベース複製プログラムを実行するコンビ ユータシステムを示す図である。 同図に示すように、 このコンピュータシステム 1 0 0は、 本体部 1 0 1と、 本体部 1 0 1からの指示により表示画面 1 0 2 aに 画像等の情報を表示するディスプレイ 1 0 2と、 このコンピュータシステム 1 0 0に種々の情報を入力するためのキーボード 1 0 3と、 ディスプレイ 1 0 2の表 示画面 1 0 2 a上の任意の位置を指定するマウス 1 0 4と、 ローカルエリアネッ トワーク (L AN) 1 0 6または広域エリアネットワーク (WAN) に接続する L ANインタフェースと、 インターネットなどの公衆回線 1 0 7に接続するモデ ム 1 0 5とを有する。 ここで、 L AN 1 0 6は、 他のコンピュータシステム (P C) 111、 サーバ 1 12、 プリンタ 113などとコンピュータシステム 100 とを接続している。 Further, in the present embodiment, the database duplication device has been described, but by realizing the configuration of this database duplication device by software, a database duplication program having a similar function can be obtained. Therefore, a computer system that executes the database duplication program will be described. FIG. 6 is a diagram showing a computer system that executes the database duplication program according to the present embodiment. As shown in the figure, the computer system 100 includes a main body 101, and a display 102 that displays information such as images on a display screen 102a according to an instruction from the main body 101. A keyboard 103 for inputting various information to the computer system 100, a mouse 104 for designating an arbitrary position on the display screen 102a of the display 102, and a local area. It has a LAN interface that connects to a network (LAN) 106 or a wide area network (WAN), and a modem 105 that connects to a public line 107 such as the Internet. Where LAN 106 is the other computer system (P C) 111, server 112, printer 113, etc. are connected to computer system 100.
また、 第 7図は、 第 6図に示した本体部 101の構成を示す機能プロック図で ある。 同図に示すように、 この本体部 101は、 CPU121と、 RAMI 22 と、 ROM123と、 ハードディスクドライブ (HDD) 124と、 CD— RO Mドライブ 125と、 FDドライブ 126と、 I /Oインタフェース 1 27と、 LANインタフェース 128とを有する。  FIG. 7 is a functional block diagram showing the configuration of the main body 101 shown in FIG. As shown in the figure, the main unit 101 includes a CPU 121, a RAMI 22, a ROM 123, a hard disk drive (HDD) 124, a CD-ROM drive 125, an FD drive 126, and an I / O interface 127. And a LAN interface 128.
そして、 このコンピュータシステム 100において実行されるデータベース複 製プログラムは、 フロッピィディスク (FD) 108、 CD— ROM109、 D VDディスク、 光磁気ディスク、 I Cカードなどの可搬型記憶媒体に記憶され、 これらの記憶媒体から読み出されてコンピュータシステム 100にインストール される。  The database duplication program executed in the computer system 100 is stored in a portable storage medium such as a floppy disk (FD) 108, a CD-ROM 109, a DVD disk, a magneto-optical disk, or an IC card. It is read from the medium and installed in the computer system 100.
あるいは、 このデータべ一ス複製プログラムは、 LANインタフェース 128 を介して接続されたサーバ 112のデータベース、 他のコンピュータシステム ( PC) 1 11のデータベース、 公衆回線 107を介して接続された他のコンビュ 一タシステムのデータベースなどに記憶され、 これらのデータベースから読み出 されてコンピュータシステム 100にインストーノレされる。  Alternatively, the database duplication program may include a database of the server 112 connected via the LAN interface 128, a database of another computer system (PC) 111, and another database connected via the public line 107. The data is stored in a data base system database or the like, read from these data bases, and installed in the computer system 100.
そして、 インストールされたデータベース複製プログラムは、 HDD 124に 記憶され、 RAMI 22、 R OM 123などを利用して CPU121により実行 される。  Then, the installed database duplication program is stored in the HDD 124, and is executed by the CPU 121 using the RAMI 22, the ROM 123, and the like.
以上説明したように、 本発明によれば、 差分ログの所定の情報に基づいて差分 口グを複数の並列処理対象に振り分け、 複数の並列処理対象に振り分けたそれぞ れの並列処理対象の差分ログをクローンシステムのデータベースに適用する処理 を並列におこなうよう構成したので、 差分ログを高速に処理することができると いう効果を奏する。  As described above, according to the present invention, a difference log is distributed to a plurality of parallel processing targets based on predetermined information of a difference log, and the difference between the respective parallel processing targets distributed to the plurality of parallel processing targets is determined. Since the process of applying the log to the database of the clone system is configured to be performed in parallel, the effect is obtained that the difference log can be processed at high speed.
また、 本発明によれば、 振り分ける差分ログが主キーの更新である場合に、 差 分口グを更新前の主キーで識別されるレコードを削除する削除口グとレコードの 主キーを更新後の主キーで置き換えたレコードを揷入する挿入ログとに分割し、 分割した削除口グと揷入口グを振り分けるよう構成したので、 複数の差分口グの 並列処理間での同期を不要とし'、 もって差分ログを高速に処理することができる という効果を奏する。 産業上の利用可能性 According to the present invention, when the difference log to be distributed is an update of the primary key, the difference log is deleted by deleting the record identified by the primary key before the update. The record in which the primary key was replaced with the updated primary key is divided into the insertion log to be imported, and the divided deletion log and the entrance log are configured to be distributed. This eliminates the need for synchronization, and thus has the effect of processing differential logs at high speed. Industrial applicability
以上のように、 本発明に係るデータベース複製プログラムおよびデータベース 複製装置は、 マスタシステムが災害などにより停止したオンライン業務を引き継 ぐクローンシステムによるデータベースの更新に適している。  As described above, the database duplication program and the database duplication device according to the present invention are suitable for updating a database by a clone system that takes over an online job whose master system has been stopped due to a disaster or the like.

Claims

請 求 の 範 囲 The scope of the claims
1 . マスタシステムでおこなわれたデータベースの更新内容を差分ログとして 受け取り、 該受け取つた差分ログをクローンシステムのデ一タベースに適用する データベース複製プログラムであって、 1. A database replication program for receiving, as a difference log, the updated contents of a database performed by a master system, and applying the received difference log to a database of a clone system.
前記差分ログの所定の情報に基づいて該差分ログを複数の並列処理対象に振り 分ける差分口グ振分手順と、  A difference log distribution procedure for distributing the difference log to a plurality of parallel processing targets based on predetermined information of the difference log;
前記差分口グ振分手順により複数の並列処理対象に振り分けられたそれぞれの 並列処理対象の差分口グを前記クローンシステムのデータベースに適用する処理 を並列におこなう差分口グ並列適用手順と、  A differential password parallel application procedure for performing in parallel a process of applying the respective differential queries of the parallel processing targets allocated to the plurality of parallel processing targets to the database of the clone system according to the differential password distribution procedure,
をコンピュータに実行させることを特徴とするデータベース複製プログラム。  A database duplication program that causes a computer to execute the following.
2 . 前記差分ログ振分手順は、 データベースのレコードを識別する主キーを前 記差分口グの所定の情報として該差分ログを振り分けることを特徴とする請求の 範囲第 1項に記載のデータベース複製プログラム。 2. The database duplication according to claim 1, wherein the differential log distribution procedure distributes the differential log using a primary key for identifying a record of a database as predetermined information of the differential log. program.
3 . 前記差分口グ振分手順は、 前記主キーにハッシュ関数を適用した結果を用 いて差分口グを振り分けることを特^ [とする請求の範囲第 2項に記載のデータべ —ス複製プログラム。 3. The database replication according to claim 2, wherein the difference group distribution step is characterized in that the difference group is sorted using a result of applying a hash function to the primary key. program.
4 . 前記差分ログ振分手順は、 振り分ける差分ログが主キーの更新である場合 に、 該差分ログを更新前の主キーで識別されるレコードを削除する削除口グと該 レコードの主キーを更新後の主キーで置き換えたレコードを揷入する挿入ログと に分割し、 該分割した削除ログと挿入ログを振り分けることを特徴とする請求の 範囲第 2項または第 3項に記載のデータベース複製プロダラム。 4. The difference log distribution procedure includes, when the difference log to be distributed is an update of a primary key, deleting a record identified by the primary key before updating the difference log and a primary key of the record. 4. The database duplication according to claim 2, wherein the record replaced by the updated primary key is divided into an insertion log to be imported, and the divided deletion log and the insertion log are sorted. Prodrum.
5 . 前記差分ログ並列適用手順は、 所定の件数の差分口グの処理結果をまとめ て前記クローンシステムのデータベースに反映することを特徴とする請求の範囲 第 4項に記載のデータベース複製プログラム。 5. The difference log parallel application procedure summarizes the processing results of a predetermined number of difference logs. 5. The database duplication program according to claim 4, wherein the program is reflected in a database of the clone system.
6 . マスタシステムでおこなわれたデータベースの更新内容を差分ログとして 受け取り、 該受け取った差分ログをクローンシステムのデータベースに適用する データベース複製装置であつて、 前記差分ログの所定の情報に基づいて該差分口グを複数の並列処理対象に振り 分ける差分口グ振分手段と、 6. A database duplication device that receives, as a difference log, updates of the database performed by the master system, and applies the received difference log to the database of the clone system. Difference tag distribution means for distributing tags to a plurality of parallel processing targets;
前記差分口グ振分手段により複数の並列処理対象に振り分けられたそれぞれの 並列処理対象の差分ログを前記クローンシステムのデータベースに適用する処理 を並列におこなう複数の差分口グ並列適用手段と、  A plurality of difference log parallel application means for performing in parallel a process of applying the difference logs of the respective parallel processing targets allocated to the plurality of parallel processing targets to the plurality of parallel processing targets by the difference log distribution means to the database of the clone system;
を備えたことを特徴とするデータベース複製装置。  A database duplication device comprising:
7 . 前記差分ログ振分手段は、 データベースのレコードを識別する主キーを前 記差分口グの所定の情報として該差分口グを振り分けることを特徴とする請求の 範囲第 6項に記載のデータベース複製装置。 7. The database according to claim 6, wherein the difference log distribution means distributes the difference key using a primary key for identifying a record of the database as predetermined information of the difference log. Duplication device.
8 . 前記差分ログ振分手段は、 前記主キーにハッシュ関数を適用した結果を用 レ、て差分ログを振り分けることを特徴とする請求の範囲第 7項に記載のデータべ ース複製装置。 8. The database duplication apparatus according to claim 7, wherein the difference log distribution unit distributes a difference log by using a result of applying a hash function to the primary key.
9 . 前記差分口グ振分手段は、 振り分ける差分ログが主キーの更新である場合 に、 該差分ログを更新前の主キーで識別されるレコードを削除する削除口グと該 レコードの主キーを更新後の主キーで置き換えたレコードを揷入する挿入ログと に分割し、 該分割した削除口グと揷入ログを振り分けることを特徴とする請求の 範囲第 7項または第 8項に記載のデータベース複製装置。 9. When the difference log to be distributed is an update of the primary key, the difference log distribution means deletes the record identified by the primary key before updating the difference log and the primary key of the record. Claims 7 or 8 characterized in that the record replaced with the updated primary key is divided into the inserted log and the inserted log, and the divided deletion log and the imported log are sorted. Database replication device.
1 0 . 前記差分口グ並列適用手段は、 所定の件数の差分口グの処理結果をまと めて前記クローンシステムのデータベースに反映することを特徴とする請求の範 囲第 9項に記載のデータベース複製装置。 10. The parallel difference log application means according to claim 9, wherein the processing results of the predetermined number of difference logs are collectively reflected in the database of the clone system. Database replication device.
PCT/JP2003/004343 2003-04-04 2003-04-04 Database copying program and database copying device WO2004090726A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2004570551A JP4268141B2 (en) 2003-04-04 2003-04-04 Database replication program and database replication apparatus
PCT/JP2003/004343 WO2004090726A1 (en) 2003-04-04 2003-04-04 Database copying program and database copying device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2003/004343 WO2004090726A1 (en) 2003-04-04 2003-04-04 Database copying program and database copying device

Publications (1)

Publication Number Publication Date
WO2004090726A1 true WO2004090726A1 (en) 2004-10-21

Family

ID=33156430

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2003/004343 WO2004090726A1 (en) 2003-04-04 2003-04-04 Database copying program and database copying device

Country Status (2)

Country Link
JP (1) JP4268141B2 (en)
WO (1) WO2004090726A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007257209A (en) * 2006-03-22 2007-10-04 Fujitsu Ltd Log data compression program and method
KR20140123009A (en) * 2013-04-11 2014-10-21 가부시키가이샤 히타치세이사쿠쇼 The method of reflecting data
US9747324B2 (en) 2013-03-26 2017-08-29 Fujitsu Limited System, apparatus, and method for transferring updates between storage devices
CN107402981A (en) * 2017-07-07 2017-11-28 国网浙江省电力公司信息通信分公司 A kind of data increment processing method and system based on distributed offline database
CN113377763A (en) * 2020-03-10 2021-09-10 阿里巴巴集团控股有限公司 Database table switching method and device, electronic equipment and computer storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63191248A (en) * 1987-02-04 1988-08-08 Hitachi Ltd Exclusive control system for table in relational data base system
JPH03122729A (en) * 1989-09-25 1991-05-24 Internatl Business Mach Corp <Ibm> Method and system for updating database
JPH06195250A (en) * 1992-10-13 1994-07-15 Internatl Business Mach Corp <Ibm> Method, system and device for renewal of database
JPH09259023A (en) * 1996-03-26 1997-10-03 Hitachi Ltd Backup method for on-line data base system
JP2000035911A (en) * 1998-07-21 2000-02-02 Mitsubishi Electric Corp Equalization method for data base

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63191248A (en) * 1987-02-04 1988-08-08 Hitachi Ltd Exclusive control system for table in relational data base system
JPH03122729A (en) * 1989-09-25 1991-05-24 Internatl Business Mach Corp <Ibm> Method and system for updating database
JPH06195250A (en) * 1992-10-13 1994-07-15 Internatl Business Mach Corp <Ibm> Method, system and device for renewal of database
JPH09259023A (en) * 1996-03-26 1997-10-03 Hitachi Ltd Backup method for on-line data base system
JP2000035911A (en) * 1998-07-21 2000-02-02 Mitsubishi Electric Corp Equalization method for data base

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007257209A (en) * 2006-03-22 2007-10-04 Fujitsu Ltd Log data compression program and method
US9747324B2 (en) 2013-03-26 2017-08-29 Fujitsu Limited System, apparatus, and method for transferring updates between storage devices
KR20140123009A (en) * 2013-04-11 2014-10-21 가부시키가이샤 히타치세이사쿠쇼 The method of reflecting data
KR101595651B1 (en) 2013-04-11 2016-02-18 가부시키가이샤 히타치세이사쿠쇼 The method of reflecting data
CN107402981A (en) * 2017-07-07 2017-11-28 国网浙江省电力公司信息通信分公司 A kind of data increment processing method and system based on distributed offline database
CN113377763A (en) * 2020-03-10 2021-09-10 阿里巴巴集团控股有限公司 Database table switching method and device, electronic equipment and computer storage medium
CN113377763B (en) * 2020-03-10 2022-10-28 阿里巴巴集团控股有限公司 Database table switching method and device, electronic equipment and computer storage medium

Also Published As

Publication number Publication date
JPWO2004090726A1 (en) 2006-07-06
JP4268141B2 (en) 2009-05-27

Similar Documents

Publication Publication Date Title
US7017144B2 (en) Combined image views and method of creating images
CN100555279C (en) Item synchro system and method without snapshot
KR100323551B1 (en) Information registration method and document information processing apparatus
US6879982B2 (en) Data management system, server, and data management method
AU2018348333A1 (en) Data isolation in a blockchain network
CN109923534A (en) To the Multi version concurrency control with the data-base recording for not submitting affairs
US20040139127A1 (en) Backup system and method of generating a checkpoint for a database
US20050192949A1 (en) Document group analyzing apparatus, a document group analyzing method, a document group analyzing system, a program, and a recording medium
KR101977178B1 (en) Method for file forgery check based on block chain and computer readable recording medium applying the same
JP2008186330A (en) Use authorization managing device, content sharing system, content sharing method and content sharing program
WO2021114627A1 (en) Distributed transaction-based data processing method, device, terminal, and storage medium
JP2002108681A (en) Replication system
CN114048370A (en) Python-based archive file processing, storage and one-stop management platform
WO2004090726A1 (en) Database copying program and database copying device
JP2008102573A (en) Document management system, apparatus and method, and document production apparatus
JP2011522337A (en) Method of synchronizing software modules of computer system distributed to server cluster, application to synchronization system and data storage
JP2000259473A (en) Database management system
CN111857883B (en) Page data checking method and device, electronic equipment and storage medium
JP2005332049A (en) Policy-conversion method, policy-shifting method, and policy-evaluating method
JP2002351702A (en) Method and device for preparing terminal operation statistical data utilizing online
KR102513228B1 (en) Electronic apparatus that can automatically convert and migrate the display format of data according to data conversion rules and the operating method thereof
KR100567813B1 (en) Transaction Analysing System for Tandem system
JPH11250092A (en) Shared database, shared databse system, method for extracting data from shared database and medium recording data extraction program from shared databse
JPH11249944A (en) Method and device for data cooperation and storage medium
CA2525019A1 (en) Method, system and computer program product for controlling objects on a computer system

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): JP US

WWE Wipo information: entry into national phase

Ref document number: 2004570551

Country of ref document: JP