[go: up one dir, main page]

JP2000181769A - Redundant database device - Google Patents

Redundant database device

Info

Publication number
JP2000181769A
JP2000181769A JP10356698A JP35669898A JP2000181769A JP 2000181769 A JP2000181769 A JP 2000181769A JP 10356698 A JP10356698 A JP 10356698A JP 35669898 A JP35669898 A JP 35669898A JP 2000181769 A JP2000181769 A JP 2000181769A
Authority
JP
Japan
Prior art keywords
data
database
slave
master
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP10356698A
Other languages
Japanese (ja)
Inventor
Shuji Takada
秀志 高田
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP10356698A priority Critical patent/JP2000181769A/en
Publication of JP2000181769A publication Critical patent/JP2000181769A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

(57)【要約】 【課題】 データの更新がある場合や、データ中に他の
データヘの参照を含む場合でも、二重化構成されたデー
タベース(DB)の等価化を可能とする。 【解決手段】 データの中身とともにそのデータの生成
時刻や更新時刻を記録しておくとともに、マスタ側のD
B1からスレーブ側のDB2へのデータコピー時に、コ
ピーされるデータのデータ識別子をそのデータの中身と
ともにスレーブ側のDB2に記録しておき、有効データ
取り出し部4により、スレーブ側のDB2からユーザの
指定時刻以降に生成または更新されたデータを、マスタ
側のDB1から当該指定時刻以前に生成または更新され
て、スレーブ側のDB2からまだ取り出されていないデ
ータを取り出す。
(57) [Summary] [PROBLEMS] To make it possible to equalize a duplicated database (DB) even when data is updated or when data includes a reference to another data. SOLUTION: The generation time and update time of the data are recorded together with the contents of the data, and D
When data is copied from B1 to DB2 on the slave side, the data identifier of the data to be copied is recorded in DB2 on the slave side together with the contents of the data, and the valid data extracting unit 4 designates a user from DB2 on the slave side. Data generated or updated after the time is generated or updated from the master side DB1 before the specified time, and data not yet extracted from the slave side DB2 is extracted.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】この発明は、マスタ側のデー
タベースとスレーブ側のデータベースとで二重化された
二重化データベース装置に関し、特にそれらマスタ側の
データベースとスレーブ側のデータベースの等価処理に
関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a duplicated database device in which a master database and a slave database are duplicated, and more particularly to an equivalent processing of the master database and the slave database.

【0002】[0002]

【従来の技術】図6は、例えば、特開平10−3160
8号公報に示された従来の二重化データベース装置にお
けるデータベース等価処理を示す説明図である。図にお
いて、1,2はその一方がマスタ側、他方がスレーブ側
となるデータベースである。また、11はデータベース
1内の収集データが格納されるデータ格納部、12は同
じくマスタ/スレーブ情報が格納されるマスタ/スレー
ブ情報格納部であり、21はデータベース2内の収集デ
ータが格納されるデータ格納部、22は同じくマスタ/
スレーブ情報が格納されるマスタ/スレーブ情報格納部
である。
2. Description of the Related Art FIG.
FIG. 8 is an explanatory diagram showing a database equivalence process in the conventional duplex database device shown in Japanese Patent Publication No. 8; In the figure, reference numerals 1 and 2 denote databases in which one is a master side and the other is a slave side. Reference numeral 11 denotes a data storage unit for storing collected data in the database 1; 12, a master / slave information storage unit for storing master / slave information; and 21, a collected data in the database 2. The data storage unit 22 is also the master /
This is a master / slave information storage unit in which slave information is stored.

【0003】次に動作について説明する。収集したデー
タを各データベース1および2のデータ格納部11,2
1に格納する際に、それぞれのデータベース1および2
がマスタであるかスレーブであるかを示すマスタ/スレ
ーブ情報を、それぞれのマスタ/スレーブ情報格納部1
2あるいは22にあわせて記録する。なお、図6には、
データベース1がマスタであり、データベース2がスレ
ーブである場合の記録例が示されている。また、収集デ
ータ#3および#4の記録時にはデータベース1が停止
状態にあったため、それらの収集データはデータベース
2のデータ格納部21にのみ記録され、そのマスタ/ス
レーブ情報格納部22には「マスタ」が記録される。こ
れら両系のデータベース1,2の等価化は、各データベ
ース1および2がマスタである時のデータのみを読み出
すことによって行われる。
Next, the operation will be described. The collected data is stored in the data storage units 11 and 12 of each of the databases 1 and 2.
1 are stored in the respective databases 1 and 2
The master / slave information indicating whether each is a master or a slave is stored in each master / slave information storage unit 1.
Record according to 2 or 22. In FIG. 6,
An example of recording in the case where the database 1 is a master and the database 2 is a slave is shown. When the collected data # 3 and # 4 were recorded, the database 1 was stopped. Therefore, the collected data is recorded only in the data storage unit 21 of the database 2, and the master / slave information storage unit 22 stores "master". Is recorded. Equalization of these two databases 1 and 2 is performed by reading out only the data when the databases 1 and 2 are masters.

【0004】したがって、このデータベース等価処理に
て扱えるデータベース1,2の操作は、収集されたデー
タの追加のみであり、すでに存在しているデータの更新
は扱えない。例えば、データベース1の停止中に収集デ
ータ#7の更新が行われた場合、データベース1および
2ともに、マスタ/スレーブ情報格納部12,22のマ
スタ/スレーブ情報が「マスタ」となり、どちらのデー
タが正しいか区別がつかなくなってしまう。また、デー
タ格納部11,21に格納された収集データの中に、他
の収集データヘの参照を示すデータ識別子、例えばリレ
ーショナルデータベースにおけるタプルID、オブジェ
クトデータベースのオブジェクトIDなどを含み、参照
関係が存在するデータがマスタ側のデータベース1とス
レーブ側のデータベース2との間にまたがってしまった
場合には、データの参照関係が正しくなくなってしま
う。
[0004] Therefore, the operations of the databases 1 and 2 that can be handled in this database equivalence processing are only addition of collected data, and cannot handle updating of existing data. For example, when the collected data # 7 is updated while the database 1 is stopped, the master / slave information in the master / slave information storage units 12 and 22 becomes “master” in both the databases 1 and 2, and which data is It is indistinguishable from correct. In addition, the collected data stored in the data storage units 11 and 21 includes a data identifier indicating a reference to another collected data, for example, a tuple ID in a relational database, an object ID in an object database, and the like, and a reference relationship exists. If the data straddles the database 1 on the master side and the database 2 on the slave side, the data reference relationship will be incorrect.

【0005】[0005]

【発明が解決しようとする課題】従来の二重化データベ
ース装置は以上のように構成されているので、収集され
たデータの追加は行えるが、すでに存在している収集デ
ータを更新することはできず、また、参照関係が存在す
る収集データがマスタ側のデータベース1とスレーブ側
のデータベース2との間にまたがるような場合、データ
の参照関係が正しくなくなってしまうなどの課題があっ
た。
Since the conventional redundant database apparatus is configured as described above, the collected data can be added, but the existing collected data cannot be updated. Further, when collected data having a reference relationship extends between the database 1 on the master side and the database 2 on the slave side, there is a problem that the reference relationship of the data becomes incorrect.

【0006】この発明は上記のような課題を解決するた
めになされたもので、データの更新がある場合、あるい
はデータ中に他のデータヘの参照を含む場合でも、二重
系で構成されたデータベースの等価化が可能な二重化デ
ータベース装置を得ることを目的とする。
SUMMARY OF THE INVENTION The present invention has been made to solve the above-mentioned problems. Even when data is updated or data includes a reference to another data, the database is constructed in a dual system. It is an object of the present invention to obtain a duplicated database device that can equalize the data.

【0007】[0007]

【課題を解決するための手段】この発明に係る二重化デ
ータベース装置は、各データベースに格納されるデータ
毎に、当該データの中身とともに、そのデータの生成時
刻や更新時刻を記録するようにしたものである。
According to the present invention, there is provided a duplex database device for recording, for each data stored in each database, the contents of the data and the generation time and update time of the data. is there.

【0008】この発明に係る二重化データベース装置
は、マスタ側のデータベースからスレーブ側のデータベ
ースへのデータのコピー時に、コピーされるデータのデ
ータ識別子をそのデータの中身とともに、スレーブ側の
データベースに記録するようにしたものである。
The duplicated database device according to the present invention records the data identifier of the copied data together with the contents of the data in the slave database when copying the data from the master database to the slave database. It was made.

【0009】この発明に係る二重化データベース装置
は、有効データ取り出し部を設け、両系のデータベース
を等価化する際に、スレーブ側のデータベースからは、
生成時刻あるいは更新時刻がユーザの指定時刻より未来
の時刻であるデータを取り出し、マスタ側のデータベー
スからは、生成時刻あるいは更新時刻がユーザの指定時
刻より過去の時刻で、スレーブ側のデータベースからま
だ取り出されていないデータを取り出すようにしたもの
である。
[0009] The duplicated database device according to the present invention is provided with a valid data extracting unit, and when equalizing the databases of both systems, from the slave database,
The data whose generation time or update time is later than the time specified by the user is extracted, and the data whose generation time or update time is earlier than the time specified by the user is still extracted from the database on the slave side. This is to retrieve data that is not stored.

【0010】この発明に係る二重化データベース装置
は、データ参照変換部を設け、有効データ取り出し部に
よって取り出されたデータ中に、参照関係のあるデータ
がマスタ側のデータベースとスレーブ側のデータベース
の間にまたがるものがあると、マスタ側のデータベース
よりスレーブ側のデータベースにコピーされたデータ
の、マスタ側のデータベースにおけるデータ識別子を利
用して、そのデータの参照先を変換するようにしたもの
である。
[0010] The duplicated database device according to the present invention is provided with a data reference conversion unit, and in the data retrieved by the valid data retrieval unit, data having a reference relationship extends between the master database and the slave database. When there is a data, the reference destination of the data copied from the master database to the slave database is converted using a data identifier in the master database.

【0011】[0011]

【発明の実施の形態】以下、この発明の実施の一形態を
説明する。 実施の形態1.図1はこの発明の実施の形態1による二
重化データベース装置の、データベース等価処理を行う
部分について示した構成図である。図において、1はデ
ータベース等価化処理が行われるマスタ側のデータベー
スであり、2は同じくスレーブ側のデータベースであ
る。3はマスタ側のデータベース1とスレーブ側のデー
タベース2から、ユーザが指定した時刻を基準にしてデ
ータを取り出し、その指定された時刻においてそれら両
系のデータベース1および2を連結することによって作
成された連結後のデータベースである。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of the present invention will be described below. Embodiment 1 FIG. FIG. 1 is a configuration diagram showing a part of the duplex database apparatus according to the first embodiment of the present invention that performs database equivalence processing. In the figure, reference numeral 1 denotes a database on the master side where a database equivalence process is performed, and reference numeral 2 denotes a database on the slave side. Reference numeral 3 is created by extracting data from the database 1 on the master side and the database 2 on the slave side based on the time specified by the user, and connecting the databases 1 and 2 of both systems at the specified time. This is the database after linking.

【0012】また、4はマスタ側のデータベース1とス
レーブ側のデータベース2の等価化を行う際に、スレー
ブ側のデータベース2からは、生成時刻あるいは更新時
刻としてユーザの指定する時刻より未来の時刻を持つデ
ータを取り出し、マスタ側のデータベース1からは、生
成時刻あるいは更新時刻がユーザの指定する時刻より過
去の時刻であり、かつ、マスタ側のデータベース1から
スレーブ側のデータベース2にコピーされたデータで、
当該スレーブ側のデータベース2からまだ取り出されて
いないものを取り出す有効データ取り出し部である。
When the master database 1 and the slave database 2 are equalized, the slave database 2 outputs a time later than the time specified by the user as a generation time or an update time. The master database 1 is retrieved and the generation time or the update time is earlier than the time specified by the user, and is copied from the master database 1 to the slave database 2. ,
This is a valid data extracting unit that extracts data that has not been extracted from the database 2 on the slave side.

【0013】5はこの有効データ取り出し部4によって
取り出されたデータに対して、連結後のデータベース3
でのデータ識別子が一意になるように、データのデータ
識別子を変換するデータ識別子変換部である。6はこの
データ識別子変換部5で変換されたデータ識別子につい
て、変更前のデータ識別子と変更後のデータ識別子との
対応を格納するデータ識別子対応表である。7はこのデ
ータ識別子対応表6に基づいて、データ中に含まれる他
のデータヘの参照が、連結後のデータベース3で正しい
参照となるように変換するデータ参照変換部である。
Reference numeral 5 denotes a database 3 after connection with the data retrieved by the valid data retrieval section 4.
Is a data identifier conversion unit that converts the data identifier of the data so that the data identifier is unique. Reference numeral 6 denotes a data identifier correspondence table for storing the correspondence between the data identifier before the change and the data identifier after the change with respect to the data identifier converted by the data identifier converter 5. Reference numeral 7 denotes a data reference conversion unit that converts, based on the data identifier correspondence table 6, a reference to other data included in the data so as to be a correct reference in the database 3 after connection.

【0014】次に動作について説明する。ここで、図2
はこの実施の形態1による二重化データベース装置で用
いられるデータの形式を示す説明図で、同図(a)は両
系のデータベース1,2において、データの生成時や変
更時に格納されたデータの一例であり、同図(b)はデ
ータのコピー時に格納されたデータの一例である。各デ
ータベース1あるいは2において、データが生成された
り変更されたりすると、図2(a)に示すように、その
データが生成された時刻や更新された時刻が、その中身
とともに当該データ中に記録される。なお、このデータ
には、データ識別子として(A,3)が与えられている
ものとする。また、このデータ識別子が(A,3)のデ
ータ(以下、データ(A,3)と表記する。他のデータ
識別子のデータについても同じ)のコピーが行われる
と、図2(b)に示すように、コピー元となったデータ
(A,3)のデータ識別子(A,3)も当該データ中に
記録される。ここで、このデータにはデータ識別子
(A,5)が与えられているものとする。なお、このデ
ータ(A,5)がコピーされたものではない場合には、
そのコピー元の項目は空欄(n/a)とする。
Next, the operation will be described. Here, FIG.
FIG. 3 is an explanatory diagram showing the format of data used in the duplex database apparatus according to the first embodiment. FIG. 4A shows an example of data stored at the time of data generation or change in the databases 1 and 2 of both systems. FIG. 2B is an example of data stored at the time of data copying. When data is generated or changed in each database 1 or 2, as shown in FIG. 2A, the time when the data is generated and the time when the data is updated are recorded in the data together with the contents. You. It is assumed that (A, 3) is given to this data as a data identifier. FIG. 2B shows a copy of the data whose data identifier is (A, 3) (hereinafter, referred to as data (A, 3). The same applies to data of other data identifiers). As described above, the data identifier (A, 3) of the data (A, 3) as the copy source is also recorded in the data. Here, it is assumed that the data is given a data identifier (A, 5). If this data (A, 5) is not a copy,
The copy source item is blank (n / a).

【0015】次に、このように記録されたデータの取り
出しについて説明する。ここで、図3は有効データ取り
出し部4におけるデータの取り出しの流れを示した説明
図である。この場合、マスタ側のデータベース1では、
データ(A)の生成、データ(A)の更新、データ
(B)の生成、データ(B)の更新、データ(C)の生
成、データ(C)の更新、データ(B)の更新、データ
(D)の生成、データ(D)の更新が順番に行われ、ス
レーブ側のデータベース2では、マスタ側のデータベー
ス1からのデータ(B)のコピー、マスタ側のデータベ
ース1からのデータ(C)のコピー、データ(B)の更
新、データ(D)の生成、データ(D)の更新、データ
(C)の更新が順番に行われたとする。ここで、図3に
連結面として示した時刻がユーザから指定された時刻で
あるとすると、マスタ側のデータベース1からはデータ
(A)が、スレーブ側のデータベース2からはデータ
(B)、データ(C)、データ(D)がそれぞれ最新の
データとして取り出される。
Next, the retrieval of the data recorded as described above will be described. Here, FIG. 3 is an explanatory diagram showing a flow of extracting data in the valid data extracting section 4. In this case, in the database 1 on the master side,
Generation of data (A), update of data (A), generation of data (B), update of data (B), generation of data (C), update of data (C), update of data (B), data The generation of (D) and the update of data (D) are performed in order. In the database 2 on the slave side, the data (B) is copied from the database 1 on the master side, and the data (C) from the database 1 on the master side is copied. , Update of data (B), generation of data (D), update of data (D), and update of data (C) are performed in order. Here, assuming that the time shown as the connection plane in FIG. 3 is the time designated by the user, data (A) is transmitted from the database 1 on the master side, data (B) and data are transmitted from the database 2 on the slave side. (C) and data (D) are respectively extracted as the latest data.

【0016】このデータの取り出しは、以下の手順にし
たがって行われる。まず、スレーブ側のデータベース2
に含まれるデータから、更新時刻がユーザから指定され
た時刻より未来、すなわち連結面の時刻以降のものを取
り出す。なお、更新時刻が記録されていないデータにつ
いては生成時刻が連結面の時刻以降のものを取り出す。
次に、マスタ側のデータベース1に含まれるデータか
ら、更新時刻がユーザから指定された時刻より過去、す
なわち連結面の時刻以前であり、かつ、スレーブ側のデ
ータベース2にコピーされたデータで、まだスレーブ側
のデータベース2から取り出されていないものを取り出
す。なお、この場合も、更新時刻が記録されていないデ
ータについては生成時刻が連結面の時刻以前のものよ
り、未取り出しのものが取り出される。スレーブ側のデ
ータベース2にコピーされたデータがスレーブ側のデー
タベース2で取り出されていないかどうかは、マスタ側
のデータベース1で取り出そうとしたデータのデータ識
別子をコピー元情報に持つスレーブ側のデータベース2
のデータが取り出されていないかどうかで判定する。
The data is taken out according to the following procedure. First, database 2 on the slave side
Are extracted from the data included in the data of the update time later than the time specified by the user, that is, those after the time of the connection plane. In addition, as for the data in which the update time is not recorded, the data whose generation time is after the time of the connection plane is extracted.
Next, from the data contained in the database 1 on the master side, the update time is before the time specified by the user, that is, before the time of the connection plane, and is the data copied to the database 2 on the slave side, Those that have not been retrieved from the database 2 on the slave side are retrieved. Also in this case, as for the data for which the update time is not recorded, the data whose generation time is not taken out is taken out from the data before the time of the connection plane. Whether the data copied to the slave-side database 2 has not been retrieved by the slave-side database 2 can be determined by determining whether the data identifier of the data to be retrieved by the master-side database 1 is included in the copy source information in the slave-side database 2.
It is determined whether or not the data has been extracted.

【0017】以下に、上記の手順を図3で示した例に当
てはめて説明する。まず、スレーブ側のデータベース2
に存在するすべてのデータ、すなわちデータ(B)、デ
ータ(C)、データ(D)について、その更新時刻を調
べると、いずれも連結面として指定された時刻以降であ
るので、スレーブ側のデータベース2からはデータ
(B)、データ(C)、データ(D)が取り出される。
次に、マスタ側のデータベース1に存在するすべてのデ
ータ、すなわちデータ(A)、データ(B)、データ
(C)、データ(D)の更新時刻を調べると、連結面と
して指定された時刻以前のものはデータ(A)およびデ
ータ(C)となる。さらに、このデータ(A)およびデ
ータ(C)の中で、スレーブ側のデータベース2ヘコピ
ーされ、スレーブ側のデータベース2で、既に取り出さ
れているものを調べると、データ(C)が該当する。し
たがって、マスタ側のデータベース1からはデータ
(A)のみが取り出される。このようにして、連結後の
データベース3には、データ(A)、データ(B)、デ
ータ(C)、データ(D)が重複なく取り出される。
Hereinafter, the above procedure will be described with reference to the example shown in FIG. First, database 2 on the slave side
When the update times of all the data existing in the slave side, that is, the data (B), the data (C), and the data (D) are examined, they are all after the time designated as the connection plane. , Data (B), data (C), and data (D) are extracted.
Next, when the update times of all the data existing in the database 1 on the master side, that is, the data (A), the data (B), the data (C), and the data (D) are checked, the update times before the time designated as the connection plane are found. Are data (A) and data (C). Further, when the data (A) and the data (C) are copied to the slave database 2 and those already retrieved from the slave database 2 are examined, the data (C) corresponds to the data (C). Therefore, only the data (A) is extracted from the database 1 on the master side. In this way, data (A), data (B), data (C), and data (D) are extracted from the linked database 3 without duplication.

【0018】次に、データ識別子変換部5によるデータ
識別子対応表6の生成と、データ参照変換部7によるデ
ータ参照の変換について説明する。なお、図4はそのデ
ータ参照の変換の流れを示した説明図あり、図5はデー
タ識別子対応表6の一例を示す説明図である。ここで、
図4に示すように、マスタ側のデータベース1からは連
結面の時刻以前の、データ(A,4)、データ(B,
6)、データ(A,6)が取り出され、スレーブ側のデ
ータベース2からは連結面の時刻以降の、データ(B,
8)、データ(A,6)、データ(B,9)が取り出さ
れて、連結後のデータベース3を構成するものとする。
また、マスタ側のデータベース1では、データ(B,
6)への参照がデータ(A,4)に、データ(B,7)
への参照がデータ(A,6)に含まれ、スレーブ側のデ
ータベース2では、データ(B,8)への参照がデータ
(A,3)に、データ(B,9)への参照がデータ
(A,6)に含まれているものとする。また、マスタ側
のデータベース1のデータ(A,6)はスレーブ側のデ
ータベース2にデータ(A,3)としてコピーされ、マ
スタ側のデータベース1のデータ(B,7)はスレーブ
側のデータベース2にデータ(B,8)としてコピーさ
れるものとする。
Next, generation of the data identifier correspondence table 6 by the data identifier conversion unit 5 and conversion of data reference by the data reference conversion unit 7 will be described. 4 is an explanatory diagram showing the flow of the data reference conversion, and FIG. 5 is an explanatory diagram showing an example of the data identifier correspondence table 6. here,
As shown in FIG. 4, from the database 1 on the master side, data (A, 4) and data (B,
6), the data (A, 6) are taken out, and the data (B,
8), data (A, 6), and data (B, 9) are taken out to constitute the linked database 3.
In the database 1 on the master side, the data (B,
Reference to 6) is to data (A, 4) and data (B, 7)
Is included in the data (A, 6), and in the database 2 on the slave side, the reference to the data (B, 8) is the data (A, 3), and the reference to the data (B, 9) is the data. (A, 6). The data (A, 6) of the master database 1 is copied to the slave database 2 as data (A, 3), and the data (B, 7) of the master database 1 is copied to the slave database 2. It is assumed that the data is copied as data (B, 8).

【0019】なお、有効データ取り出し部4によって取
り出されたデータを、連結後のデータベース3に再構成
するに際しては、データ識別子は重複がないように付け
替えられる必要がある。ここで、図5には、図4に示し
た例におけるデータ識別子の付け替えにともなって作成
されたデータ識別子対応表6の内容が示されている。
When reconstructing the data retrieved by the valid data retrieval section 4 into the linked database 3, the data identifiers need to be replaced so that there is no duplication. Here, FIG. 5 shows the contents of the data identifier correspondence table 6 created with the replacement of the data identifier in the example shown in FIG.

【0020】図4に示した例では、マスタ側のデータベ
ース1のデータ(A,4)にはデータ(B,6)への参
照が含まれているが、データ(A,4)に対応する連結
後のデータベース3のデータ(A,1)中の参照は、デ
ータ(B,6)に対応する連結後のデータベース3のデ
ータ(B,1)に変更される必要がある。また、参照関
係の存在する二つのデータが、マスタ側のデータベース
1とスレーブ側のデータベース2にまたがって取り出さ
れた場合には、マスタ側のデータベース1のデータ
(A,6)からデータ(B,7)への参照は、連結後の
データベース3では、データ(A,2)からスレーブ側
のデータベース2より取り出されたデータ(B,8)に
対応するデータ(B,2)への参照に変換される必要が
ある。
In the example shown in FIG. 4, the data (A, 4) of the database 1 on the master side includes a reference to the data (B, 6), but corresponds to the data (A, 4). The reference in the data (A, 1) of the linked database 3 needs to be changed to the data (B, 1) of the linked database 3 corresponding to the data (B, 6). When two data having a reference relationship are extracted across the database 1 on the master side and the database 2 on the slave side, the data (A, 6) is read from the data (A, 6) of the database 1 on the master side. The reference to 7) is converted from the data (A, 2) to the reference to data (B, 2) corresponding to the data (B, 8) extracted from the database 2 on the slave side in the database 3 after connection. Need to be done.

【0021】その場合、この参照先データのデータ識別
子変換は、以下の手順にしたがって行われる。まず、参
照先データを変更するデータと参照先のデータが、両方
ともマスタ側のデータベース1、あるいはスレーブ側の
データベース2から取り出されたかどうかを、データ識
別子対応表6で調べる。その結果、参照先データを変更
するデータと参照先のデータが、両方ともマスタ側のデ
ータベース1、あるいはスレーブ側のデータベース2か
ら取り出されたものであった場合には、参照先データの
連結後のデータベース3でのデータ識別子を、データ識
別子対応表6から求めて変換後のデータ識別子とする。
また、参照先データを変更するデータと参照先のデータ
が、その一方がマスタ側のデータベース1から、他方が
スレーブ側のデータベース2からそれぞれ取り出された
場合には、参照先データからコピーされたデータを、デ
ータ中に格納されているコピー元データ識別子から求
め、そのデータの連結後のデータベース3中でのデータ
識別子を、データ識別子対応表6から求めて変換後のデ
ータ識別子とする。
In this case, the data identifier conversion of the reference data is performed according to the following procedure. First, the data identifier correspondence table 6 is used to check whether both the data for changing the reference destination data and the reference destination data have been extracted from the database 1 on the master side or the database 2 on the slave side. As a result, if the data for changing the reference data and the data of the reference data are both extracted from the database 1 on the master side or the database 2 on the slave side, the data after the concatenation of the reference data is obtained. The data identifier in the database 3 is obtained from the data identifier correspondence table 6 and is used as the converted data identifier.
If one of the data for changing the reference data and the data of the reference data is retrieved from the database 1 on the master side and the other is retrieved from the database 2 on the slave side, the data copied from the reference data is obtained. Is obtained from the copy source data identifier stored in the data, and the data identifier in the database 3 after the linking of the data is obtained from the data identifier correspondence table 6 to be the converted data identifier.

【0022】以下に、上記の手順を図4および図5に示
した例に当てはめて説明する。マスタ側のデータ(A,
4)からマスタ側のデータ(B,6)への参照は、双方
ともマスタ側のデータベース1から取り出されているの
で、参照先データの連結後のデータベース3でのデータ
識別子を、データ識別子対応表6から求めて変換後のデ
ータ識別子とする。すなわち、図5に示すデータ識別子
対応表6からマスタ側のデータ(B,6)は連結後のデ
ータベース3ではデータ(B,1)に変更されているこ
とが分かるので、マスタ側のデータ(A,4)、すなわ
ち連結後のデータベース3のデータ(A,1)中の参照
をデータ(B,1)とする。
Hereinafter, the above procedure will be described with reference to the examples shown in FIGS. Master side data (A,
Since the reference from 4) to the data (B, 6) on the master side is both taken out from the database 1 on the master side, the data identifier in the database 3 after linking the reference destination data is stored in the data identifier correspondence table. 6 to obtain the converted data identifier. In other words, it can be seen from the data identifier correspondence table 6 shown in FIG. 5 that the data (B, 6) on the master side has been changed to the data (B, 1) in the database 3 after connection, so the data (A, , 4), that is, the reference in the data (A, 1) of the database 3 after linking is defined as data (B, 1).

【0023】また、マスタ側のデータ(A,6)からマ
スタ側のデータ(B,7)への参照は、マスタ側のデー
タ(B,7)が連結後のデータベース3には取り出され
ておらず、そのコピーであるスレーブ側のデータ(B,
8)が取り出されているので、参照先データからコピー
されたデータを、データ中に格納されているコピー元デ
ータ識別子から求め、そのデータの連結後のデータベー
ス3中でのデータ識別子を、データ識別子対応表6から
求めて変換後のデータ識別子とする。すなわち、マスタ
側のデータ(A,6)から参照されているデータ(B,
7)をコピー元データ識別子として持つデータをスレー
ブ側のデータベース2から取り出されたデータから探
す。その結果、スレーブ側のデータ中にデータ(B,
8)が見つかる。その後、スレーブ側のデータ(B,
8)の連結後のデータベース3中でのデータ識別子は、
データ識別子対応表6を参照してデータ(B,2)が得
られるので、マスタ側のデータ(A,6)、すなわち、
連結後のデータベース3のデータ(A,2)中の参照を
データ(B,2)とする。
The reference from the data (A, 6) on the master side to the data (B, 7) on the master side is performed by extracting the data (B, 7) on the master side into the database 3 after connection. Instead, the slave side data (B,
8), the data copied from the reference destination data is obtained from the copy source data identifier stored in the data, and the data identifier in the database 3 after the concatenation of the data is replaced with the data identifier The converted data identifier is obtained from the correspondence table 6. That is, the data (B, B) referenced from the data (A, 6) on the master side.
Search for data having 7) as the copy source data identifier from the data extracted from the database 2 on the slave side. As a result, the data (B,
8) is found. Then, the data (B,
8) The data identifier in the database 3 after the connection is
Since the data (B, 2) is obtained by referring to the data identifier correspondence table 6, the data (A, 6) on the master side, that is,
The reference in the data (A, 2) of the database 3 after the connection is defined as data (B, 2).

【0024】このようにして、データ参照変換部7は有
効データ取り出し部4によって取り出されたデータ中
に、データの参照関係がマスタ側のデータベース1から
取り出したデータとスレーブ側のデータベース2から取
り出したデータの間にまたがるものがあった場合に、参
照先データからコピーされたデータを、データ中に格納
されているコピー元データ識別子から求めて、そのデー
タのデータ識別子をデータ識別子対応表6から求めて変
換後のデータ識別子とすることにより、連結後のデータ
ベース3では参照関係を正しく保持した連結後のデータ
ベース3を作成している。
In this manner, the data reference conversion unit 7 has the data reference relation extracted from the master database 1 and the slave database 2 in the data extracted by the valid data extraction unit 4. When there is a data straddling, the data copied from the reference data is obtained from the copy source data identifier stored in the data, and the data identifier of the data is obtained from the data identifier correspondence table 6. By using the converted data identifier as the data identifier, the database 3 after linking creates the database 3 after linking while properly maintaining the reference relation.

【0025】このように、この実施の形態1によれば、
データの生成時刻と更新時刻をデータの中身とともに記
録することで、データの生成だけでなく更新に対しても
両系のデータでどのデータが最新のデータであるかの判
別が可能になり、また、マスタ側のデータベース1から
スレーブ側のデータベース2にデータがコピーされた場
合にも、両系に別々に格納されたデータを同定すること
が可能になり、さらに、データの生成と更新が行われる
データベースにおいて、両系で構築されたデータベース
1,2からそれぞれ最新で、かつ、重複なくデータを取
り出し、連結後のデータベース3を構築することができ
るため、データヘの更新が行われた場合でも、マスタ
側、スレーブ側から正しいデータを重複なく取り出し
て、連結後のデータベース3を構成することが可能とな
り、また、参照関係のあるデータがマスタ側のデータベ
ース1とスレーブ側のデータベース2にまたがって取り
出された場合でも、参照を表すデータ識別子を連結後の
データベース3に変換することにより、連結後のデータ
ベース3でも正しい参照関係が保持されるため、データ
中に他のデータヘの参照を含み、その参照がマスタ側の
データベース1とスレーブ側のデータベース2にまたが
るような場合でも、連結後のデータベース3では参照関
係を正しく保持することができるなどの効果が得られ
る。
As described above, according to the first embodiment,
By recording the data generation time and update time together with the data content, it is possible to determine which data is the latest data in both systems not only for data generation but also for update, Also, even when data is copied from the master database 1 to the slave database 2, it is possible to identify data stored separately in both systems, and furthermore, data generation and updating are performed. In the database, the latest data can be extracted from the databases 1 and 2 constructed by both systems without any duplication, and the database 3 after the connection can be constructed. Therefore, even if the data is updated, the master can be obtained. The correct data can be extracted from the slave and slave sides without duplication, and the linked database 3 can be constructed. Even if data that is fetched across the database 1 on the master side and the database 2 on the slave side, by converting the data identifier representing the reference into the database 3 after linking, a correct reference relationship can be established in the database 3 after linking. Even if the data includes a reference to another data and the reference extends to the master database 1 and the slave database 2, the reference relationship should be correctly maintained in the linked database 3. And the like.

【0026】[0026]

【発明の効果】以上のように、この発明によれば、各デ
ータベースに格納されるデータの生成時刻と更新時刻
を、そのデータの中身とともに記録するように構成した
ので、データの生成だけでなく、データの更新に対して
も両系のデータでどのデータが最新のデータであるかを
判別することが可能になるため、データの更新が行われ
た場合でも、マスタ側のデータベースとスレーブ側のデ
ータベースの双方から正しいデータを重複なく取り出す
ことができ、二重化構成されたデータベースの等価化が
可能となって、システムの運用をより柔軟に行うことが
できる二重化データベース装置が得られる効果がある。
As described above, according to the present invention, the generation time and the update time of the data stored in each database are recorded together with the contents of the data. In the case of data update, it is possible to determine which data is the latest data in the data of both systems, so even if the data is updated, the master database and the slave Correct data can be extracted from both databases without duplication, and the duplicated database can be equalized, so that there is an effect that a duplicated database device that can flexibly operate the system can be obtained.

【0027】この発明によれば、マスタ側のデータベー
スからスレーブ側のデータベースへのデータコピー時
に、スレーブ側のデータベースに、コピーされるデータ
のデータ識別子をそのデータの中身とともに記録するよ
うに構成したので、マスタ側のデータベースからスレー
ブ側のデータベースにデータがコピーされた場合に、両
系に別々に格納されたデータを同定することができるよ
うになるため、マスタ側のデータベースとスレーブ側の
データベースの双方から正しいデータを重複なく取り出
すことができ、二重化構成されたデータベースを等価化
することが可能になるという効果がある。
According to the present invention, when data is copied from the master database to the slave database, the data identifier of the copied data is recorded in the slave database together with the contents of the data. When data is copied from the master database to the slave database, data stored separately in both systems can be identified, so that both the master database and the slave database can be identified. Thus, there is an effect that correct data can be extracted from the database without duplication, and it is possible to equalize a duplicated database.

【0028】この発明によれば、スレーブ側のデータベ
ースからは生成時刻あるいは更新時刻がユーザの指定時
刻より未来の時刻であるデータを取り出し、マスタ側の
データベースからは生成時刻あるいは更新時刻がユーザ
の指定時刻より過去の時刻で、スレーブ側のデータベー
スからまだ取り出されていないデータを取り出すように
構成したので、データの生成と更新が行われる両系のデ
ータベースから、それぞれ最新で、かつ、重複なくデー
タを取り出して連結後のデータベースを構築することが
できるため、二重化構成されたデータベースの等価化が
可能になるという効果がある。
According to the present invention, data whose generation time or update time is later than the time specified by the user is extracted from the database on the slave side, and data whose generation time or update time is specified by the user is specified from the database on the master side. At the time before the time, the data that has not been retrieved from the slave side database is configured to be retrieved. Since the database can be constructed after being taken out and connected, there is an effect that the duplicated database can be equalized.

【0029】この発明によれば、取り出されたデータ中
に、参照関係のあるデータでマスタ側のデータベースと
スレーブ側のデータベースの間にまたがるものがあった
場合には、マスタ側のデータベースよりスレーブ側のデ
ータベースにコピーされたデータの参照先を、マスタ側
のデータベースにおけるデータ識別子を利用して変換す
るように構成したので、データ中に他のデータヘの参照
を含み、参照関係のあるデータがマスタ側のデータベー
スとスレーブ側のデータベースにまたがっているような
場合でも、参照を表すデータ識別子を連結後のデータベ
ースに変換することにより、連結後のデータベースでは
正しい参照関係を保持することができるため、二重化構
成されたデータベースの等価化が可能になるという効果
がある。
According to the present invention, if there is any data having a reference relationship between the master database and the slave database in the extracted data, the slave database is replaced with the master database. The reference destination of the data copied to the database of the master is converted using the data identifier in the database on the master side. If the data identifier that represents the reference is converted to the linked database even if it spans the database of the slave and the database on the slave side, the linked database can maintain the correct reference relationship. There is an effect that it is possible to equalize the database.

【図面の簡単な説明】[Brief description of the drawings]

【図1】 この発明の実施の形態1による二重化データ
ベース装置を示す構成図である。
FIG. 1 is a configuration diagram showing a duplicated database device according to Embodiment 1 of the present invention.

【図2】 実施の形態1におけるデータの形式を示す説
明図である。
FIG. 2 is an explanatory diagram showing a data format according to the first embodiment.

【図3】 実施の形態1におけるデータの取り出しの流
れを示す説明図である。
FIG. 3 is an explanatory diagram showing a flow of extracting data according to the first embodiment;

【図4】 実施の形態1におけるデータ参照の変換の流
れを示す説明図である。
FIG. 4 is an explanatory diagram showing a flow of data reference conversion according to the first embodiment;

【図5】 実施の形態1におけるデータ識別子対応表の
一例を示す説明図である。
FIG. 5 is an explanatory diagram showing an example of a data identifier correspondence table in the first embodiment.

【図6】 従来の二重化データベース装置におけるデー
タベース等価処理を示す説明図である。
FIG. 6 is an explanatory diagram showing a database equivalent process in a conventional duplex database device.

【符号の説明】[Explanation of symbols]

1 マスタ側のデータベース、2 スレーブ側のデータ
ベース、3 連結後のデータベース、4 有効データ取
り出し部、7 データ参照変換部。
1 Master side database, 2 Slave side database, 3 Connected database, 4 Effective data retrieval section, 7 Data reference conversion section.

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 二重化されたマスタ側のデータベースと
スレーブ側のデータベースから、ユーザの指定する時刻
を基準にしてデータを取り出し、前記マスタ側のデータ
ベースとスレーブ側のデータベースを前記指定された時
刻で連結して連結後のデータベースを作成する二重化デ
ータベース装置において、 前記データの生成や更新が行われる際に、前記各データ
ベースに格納されるデータ毎に、当該データの生成時刻
や更新時刻を、そのデータの中身とともに記録すること
を特徴とする二重化データベース装置。
1. Data is extracted from a duplicated master database and slave database based on a time specified by a user, and the master database and the slave database are connected at the specified time. In the dual database device that creates a database after linking, when the data is generated or updated, the generation time and update time of the data are stored for each data stored in the database. A duplicate database device characterized by recording with the contents.
【請求項2】 二重化されたマスタ側のデータベースと
スレーブ側のデータベースから、ユーザの指定する時刻
を基準にしてデータを取り出し、前記マスタ側のデータ
ベースとスレーブ側のデータベースを前記指定された時
刻で連結して連結後のデータベースを作成する二重化デ
ータベース装置において、 前記マスタ側のデータベースから前記スレーブ側のデー
タベースにデータをコピーする際に、前記マスタ側のデ
ータベースに格納されていたコピーされるデータのデー
タ識別子を、前記スレーブ側のデータベースにそのデー
タの中身とともに記録することを特徴とする二重化デー
タベース装置。
2. Data is extracted from the duplicated master database and slave database based on a time specified by a user, and the master database and the slave database are connected at the specified time. A data identifier of data to be copied stored in the master-side database when copying data from the master-side database to the slave-side database. In the slave-side database together with the contents of the data.
【請求項3】 二重化されたマスタ側のデータベースと
スレーブ側のデータベースから、ユーザの指定する時刻
を基準にしてデータを取り出し、前記マスタ側のデータ
ベースとスレーブ側のデータベースを前記指定された時
刻で連結して連結後のデータベースを作成する二重化デ
ータベース装置において、 前記データの生成や更新を行う時に、当該データの生成
時刻や更新時刻を、そのデータの中身とともに記録し、 前記マスタ側のデータベースから前記スレーブ側のデー
タベースにデータをコピーする時には、コピーされた当
該データの前記マスタ側のデータベースでのデータ識別
子を、そのデータの中身とともに前記スレーブ側のデー
タベースに記録し、 前記マスタ側のデータベースとスレーブ側のデータベー
スとの等価化を行う際に、前記スレーブ側のデータベー
スからは、前記ユーザの指定する時刻より未来の時刻を
生成時刻あるいは更新時刻に持つデータを取り出し、前
記マスタ側のデータベースからは、前記ユーザの指定す
る時刻より過去の時刻を生成時刻あるいは更新時刻に持
ち、かつ、前記スレーブ側のデータベースにコピーされ
て当該スレーブ側のデータベースからまだ取り出されて
いないデータを取り出す有効データ取り出し部を設けた
ことを特徴とする二重化データベース装置。
3. Extracting data from the duplicated master database and slave database based on the time specified by the user, and connecting the master database and the slave database at the specified time. In the dual database device that creates a database after linking, when generating or updating the data, the generation time or update time of the data is recorded together with the content of the data, and the slave from the master-side database is recorded. When copying data to the database on the side, the data identifier of the copied data in the database on the master side is recorded in the database on the slave side together with the content of the data, and the database on the master side and the data on the slave side are recorded. When performing equalization with the database, From the database on the slave side, data having a generation time or an update time later than the time specified by the user is extracted, and from the database on the master side, a time earlier than the time specified by the user is generated. A duplicated database apparatus, comprising: a valid data extracting unit that retrieves data that has a time or an update time and is copied to the database on the slave side and has not been extracted from the database on the slave side.
【請求項4】 有効データ取り出し部によって取り出さ
れたデータを連結して連結後のデータベースを作成する
際に、取り出された前記データ中に、データの参照関係
がマスタ側のデータベースから取り出したデータとスレ
ーブ側のデータベースから取り出したデータの間にまた
がるデータがあると、前記スレーブ側のデータベースに
記録されている、前記マスタ側のデータベースよりコピ
ーされたデータの、マスタ側のデータベースにおけるデ
ータ識別子を利用して、そのデータの参照先を変換する
データ参照変換部を設けたことを特徴とする請求項3記
載の二重化データベース装置。
4. When concatenating the data retrieved by the valid data retrieval unit to create a coupled database, the retrieved data has a data reference relationship with the data retrieved from the master database. If there is data spanning between data retrieved from the slave database, the data identifier in the master database of data copied from the master database and recorded in the slave database is used. 4. The dual database apparatus according to claim 3, further comprising a data reference conversion unit for converting a reference destination of the data.
JP10356698A 1998-12-15 1998-12-15 Redundant database device Pending JP2000181769A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10356698A JP2000181769A (en) 1998-12-15 1998-12-15 Redundant database device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10356698A JP2000181769A (en) 1998-12-15 1998-12-15 Redundant database device

Publications (1)

Publication Number Publication Date
JP2000181769A true JP2000181769A (en) 2000-06-30

Family

ID=18450338

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10356698A Pending JP2000181769A (en) 1998-12-15 1998-12-15 Redundant database device

Country Status (1)

Country Link
JP (1) JP2000181769A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20020036502A (en) * 2000-11-10 2002-05-16 오길록 Duplicated Database Management System for Main Memory Resident DBMS
KR100471567B1 (en) * 2000-07-29 2005-03-07 엘지전자 주식회사 Transaction Management Method For Data Synchronous In Dual System Environment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100471567B1 (en) * 2000-07-29 2005-03-07 엘지전자 주식회사 Transaction Management Method For Data Synchronous In Dual System Environment
KR20020036502A (en) * 2000-11-10 2002-05-16 오길록 Duplicated Database Management System for Main Memory Resident DBMS

Similar Documents

Publication Publication Date Title
US8140588B2 (en) Decentralized many-to-many relationship management in an object persistence management system
US20080222163A1 (en) Automatic Data Consolidation
JP2000148461A (en) Software model and existing source code synchronizing method and device
US20040044793A1 (en) Isolated mappping point
US10997218B2 (en) Method and system for managing associations between entity records
US7958031B2 (en) Apparatus, system, and method for automated identity relationship maintenance
TW569110B (en) Dynamic database management system and method
JP4562749B2 (en) Document compression storage method and apparatus
JP3612449B2 (en) Master-slave relationship information synchronization method in distributed database system
CN111414382A (en) Slow SQ L polymerization display method and system based on MongoDB
JP2000181769A (en) Redundant database device
CN118035200A (en) Distributed file system metadata management method, device and equipment
JP2000047919A (en) Virtual database replication system
CN116010172A (en) A data synchronization method, database, data synchronization device and product
TW201042470A (en) Data synchronization system and method using directory service format to establish metadata
CN116049306A (en) Data synchronization method, device, electronic device and readable storage medium
JP2000132435A (en) Data consistency processing device between heterogeneous database management systems
JP3730556B2 (en) Database management system
JP2679602B2 (en) Evacuation medium creation system
Aebi et al. Methods and tools for data value re-engineering
CN107590266B (en) Method for replicating XBRL classification criteria
KR100298168B1 (en) Method for processing and editing of phone number update data
JP2002536710A (en) Description and storage method of alignment information
JP4681338B2 (en) Database migration method
JP2007004226A (en) Master synchronization program and master synchronization method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050603

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050621

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20051018