[go: up one dir, main page]

JP2009252149A - Database replication method, and database management system, and program - Google Patents

Database replication method, and database management system, and program Download PDF

Info

Publication number
JP2009252149A
JP2009252149A JP2008102500A JP2008102500A JP2009252149A JP 2009252149 A JP2009252149 A JP 2009252149A JP 2008102500 A JP2008102500 A JP 2008102500A JP 2008102500 A JP2008102500 A JP 2008102500A JP 2009252149 A JP2009252149 A JP 2009252149A
Authority
JP
Japan
Prior art keywords
database
server
history information
slave
file
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.)
Granted
Application number
JP2008102500A
Other languages
Japanese (ja)
Other versions
JP5244440B2 (en
Inventor
Hirotoshi Suga
啓敏 須賀
Masaki Hisada
正樹 久田
Fumikazu Konishi
史和 小西
Seiji Tomita
清次 冨田
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.)
NTT Inc
Original Assignee
Nippon Telegraph and Telephone Corp
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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2008102500A priority Critical patent/JP5244440B2/en
Publication of JP2009252149A publication Critical patent/JP2009252149A/en
Application granted granted Critical
Publication of JP5244440B2 publication Critical patent/JP5244440B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

【課題】マスターサーバの更新トランザクションの処理性能を低下させることなくレプリケーションによるスレーブサーバのデータベースの起動を実行する。
【解決手段】スレーブサーバ3Aからデータベースレプレケーションの依頼を受けたマスターサーバ2はデータベースのスナップショットからなる新しい世代のチェックポイントファイルの取得を開始し同時に前記データベースの更新トランザクションの履歴情報を格納する更新履歴情報ファイルも新しい世代に切り替えさらに更新トランザクションの履歴情報を更新トランザクションの実行毎にそれぞれスレーブサーバ3Aの通信キューに順次転送を開始する。スレーブサーバ3Aはマスターサーバ2内の一つ古い世代の前記チェックポイントファイルと前記更新履歴情報ファイルを複製し、これらのファイルから起動したデータベースに前記通信キュー内の更新トランザクションの履歴情報を順次反映させる。
【選択図】図1
To start a slave server database by replication without degrading the processing performance of a master server update transaction.
A master server that receives a database replication request from a slave server starts acquisition of a new generation checkpoint file consisting of a snapshot of the database, and at the same time, updates the history information of the database update transaction. The history information file is also switched to the new generation, and the update transaction history information is sequentially transferred to the communication queue of the slave server 3A each time the update transaction is executed. The slave server 3A duplicates the checkpoint file and the update history information file of the previous generation in the master server 2, and sequentially reflects the history information of the update transaction in the communication queue in the database started from these files. .
[Selection] Figure 1

Description

この発明はデータベースのレプリケーション技術に関する。特に、マスターサーバ上でのデータベースの更新トランザクションの実行を停止することなくデータベースのバックアップファイルを取得することが可能なデータベースマネージメントシステムにおいて、スレーブサーバのデータベースの起動時にマスターサーバのデータベースをスレーブサーバに複製するデータベースレプリケーション技術に関する。   The present invention relates to a database replication technique. In particular, in a database management system that can acquire database backup files without stopping execution of database update transactions on the master server, the master server database is replicated to the slave server when the slave server database is started. Related to database replication technology.

データベースのレプリケーションとはマスターサーバのデータベースの複製(レプリカ)をネットワーク上の複数のスレーブサーバに配置することである。これにより、マスターサーバのデータベースにかかる負荷を複数のスレーブサーバの複製(レプリカ)データベースに分散させることが可能になり、またマスターサーバで障害が発生した場合には複製(レプリカ)データベースを持つスレーブサーバをマスターサーバに変更して運用を継続することが可能になる。   Database replication is to place a replica (replica) of a master server database on a plurality of slave servers on the network. This makes it possible to distribute the load on the master server database to the replica (replica) databases of multiple slave servers, and if the master server fails, the slave server has the replica (replica) database. It becomes possible to change to the master server and continue operation.

ところで、データベースを更新するトランザクションの実行を停止することなく、データベースのバックアップファイルを取得する方法として、ファジーチェックポイント法がある(非特許文献1等参照)。   By the way, there is a fuzzy checkpoint method as a method for acquiring a backup file of a database without stopping execution of a transaction for updating the database (see Non-Patent Document 1).

更新トランザクションを停止せずにデータベースのバックアップファイルであるチェックポイントファイル(データベースのスナップショット)を取得すると、更新トランザクションを実行中にチェックポイントファイルを取得することになる。このため、図4に例示されたようにデータベースが更新トランザクション処理途中の不整合な状態(更新トランジクションの原子性が保たれていない状態)でチェックポイントファイルを取得する可能性がある。   If a checkpoint file (database snapshot) that is a database backup file is acquired without stopping the update transaction, the checkpoint file is acquired during the execution of the update transaction. Therefore, as illustrated in FIG. 4, there is a possibility that the database acquires the checkpoint file in an inconsistent state during the update transaction processing (a state in which the atomicity of the update transaction is not maintained).

ファジーチェックポイント法では、例えは図5に示されたマスターサーバ5の場合、チェックポイントファイル取得中に発生した更新トランザクションの履歴情報をバックアップ蓄積部内の更新履歴情報ファイルに格納する。そして、データベース起動時に前記更新履歴情報ファイルに格納された更新トランザクションの履歴情報に基づきデータベースを修正して起動することでデータベースの整合性が保証される。   In the fuzzy checkpoint method, for example, in the case of the master server 5 shown in FIG. 5, the history information of the update transaction that occurred during the acquisition of the checkpoint file is stored in the update history information file in the backup storage unit. The database consistency is guaranteed by correcting and starting the database based on the history information of the update transaction stored in the update history information file when the database is started.

また、特許文献1のデータベースバックアップ方法は、ファジーチェックポイント方法で出力される更新トランザクションの履歴情報の量を削減し、かつチェックポイントファイル、更新履歴情報ファイルのための記憶領域を2世代分確保することでシステム障害や媒体障害が発生してもバックアップデータを取得することができる。
D.J.Rosenkranz,“Dynamic database dumping”,in Proc.SIGMOD Int.Conf.Managent Data.ACM,1978,pp.3−8 特許第3514332号公報
In addition, the database backup method of Patent Document 1 reduces the amount of update transaction history information output by the fuzzy checkpoint method, and secures storage areas for two generations of checkpoint files and update history information files. Thus, backup data can be acquired even if a system failure or a media failure occurs.
D. J. et al. Rosenkranz, “Dynamic database dumping”, in Proc. SIGMOD Int. Conf. Managent Data. ACM, 1978, pp. 3-8 Japanese Patent No. 3514332

スレーブサーバ6のデータベースをデータの整合性が保障された状態でレプリケーションにより起動するためには、ファジーチェックポイント法によってマスターサーバ5で取得したチェックポイントファイルと更新履歴情報ファイルをスレーブサーバ6に複製し、このチェックポイントファイルと更新履歴情報ファイルとからデータベースを起動することで可能となる。   In order to start the database of the slave server 6 by replication in a state where data consistency is ensured, the checkpoint file and the update history information file obtained by the master server 5 are replicated to the slave server 6 by the fuzzy checkpoint method. This is possible by starting the database from the checkpoint file and the update history information file.

しかし、マスターサーバ5は運用中であるので更新トランザクションが常に発生し、更新トランザクションの履歴情報が次々と生成され、更新トランザクションの履歴情報を格納する更新履歴情報ファイルは頻繁に更新される状況になる。この状況で前記方法によってスレーブサーバ6のデータベース起動のためのレプリケーションを実施すると、スレーブサーバ6がマスターサーバ5の更新履歴情報ファイルを複製のために参照するので、図5に示したようにファイルの更新と参照の競合が発生してしまう。   However, since the master server 5 is in operation, update transactions always occur, update transaction history information is generated one after another, and an update history information file that stores update transaction history information is frequently updated. . In this situation, when the replication for starting the database of the slave server 6 is performed by the above method, the slave server 6 refers to the update history information file of the master server 5 for replication. Therefore, as shown in FIG. Update and reference conflicts will occur.

この競合により、マスターサーバ5上で更新トランザクションの履歴情報を更新履歴情報ファイルに書込む処理に遅延が生じる。これがマスターサーバ5の更新トランザクション処理の遅延につながり、マスターサーバ5の更新処理性能が低下する問題となる。   Due to this conflict, a delay occurs in the process of writing the update transaction history information in the update history information file on the master server 5. This leads to a delay in the update transaction processing of the master server 5 and causes a problem that the update processing performance of the master server 5 deteriorates.

そこで、前記課題を解決するためのデータベースレプリケーション方法及びデータベース管理システムは、マスターサーバは、スレーブサーバからのデータベースレプレケーション依頼を契機に、運用中の世代よりも一つ古い世代のチェックポイントファイルと更新履歴ファイルとを用意し、これらのファイルを参照用にスレーブサーバが複製する。これによりマスターサーバとスレーブサーバとの間での同一データベースファイルの更新と参照の競合が起こらない。   Therefore, in the database replication method and the database management system for solving the above-described problem, the master server updates the checkpoint file with a generation one older than the generation in operation, triggered by a database replication request from the slave server. A history file is prepared and the slave server replicates these files for reference. As a result, there is no conflict between the update and reference of the same database file between the master server and the slave server.

すなわち、前記課題を解決するためのデータベースレプリケーション方法は、スレーブサーバからデータベースレプレケーションの依頼を受けたマスターサーバは、この依頼を契機としてデータベースのスナップショットからなる新しい世代のチェックポイントファイルの取得を開始し、このチェックポイントファイル取得開始と同時に前記データベースの更新トランザクションの履歴情報を格納する更新履歴情報ファイルも新しい世代に切り替え、さらに前記チェックポイントファイル取得開始と同時に更新トランザクションの履歴情報を、更新トランザクションが実行される毎にそれぞれ前記スレーブサーバの通信キューへ順次転送する処理も開始し、前記チェックポイントファイル取得開始した後に前記スレーブサーバへ複製開始許可を通知し、前記スレーブサーバは、前記複製開始許可の通知の受信を契機として、前記マスターサーバに格納されている一つ古い世代の前記チェックポイントファイル及び前記更新履歴情報ファイルを複製し、この2つのファイルから前記スレーブサーバ上にて新たにデータベースを起動すると共に、前記スレーブサーバの通信キューに蓄積された更新トランザクションの履歴情報を前記スレーブサーバ上にて起動された前記データベースに前記通信キューへの到着順に順次反映する。   That is, in the database replication method for solving the above-described problem, the master server that has received a request for database replication from the slave server starts acquiring a new generation checkpoint file consisting of a snapshot of the database. At the same time when the checkpoint file acquisition starts, the update history information file that stores the history information of the update transaction of the database is also switched to a new generation. Further, the update transaction history information is updated when the checkpoint file acquisition starts. Each time it is executed, it also starts processing to sequentially transfer to the communication queue of the slave server, and after starting the acquisition of the checkpoint file, permission to start replication to the slave server And the slave server replicates the checkpoint file and the update history information file of the previous generation stored in the master server upon receipt of the notification of permission to start replication. A new database is started on the slave server from the file, and update transaction history information stored in the communication queue of the slave server arrives at the communication queue at the database started on the slave server. Reflect sequentially.

また、前記課題を解決するためのデータベース管理システムは、複数のスレーブサーバと通信可能なマスターサーバを備え、前記マスターサーバは、前記いずれかのスレーブサーバからデータベースレプレケーションの依頼を受けると、この依頼を契機としてデータベースのスナップショットからなる新しい世代のチェックポイントファイルの取得を開始し、このチェックポイントファイル取得開始と同時に前記データベースの更新トランザクションの履歴情報を格納する更新履歴情報ファイルも新しい世代に切り替え、さらに前記チェックポイントファイル取得開始と同時に更新トランザクションの履歴情報を、更新トランザクションが実行される毎にそれぞれ前記スレーブサーバの通信キューへ順次転送する処理も開始し、前記チェックポイントファイル取得開始した後に前記スレーブサーバへ複製開始許可を通知し、前記スレーブサーバは、前記複製開始許可の通知の受信を契機として、前記マスターサーバに格納されている一つ古い世代の前記チェックポイントファイル及び前記更新履歴情報ファイルを複製し、この2つのファイルから前記スレーブサーバ上にて新たにデータベースを起動すると共に、前記スレーブサーバの通信キューに蓄積された更新トランザクションの履歴情報を前記スレーブサーバ上にて起動された前記データベースに前記通信キューへの到着順に順次反映する。   In addition, a database management system for solving the problem includes a master server that can communicate with a plurality of slave servers, and the master server receives a request for database replication from any of the slave servers. Triggered the acquisition of a new generation checkpoint file consisting of a snapshot of the database, and at the same time this checkpoint file acquisition start, the update history information file that stores the history information of the database update transaction is also switched to the new generation, Furthermore, simultaneously with the start of the acquisition of the checkpoint file, a process of sequentially transferring update transaction history information to the communication queue of the slave server each time an update transaction is executed is started. After starting the acquisition of the int file, the slave server is notified of the replication start permission, and the slave server is triggered by the reception of the notification of the replication start permission, and the checkpoint of the one old generation stored in the master server The file and the update history information file are duplicated, a database is newly started on the slave server from these two files, and update transaction history information accumulated in the communication queue of the slave server is also stored on the slave server. Are sequentially reflected in the order of arrival in the communication queue in the database activated in step (b).

以上のデータベースレプリケーション方法及びデータベース管理システムによれば前記競合が防止されると共に前記マスターサーバと前記スレーブサーバのデータベースの同期性が保障される。   According to the above database replication method and database management system, the contention is prevented and the synchronization of the databases of the master server and the slave server is ensured.

前記データベースレプリケーション方法において、前記マスターサーバに格納されている一つ古い世代の前記チェックポイントファイル及び前記更新履歴情報ファイルを他のスレーブサーバが複製中である場合、または前記新しい世代のチェックポイントファイルを前記マスターサーバが取得中である場合、前記マスターサーバは、前記データベースレプリケーションの依頼通知を受けても、最も新しい世代のチェックポイントファイルの取得を開始せずに、前記複製及び取得の完了を待ち合わせるようにするとよい。   In the database replication method, when another slave server is replicating the checkpoint file and the update history information file of the one old generation stored in the master server, or the checkpoint file of the new generation When the master server is acquiring, the master server waits for the completion of the replication and acquisition without starting acquisition of the newest generation checkpoint file even if it receives the database replication request notification. It is good to.

また、前記データベース管理システムにおいては、前記いずれかのスレーブサーバ以外のスレーブサーバが前記マスターサーバに格納されている一つ古い世代の前記チェックポイントファイル及び前記更新履歴情報ファイルを複製中である場合、または前記マスターサーバが前記新しい世代のチェックポイントファイルを取得中である場合、前記マスターサーバは、前記いずれかのスレーブサーバから前記データベースレプリケーションの依頼通知を受けても、最も新しい世代のチェックポイントファイルの取得を開始せずに、前記複製及び取得の完了を待ち合わせるようにするとよい。   Further, in the database management system, when a slave server other than any one of the slave servers is replicating the checkpoint file and the update history information file of an old generation stored in the master server, Alternatively, when the master server is acquiring the new generation checkpoint file, the master server receives the database replication request notification from any of the slave servers, and the master server checks the latest generation checkpoint file. It is preferable to wait for the completion of the duplication and acquisition without starting the acquisition.

スレーブサーバが複数であっても、前記競合が起こらない。   The conflict does not occur even if there are a plurality of slave servers.

以上述べたデータベース管理システムの機能はコンピュータとプログラムとによっても実現でき、前記プログラムを記録媒体に記録して提供またはネットワークを介して提供できる。前記プログラムとしてはコンピュータに前記マスターサーバ及びスレーブサーバの機能を実現させるためのプログラムが挙げられる。   The functions of the database management system described above can also be realized by a computer and a program, which can be provided by recording the program on a recording medium or via a network. Examples of the program include a program for causing a computer to realize the functions of the master server and the slave server.

したがって、以上の発明によればマスターサーバの更新トランザクションの処理性能を低下させることなくレプリケーションによるスレーブサーバのデータベースの起動が実行可能となる。   Therefore, according to the above invention, it is possible to start the database of the slave server by replication without degrading the processing performance of the update transaction of the master server.

図1は発明の実施形態に係るデータベース管理システム1の概略構成図である。   FIG. 1 is a schematic configuration diagram of a database management system 1 according to an embodiment of the invention.

データベース管理システム1は1つのマスターサーバ2と複数のスレーブサーバ3がネットワーク4を介して接続されて構成されている。マスターサーバ2はデータベース管理部21とバックアップ蓄積部22を有する。スレーブサーバ3Aはデータベース管理部31Aとバックアップ蓄積部32Aを有する。スレーブサーバ3Bはデータベース管理部31Bとバックアップ蓄積部32Bを有する。尚、発明に係るデータ管理システムのマスターデータに対するスレーブサーバの接続数は図1に開示されたスレーブサーバの個数に限定されない。   The database management system 1 is configured by connecting one master server 2 and a plurality of slave servers 3 via a network 4. The master server 2 has a database management unit 21 and a backup storage unit 22. The slave server 3A has a database management unit 31A and a backup storage unit 32A. The slave server 3B has a database management unit 31B and a backup storage unit 32B. The number of slave servers connected to the master data of the data management system according to the invention is not limited to the number of slave servers disclosed in FIG.

データベース管理部21,31A,31Bはデータベースの実体を管理すると共にバックアップ蓄積部22,32A,32Bへデータベースのバックアップファイルの出力処理を行う。尚、データベースのバックアップファイルは、データベースの実体のスナップショットであるチェックポイントファイルと、そのチェックポイントファイル取得開始以降の更新トランザクションの履歴情報がデータベース上での更新トランザクション実行の毎に書込まれる更新履歴情報ファイルからなる。   The database management units 21, 31A, 31B manage the database entity and output the database backup file to the backup storage units 22, 32A, 32B. Note that the database backup file is a checkpoint file that is a snapshot of the actual database, and an update history in which history information of update transactions since the start of the acquisition of the checkpoint file is written each time an update transaction is executed on the database. Consists of information files.

バックアップ蓄積部22,32A,32Bはデータベース管理部21,31A,31から出力されるデータベースのバックアップファイル(チェックポイントファイル、更新履歴情報ファイル)を最近の2世代(2セット)分を記憶領域に保持する(例えば非特許文献1等参照)。データベース管理部21,31A,31Bからチェックポイントファイルが出力される際(バックアップの世代切り替えの際)には、2世代のうちの古い世代のチェックポイントファイルに上書する。また、この際に更新履歴情報ファイルも古い世代に切り替わり更新トランザクションの履歴情報をファイルの先頭から上書していく。さらに、スレーブサーバ3A,3Bのデータベース起動時には、マスターサーバ2のバックアップ蓄積部22に蓄積されたデータベースのバックアップファイルはネットワーク4経由でスレーブサーバ3A,3Bのバックアップ蓄積部32A,32Bに複製される。スレーブサーバ3A,3Bは前記複製されたデータベースのバックアップファイルに基づきデータベース管理部31A,31Bのデータベースを起動する。   The backup storage units 22, 32A, 32B hold the database backup files (checkpoint files, update history information files) output from the database management units 21, 31A, 31 in the storage area for the two most recent generations (2 sets). (For example, refer nonpatent literature 1 etc.). When the checkpoint file is output from the database management unit 21, 31A, 31B (when the backup generation is switched), the checkpoint file of the older generation of the two generations is overwritten. At this time, the update history information file is also switched to the old generation, and the update transaction history information is overwritten from the top of the file. Further, when the database of the slave servers 3A and 3B is activated, the database backup file stored in the backup storage unit 22 of the master server 2 is replicated to the backup storage units 32A and 32B of the slave servers 3A and 3B via the network 4. The slave servers 3A and 3B activate the databases of the database managers 31A and 31B based on the copied database backup file.

図2を参照しながらデータベース管理システム1の動作例について説明する。   An operation example of the database management system 1 will be described with reference to FIG.

以下の事例ではマスターサーバ2とスレーブサーバ3Aが1:1の場合の処理の流れとなっているが、ステップS2のマスターサーバ2の待ち合わせ処理により、スレーブサーバ3が2個以上の場合(スレーブサーバ3A、3B…)でもレプリケーション可能である。   In the following example, the process flow is when the master server 2 and the slave server 3A are 1: 1. However, when there are two or more slave servers 3 (slave server 3) due to the waiting process of the master server 2 in step S2. 3A, 3B... Can also be replicated.

ステップS1では、データベースが未起動状態であるスレーブサーバ3Aがマスターサーバ2に対してデータベースレプリケーション開始依頼通知をする。   In step S <b> 1, the slave server 3 </ b> A whose database is not activated issues a database replication start request notification to the master server 2.

ステップS2では、マスターサーバ2がデータレプリケーション開始依頼通知を受け取ったときに、例えば、マスターサーバ2が第n世代のチェックポイントファイルを取得中であった場合、スレーブサーバ3Bが第n−1世代のチェックポイントファイル及び更新履歴情報ファイルを複製中であった場合、または両方の処理がそれぞれ完了するまで待ち合わせる。このとき、データレプリケーション開始依頼通知を受け取ったときの、マスターサーバ2のデータベースバックアップファイルの最新世代は第n世代であることとする。   In step S2, when the master server 2 receives the data replication start request notification, for example, if the master server 2 is acquiring the nth generation checkpoint file, the slave server 3B is the n-1th generation. If the checkpoint file and the update history information file are being copied, or wait until both processes are completed. At this time, it is assumed that the latest generation of the database backup file of the master server 2 when the data replication start request notification is received is the nth generation.

ステップS3では、マスターサーバ2上で第n+1世代のデータベースバックアップファイルの取得を開始する。   In step S3, acquisition of the (n + 1) th generation database backup file is started on the master server 2.

ステップS4では、このマスターサーバ2が第n+1世代のデータベースバックアップファイルの取得を開始すると同時に、更新トランザクションの履歴情報の格納先(バックアップ蓄積部32A)も第n世代から第n+1世代の更新履歴情報ファイルに変更する。   In step S4, the master server 2 starts acquiring the (n + 1) th generation database backup file, and at the same time the update transaction history information storage destination (backup storage unit 32A) is also updated from the nth generation to the (n + 1) th generation update history information file. Change to

ステップS5では、さらにこのマスターサーバ2が第n+1世代のデータベースバックアップファイルの取得を開始すると同時に、更新トランザクションの履歴情報をスレーブサーバ3Aの通信キューへ転送する処理を開始する。これ以降に実行された更新トランザクションの履歴情報は、順次、スレーブサーバ3Aの通信キューへ転送される。   In step S5, the master server 2 starts acquiring the (n + 1) th generation database backup file, and at the same time, starts a process of transferring the history information of the update transaction to the communication queue of the slave server 3A. The history information of update transactions executed thereafter is sequentially transferred to the communication queue of the slave server 3A.

ステップS6では、マスターサーバ2が、第n世代のチェックポイントファイル及び更新履歴情報ファイルの複製開始の許可をスレーブサーバ3Aへ通知する。   In step S6, the master server 2 notifies the slave server 3A of permission to start copying the nth generation checkpoint file and the update history information file.

ステップS7では、スレーブサーバ3Aがマスターサーバ2から受け取った第n世代チェックポイントファイル及び第n世代更新履歴情報ファイルをスレーブサーバ3Aに複製をする。   In step S7, the slave server 3A copies the nth generation checkpoint file and the nth generation update history information file received from the master server 2 to the slave server 3A.

ステップS8では、スレーブサーバ3Aは前記複製の完了後に、マスターサーバ2に対して複製完了を通知する。   In step S8, the slave server 3A notifies the master server 2 of the completion of replication after the completion of the replication.

ステップS9では、スレーブサーバ3Aが、この複製された第n世代チェックポイントファイル及び第n世代更新履歴情報ファイルを用いて、データベースを起動する。このとき、第n世代チェックポイントファイルの内容に、第n世代更新履歴情報ファイルに格納された更新トランザクションの履歴情報が反映されて、整合性の取れた状態でデータベースが起動される。   In step S9, the slave server 3A activates the database using the copied nth generation checkpoint file and nth generation update history information file. At this time, the history information of the update transaction stored in the nth generation update history information file is reflected in the contents of the nth generation checkpoint file, and the database is started in a consistent state.

ステップS10では、前記データベースの起動完了後に、スレーブサーバ3Aの通信キューに蓄積された更新トランザクションの履歴情報を、到着順にスレーブサーバ3Aのデータベースに反映する。   In step S10, after the activation of the database is completed, the history information of the update transaction accumulated in the communication queue of the slave server 3A is reflected in the database of the slave server 3A in the order of arrival.

ステップS11では、スレーブサーバ3Aの通信キューが空の状態になったとき、マスターサーバ2とスレーブサーバ3Aのデータベースの同期が完了する。マスターサーバ2から更新トランザクションの履歴情報をスレーブサーバ3Aの通信キューに転送する処理を継続し、スレーブサーバ3Aの通信キューに蓄積された更新トランザクションの履歴情報をスレーブサーバ3Aのデータベースに反映することを継続することで、今後もマスターサーバ2とスレーブサーバ3Aのデータベースの同期状態が維持される。   In step S11, when the communication queue of the slave server 3A becomes empty, the synchronization of the databases of the master server 2 and the slave server 3A is completed. The process of transferring the update transaction history information from the master server 2 to the communication queue of the slave server 3A is continued, and the update transaction history information accumulated in the communication queue of the slave server 3A is reflected in the database of the slave server 3A. By continuing, the synchronization state of the databases of the master server 2 and the slave server 3A will be maintained in the future.

以上のようにスレーブサーバ3Aからの依頼を契機にマスターサーバ2は現在使用中(運用中)の最新世代の第n+1世代より一つ古い世代の第n世代チェックポイントファイルと第n世代更新履歴情報ファイルを用意し、これらのファイルをスレーブサーバ3Aが複製する。したがって、図3に示したようにマスターサーバ2とスレーブサーバ3A間で同一ファイルの更新と参照とが競合しないのでマスターサーバ2の更新トランザクションの処理性能が劣化しない。   As described above, in response to a request from the slave server 3A, the master server 2 is the nth generation checkpoint file and the nth generation update history information that is one generation older than the (n + 1) th generation of the latest generation currently in use (in operation). Files are prepared, and the slave server 3A duplicates these files. Therefore, as shown in FIG. 3, since the update and reference of the same file do not compete between the master server 2 and the slave server 3A, the processing performance of the update transaction of the master server 2 does not deteriorate.

また、マスターサーバ2での第n+1世代のチェックポイントファイルの取得開始を契機に、更新トランザクションの履歴情報をスレーブサーバ3Aの通信キューへの転送を開始し、スレーブサーバ3Aで反映させている。これにより、マスターサーバ2のデータベースとスレーブサーバ3Aのデータベースを同期させることができる。   Also, when the master server 2 starts acquiring the (n + 1) th generation checkpoint file, the history information of the update transaction is transferred to the communication queue of the slave server 3A and reflected on the slave server 3A. Thereby, the database of the master server 2 and the database of the slave server 3A can be synchronized.

さらに、スレーブサーバ3Bがマスターサーバ2から受けた第n世代チェックポイントファイル及び第n世代更新履歴情報ファイルを複製中である場合またはマスターサーバ2が第n+1世代のチェックポイントファイルを取得中である場合、マスターサーバ2は、スレーブサーバ3Aからデータベースレプリケーション開始依頼通知を受けても、第n+2世代のチェックポイントファイルの取得を開始せずに、前記複製及び取得の完了を待ち合わせる。これにより、スレーブサーバ3が複数(2以上)の場合でも、同一ファイルの更新と参照の競合を起こすことなくデータベースのレプリケーションが可能となる。   Further, when the slave server 3B is replicating the nth generation checkpoint file and the nth generation update history information file received from the master server 2, or when the master server 2 is acquiring the (n + 1) th generation checkpoint file. Even if the master server 2 receives the database replication start request notification from the slave server 3A, the master server 2 does not start acquiring the n + 2 generation checkpoint file and waits for the completion of the replication and acquisition. As a result, even when there are a plurality of slave servers 3 (two or more), it is possible to replicate the database without causing conflict between the update of the same file and the reference.

以上説明したマスターサーバ2とスレーブサーバ3の機能はコンピュータとプログラムによっても実現できる。前記プログラムは既知の記録媒体に格納してまたはネットワークを通じて提供することもできる。   The functions of the master server 2 and the slave server 3 described above can also be realized by a computer and a program. The program can be stored in a known recording medium or provided through a network.

発明の実施形態に係るデータベース管理システムの概略構成図。1 is a schematic configuration diagram of a database management system according to an embodiment of the invention. 発明の実施形態に係るデータベース管理システムの動作例を説明したフローチャート。The flowchart explaining the operation example of the database management system which concerns on embodiment of invention. 発明の実施形態に係るデータベース管理システムの作用例の説明図。Explanatory drawing of the operation example of the database management system which concerns on embodiment of invention. ファジーチェックポイント法を用いていないデータベース管理システムの動作例の概略説明図。The schematic explanatory drawing of the operation example of the database management system which does not use the fuzzy checkpoint method. 従来技術に係るデータベース管理システムの動作例の概略説明図。Schematic explanatory drawing of the operation example of the database management system which concerns on a prior art.

符号の説明Explanation of symbols

1…データベース管理システム
2…マスターサーバ
3,3A,3B…スレーブサーバ
4…ネットワーク
21,31A,31B…データベース管理部
22,32A,32B…バックアップ蓄積部
DESCRIPTION OF SYMBOLS 1 ... Database management system 2 ... Master server 3, 3A, 3B ... Slave server 4 ... Network 21, 31A, 31B ... Database management part 22, 32A, 32B ... Backup storage part

Claims (5)

スレーブサーバからデータベースレプレケーションの依頼を受けたマスターサーバは、この依頼を契機としてデータベースのスナップショットからなる新しい世代のチェックポイントファイルの取得を開始し、このチェックポイントファイル取得開始と同時に前記データベースの更新トランザクションの履歴情報を格納する更新履歴情報ファイルも新しい世代に切り替え、さらに前記チェックポイントファイル取得開始と同時に更新トランザクションの履歴情報を、更新トランザクションが実行される毎にそれぞれ前記スレーブサーバの通信キューへ順次転送する処理も開始し、前記チェックポイントファイル取得開始した後に前記スレーブサーバへ複製開始許可を通知し、
前記スレーブサーバは、前記複製開始許可の通知の受信を契機として、前記マスターサーバに格納されている一つ古い世代の前記チェックポイントファイル及び前記更新履歴情報ファイルを複製し、この2つのファイルから前記スレーブサーバ上にて新たにデータベースを起動すると共に、前記スレーブサーバの通信キューに蓄積された更新トランザクションの履歴情報を前記スレーブサーバ上にて起動された前記データベースに前記通信キューへの到着順に順次反映すること
を特徴とするデータベースレプリケーション方法。
The master server that receives the database replication request from the slave server starts acquisition of a new generation checkpoint file consisting of a snapshot of the database, and updates the database simultaneously with the start of acquisition of the checkpoint file. The update history information file for storing the transaction history information is also switched to a new generation, and the update transaction history information is sequentially transferred to the communication queue of the slave server each time an update transaction is executed at the same time the acquisition of the checkpoint file is started. The process to transfer is also started, and after the start of the checkpoint file acquisition, the slave server is notified of the replication start permission,
The slave server, upon receipt of the notification of permission to start replication, replicates the checkpoint file and the update history information file of the previous generation stored in the master server, and from the two files, A new database is started on the slave server, and update transaction history information accumulated in the communication queue of the slave server is sequentially reflected on the database started on the slave server in the order of arrival in the communication queue. A database replication method characterized by:
前記マスターサーバに格納されている一つ古い世代の前記チェックポイントファイル及び前記更新履歴情報ファイルを他のスレーブサーバが複製中である場合、または前記新しい世代のチェックポイントファイルを前記マスターサーバが取得中である場合、
前記マスターサーバは、前記データベースレプリケーションの依頼通知を受けても、最も新しい世代のチェックポイントファイルの取得を開始せずに、前記複製及び取得の完了を待ち合わせること
を特徴とする請求項1に記載のデータベースレプリケーション方法。
When the other slave server is replicating the checkpoint file and the update history information file of the previous generation stored in the master server, or the master server is acquiring the checkpoint file of the new generation If it is,
2. The master server according to claim 1, wherein the master server waits for the completion of replication and acquisition without starting acquisition of a checkpoint file of the newest generation even when receiving a request notification of the database replication. Database replication method.
複数のスレーブサーバと通信可能なマスターサーバを備え、
前記マスターサーバは、前記いずれかのスレーブサーバからデータベースレプレケーションの依頼を受けると、この依頼を契機としてデータベースのスナップショットからなる新しい世代のチェックポイントファイルの取得を開始し、このチェックポイントファイル取得開始と同時に前記データベースの更新トランザクションの履歴情報を格納する更新履歴情報ファイルも新しい世代に切り替え、さらに前記チェックポイントファイル取得開始と同時に更新トランザクションの履歴情報を、更新トランザクションが実行される毎にそれぞれ前記スレーブサーバの通信キューへ転送する処理も開始し、前記チェックポイントファイル取得開始した後に前記スレーブサーバへ複製開始許可を通知し、
前記スレーブサーバは、前記複製開始許可の通知の受信を契機として、前記マスターサーバに格納されている一つ古い世代の前記チェックポイントファイル及び前記更新履歴情報ファイルを複製し、この2つのファイルから前記スレーブサーバ上にて新たにデータベースを起動すると共に、前記スレーブサーバの通信キューに蓄積された更新トランザクションの履歴情報を前記スレーブサーバ上にて起動された前記データベースに前記通信キューへの到着順に順次反映すること
を特徴とするデータベース管理システム。
A master server that can communicate with multiple slave servers
When the master server receives a request for database replication from any of the slave servers, the master server starts acquiring a new generation checkpoint file consisting of a snapshot of the database in response to the request, and starts acquiring this checkpoint file. At the same time, the update history information file for storing the history information of the update transaction of the database is also switched to a new generation, and the update transaction history information is updated each time an update transaction is executed at the same time as the checkpoint file acquisition starts. Start the process of transferring to the server communication queue, notify the slave server to start replication after starting the checkpoint file acquisition,
The slave server, upon receipt of the notification of permission to start replication, replicates the checkpoint file and the update history information file of the previous generation stored in the master server, and from the two files, A new database is started on the slave server, and update transaction history information accumulated in the communication queue of the slave server is sequentially reflected on the database started on the slave server in the order of arrival in the communication queue. A database management system characterized by
前記いずれかのスレーブサーバ以外のスレーブサーバが前記マスターサーバに格納されている一つ古い世代の前記チェックポイントファイル及び前記更新履歴情報ファイルを複製中である場合、または前記マスターサーバが前記新しい世代のチェックポイントファイルを取得中である場合、
前記マスターサーバは、前記いずれかのスレーブサーバから前記データベースレプリケーションの依頼通知を受けても、最も新しい世代のチェックポイントファイルの取得を開始せずに、前記複製及び取得の完了を待ち合わせること
を特徴とする請求項3に記載のデータベース管理システム。
When a slave server other than any one of the slave servers is replicating the checkpoint file and the update history information file of the previous generation stored in the master server, or the master server is of the new generation If you are getting a checkpoint file,
The master server waits for the completion of the replication and acquisition without starting acquisition of the newest generation checkpoint file even if the master server receives the database replication request notification from any of the slave servers. The database management system according to claim 3.
コンピュータに請求項3または4に記載のマスターサーバ及びスレーブサーバの機能を実現させるためのプログラム。   A program for causing a computer to realize the functions of the master server and the slave server according to claim 3 or 4.
JP2008102500A 2008-04-10 2008-04-10 Database replication method, database management system and program Active JP5244440B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008102500A JP5244440B2 (en) 2008-04-10 2008-04-10 Database replication method, database management system and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008102500A JP5244440B2 (en) 2008-04-10 2008-04-10 Database replication method, database management system and program

Publications (2)

Publication Number Publication Date
JP2009252149A true JP2009252149A (en) 2009-10-29
JP5244440B2 JP5244440B2 (en) 2013-07-24

Family

ID=41312757

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008102500A Active JP5244440B2 (en) 2008-04-10 2008-04-10 Database replication method, database management system and program

Country Status (1)

Country Link
JP (1) JP5244440B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103927236A (en) * 2013-01-11 2014-07-16 深圳市腾讯计算机系统有限公司 Online verification method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002318717A (en) * 2001-04-19 2002-10-31 Ricoh Co Ltd Database system
JP2004514963A (en) * 2000-09-08 2004-05-20 ストレイジ・テクノロジー・コーポレイション Self-archiving log structure volume with built-in data protection
JP2005258789A (en) * 2004-03-11 2005-09-22 Toshiba Solutions Corp Storage apparatus, storage controller, and write-back cache control method
JP2005332067A (en) * 2004-05-18 2005-12-02 Hitachi Ltd Backup acquisition method and disk array device
JP2006338145A (en) * 2005-05-31 2006-12-14 Nippon Telegr & Teleph Corp <Ntt> Multiplexed database system, synchronization method thereof, mediation apparatus, and mediation program
JP2007102692A (en) * 2005-10-07 2007-04-19 Hitachi Ltd Storage control system and method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004514963A (en) * 2000-09-08 2004-05-20 ストレイジ・テクノロジー・コーポレイション Self-archiving log structure volume with built-in data protection
JP2002318717A (en) * 2001-04-19 2002-10-31 Ricoh Co Ltd Database system
JP2005258789A (en) * 2004-03-11 2005-09-22 Toshiba Solutions Corp Storage apparatus, storage controller, and write-back cache control method
JP2005332067A (en) * 2004-05-18 2005-12-02 Hitachi Ltd Backup acquisition method and disk array device
JP2006338145A (en) * 2005-05-31 2006-12-14 Nippon Telegr & Teleph Corp <Ntt> Multiplexed database system, synchronization method thereof, mediation apparatus, and mediation program
JP2007102692A (en) * 2005-10-07 2007-04-19 Hitachi Ltd Storage control system and method

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
CSND200100042009; '目指せエキスパート!!グラス片手にSQL Server7.0 第15回' 月刊DBマガジン 第129号, 20001201, pp.153-161, 株式会社翔泳社 *
CSND200201061016; 'ITプロのための解説' 日経コンピュータ 第548号, 20020520, pp.158-164, 日経BP社 *
JPN6012038576; 'ITプロのための解説' 日経コンピュータ 第548号, 20020520, pp.158-164, 日経BP社 *
JPN6012038578; '目指せエキスパート!!グラス片手にSQL Server7.0 第15回' 月刊DBマガジン 第129号, 20001201, pp.153-161, 株式会社翔泳社 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103927236A (en) * 2013-01-11 2014-07-16 深圳市腾讯计算机系统有限公司 Online verification method and device
CN103927236B (en) * 2013-01-11 2018-01-16 深圳市腾讯计算机系统有限公司 On-line testing method and apparatus
US10176213B2 (en) 2013-01-11 2019-01-08 Tencent Technology (Shenzhen) Company Limited Method and device for verifying consistency of data of master device and slave device

Also Published As

Publication number Publication date
JP5244440B2 (en) 2013-07-24

Similar Documents

Publication Publication Date Title
JP5559821B2 (en) Method for storing data, method for mirroring data, machine-readable medium carrying an instruction sequence, and program for causing a computer to execute the method
JP4477950B2 (en) Remote copy system and storage device system
CN105574187B (en) A method and system for ensuring consistency of replicated transactions in heterogeneous databases
CN113239013B (en) Distributed systems and storage media
US9515878B2 (en) Method, medium, and system for configuring a new node in a distributed memory network
US20150347250A1 (en) Database management system for providing partial re-synchronization and partial re-synchronization method of using the same
JP4575762B2 (en) Data processing method and apparatus, storage apparatus and processing program therefor
JP4715774B2 (en) Replication method, replication system, storage device, program
CN110807062B (en) Data synchronization method and device and database host
EP4276651A1 (en) Log execution method and apparatus, and computer device and storage medium
KR100956637B1 (en) Asynchronous Data Replication in Distributed File System and Its Distributed File System
TW201640346A (en) Method and device for data backup
US8725686B2 (en) Method and program for creating determinate backup data in a database backup system
CN115658245A (en) Transaction submitting system, method and device based on distributed database system
JP4136615B2 (en) Database system and database access method
JP5374900B2 (en) Computer system backup method
JP4277873B2 (en) Transaction processing apparatus and transaction processing method
JP2007293821A (en) Database system management method and database system
CN115687519A (en) Distributed database system and member change synchronization method and device thereof
JP5244440B2 (en) Database replication method, database management system and program
JP5170169B2 (en) Remote copy processing system, processing method, and processing program between disk array devices
JP2000284998A (en) Data update control system, data update control method, and computer-readable recording medium storing a program for executing the method
CN114968656B (en) Data rollback method, device, equipment and medium
JP2004094710A (en) Data duplication method and system for storage subsystem
KR20130043823A (en) Distributed storage system for maintaining data consistency based on log, and method for the same

Legal Events

Date Code Title Description
RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20100602

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100721

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120731

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121001

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130402

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130408

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20160412

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 5244440

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350