JPH04255040A - Data base processor - Google Patents

Data base processor

Info

Publication number
JPH04255040A
JPH04255040A JP3036845A JP3684591A JPH04255040A JP H04255040 A JPH04255040 A JP H04255040A JP 3036845 A JP3036845 A JP 3036845A JP 3684591 A JP3684591 A JP 3684591A JP H04255040 A JPH04255040 A JP H04255040A
Authority
JP
Japan
Prior art keywords
database
file
reorganization
database file
update
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
JP3036845A
Other languages
Japanese (ja)
Inventor
Seiya Miyazaki
宮崎 靖也
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP3036845A priority Critical patent/JPH04255040A/en
Publication of JPH04255040A publication Critical patent/JPH04255040A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To reconstitute a data base file without interrupting the execution of a user's application program and reducing the processing capacity of a relational data base system whose operation can not be aborted for a long period. CONSTITUTION:The data base system is duplicated by a main data base file 13 and a sub-data base file 14. When the reconstitution of the data base files is executed by either one of the files, the operation of the data base system is continued by the other file. Updating information following the operation is stored in a reconstitution history file 15 through a reconstitution updating history output part 11. After completing the reconstitution of the data base files, the reconstituted data base files are updated based upon the updating information stored in the file 15.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【技術分野】本発明はデータベース処理装置に関し、特
にリレーショナルデータベースシステムにおけるデータ
ベースファイルの再編成方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a database processing apparatus, and more particularly to a database file reorganization method in a relational database system.

【0002】0002

【従来技術】従来、リレーショナルデータベースシステ
ムにおいては、レコードの追加や削除などによってファ
イル内のレコード配置状況が悪くなってアクセス効率が
悪くなった場合に、論理的な定義情報を変更することな
く、レコードの配置状況を変更するためにデータベース
ファイルの再編成を行っている。
[Prior Art] Conventionally, in a relational database system, when the arrangement of records in a file deteriorates due to the addition or deletion of records, resulting in poor access efficiency, the system automatically processes records without changing logical definition information. The database files are being reorganized to change the location of the database.

【0003】この再編成方式としては、一旦データベー
スシステムの運用を中止してデータベースファイルに対
する更新が起きないようにし、データベースファイル内
のデータを二次記憶装置に出力した後に、その二次記憶
装置からのデータを整列させながらデータベースファイ
ル内に書き戻して再編成を行う方式が一般的である。通
常、データベースファイルの再編成には相当の時間がか
かるので、24時間運転などで停止できないシステムで
は上記の方式を実行することはできない。
[0003] In this reorganization method, the operation of the database system is temporarily stopped to prevent updates to the database file, the data in the database file is output to the secondary storage device, and then the data is output from the secondary storage device. A common method is to reorganize the data by sorting it and writing it back into the database file. Normally, it takes a considerable amount of time to reorganize database files, so the above method cannot be implemented in a system that cannot be stopped due to 24-hour operation.

【0004】その場合、システムの運用中に、データベ
ースファイル内のレコードの位置を少しずつ変えていっ
て部分的に再編成を行っていく方法も考えられる。しか
しながら、この方法でもデータベースファイル内に更新
を停止しなければならない部分が常にできてしまうため
、アプリケーションプログラムがその部分のレコードを
アクセスしようとすると、ビジーとなって待たされたり
、デッドロックになる可能性があり、プログラム実行に
支障をきたす恐れがある。
[0004] In this case, a method may be considered in which the positions of records in the database file are changed little by little while the system is in operation to perform partial reorganization. However, even with this method, there will always be a part in the database file where updates must be stopped, so when an application program tries to access a record in that part, it may become busy and have to wait, or a deadlock may occur. This may cause problems with program execution.

【0005】また、上記の方法ではシステム運用中にデ
ータベースファイルに対して余分なファイルI/Oが大
量に出力されることとなる。したがって、ユーザのアプ
リケーションプログラムに対する処理が遅れ、システム
の処理能力が落ちる恐れがある。
Furthermore, in the above method, a large amount of extra file I/O is output to the database file during system operation. Therefore, the processing of the user's application program may be delayed, and the processing capacity of the system may be reduced.

【0006】このような従来のデータベースシステムで
は、一旦データベースシステムの運用を中止してデータ
ベースファイルの再編成を行う方式の場合、長時間運用
を止められないシステムではデータベースファイルの再
編成を行うことができないという欠点がある。
[0006] In such conventional database systems, if the database system operation is temporarily stopped and the database files are reorganized, it is difficult to reorganize the database files in a system where operation cannot be stopped for a long time. The drawback is that it cannot be done.

【0007】また、システムの運用中にデータベースフ
ァイルを部分的に少しずつ整列していく方式の場合、ユ
ーザのアプリケーションプログラムの実行が阻害された
り、システムの処理能力が落ちたりするという欠点があ
る。
[0007] Furthermore, in the case of a method in which database files are arranged little by little in parts during system operation, there are drawbacks in that execution of a user's application program is hindered and the processing capacity of the system is reduced.

【0008】[0008]

【発明の目的】本発明は上記のような従来のものの欠点
を除去すべくなされたもので、ユーザのアプリケーショ
ンプログラムの実行を阻害したり、システムの処理能力
を低下させることなく、長時間運用を止められないシス
テムでもデータベースファイルの再編成を行うことがで
きるデータベース処理装置の提供を目的とする。
OBJECTS OF THE INVENTION The present invention has been made to eliminate the drawbacks of the conventional systems as described above. To provide a database processing device capable of reorganizing database files even in an unstoppable system.

【0009】[0009]

【発明の構成】本発明によるデータベース処理装置は、
同一データのファイルを夫々格納する第1および第2の
データベースファイルと、前記第1および第2のデータ
ベースファイルの再編成時に前記第1および第2のデー
タベースファイルのうち一方をデータベースシステムか
ら切離す切離し手段と、前記切離し手段によって前記デ
ータベースシステムから切離されたデータベースファイ
ルの内容を二次記憶装置に格納するデータベースセーブ
手段と、前記二次記憶装置に格納された内容を基にデー
タベースファイルの内容を再編成する再編成手段と、前
記再編成手段によるデータベースファイルの再編成時に
他方のデータベースファイルに対する更新履歴情報を保
持する保持手段と、前記再編成手段によって再編成され
たデータベースファイルの内容を前記保持手段に保持さ
れた前記更新履歴情報にしたがって更新する更新手段と
を設けたことを特徴とする。
[Structure of the Invention] A database processing device according to the present invention includes:
first and second database files each storing files of the same data; and detachment for separating one of the first and second database files from the database system when the first and second database files are reorganized. means, database saving means for storing the contents of the database file separated from the database system by the separating means in a secondary storage device, and saving the contents of the database file based on the contents stored in the secondary storage device. a reorganization means for reorganizing; a holding means for holding update history information for the other database file when the database file is reorganized by the reorganization means; and a holding means for holding the contents of the database file reorganized by the reorganization means. The apparatus is characterized by further comprising: an updating means for updating according to the update history information held in the means.

【0010】本発明による他のデータベース処理装置は
、第1のデータベースファイルの再編成時に前記第1の
データベースファイルと同一データのファイルを格納す
る第2のデータベースファイルを作成する作成手段と、
前記第1のデータベースファイルの再編成時に前記第1
および第2のデータベースファイルのうち一方を前記デ
ータベースシステムから切離す切離し手段と、前記切離
し手段によって前記データベースシステムから切離され
たデータベースファイルの内容を二次記憶装置に格納す
るデータベースセーブ手段と、前記二次記憶装置に格納
された内容を基にデータベースファイルの内容を再編成
する再編成手段と、前記再編成手段によるデータベース
ファイルの再編成時に他方のデータベースファイルに対
する更新履歴情報を保持する保持手段と、前記再編成手
段によって再編成されたデータベースファイルの内容を
前記保持手段に保持された前記更新履歴情報にしたがっ
て更新する更新手段とを設けたことを特徴とする。
Another database processing apparatus according to the present invention includes a creation means for creating a second database file storing a file having the same data as the first database file when reorganizing the first database file;
When reorganizing the first database file, the first
and a detaching means for detaching one of the second database files from the database system; a database save means for storing the contents of the database file detached from the database system by the detaching means in a secondary storage device; a reorganization means for reorganizing the contents of a database file based on the contents stored in a secondary storage device; and a holding means for retaining update history information for the other database file when the database file is reorganized by the reorganization means. and updating means for updating the contents of the database file reorganized by the reorganizing means in accordance with the update history information held in the holding means.

【0011】[0011]

【実施例】次に、本発明の一実施例について図面を参照
して説明する。
[Embodiment] Next, an embodiment of the present invention will be described with reference to the drawings.

【0012】図1は本発明の一実施例の構成を示すブロ
ック図である。図において、ホスト計算機1はデータベ
ース処理装置2と、アプリケーションプログラム3と、
オペレーション受付け装置5とから構成されている。デ
ータベース処理装置2には主データベースファイル13
と副データベースファイル14と再編成中履歴ファイル
15と二次記憶装置16と履歴ファイル19とが夫々接
続されており、またオペレーション受付け装置5にはコ
ンソール入出力装置4が接続されている。
FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention. In the figure, a host computer 1 includes a database processing device 2, an application program 3,
It is composed of an operation reception device 5. The database processing device 2 has a main database file 13.
, a secondary database file 14 , a reorganization history file 15 , a secondary storage device 16 , and a history file 19 are connected, respectively, and a console input/output device 4 is connected to the operation reception device 5 .

【0013】データベース処理装置2はデータベース処
理機構6とデータベースファイル再編成機構7とから構
成されている。データベースファイル再編成機構7は再
編成管理部8と、データベースファイルセーブ部9と、
データベースファイル再編成部10と、再編成中更新履
歴出力部11と、再編成後ファイル更新部12と、副フ
ァイル作成部17と、副ファイル更新部18とから構成
されている。
The database processing device 2 is composed of a database processing mechanism 6 and a database file reorganization mechanism 7. The database file reorganization mechanism 7 includes a reorganization management section 8, a database file save section 9,
It is composed of a database file reorganization section 10, an update history output section 11 during reorganization, a post-reorganization file update section 12, a subfile creation section 17, and a subfile update section 18.

【0014】図2は図1の再編成中履歴ファイル15の
構成を示す図である。図において、再編成中履歴ファイ
ル15の各レコード15−1〜15−nはレコード識別
子15aと更新種別15bとデータ部15cとから構成
されている。これら図1および図2を用いて本発明の一
実施例の動作について説明する。
FIG. 2 is a diagram showing the structure of the reorganization history file 15 of FIG. 1. In the figure, each record 15-1 to 15-n of the reorganization history file 15 is composed of a record identifier 15a, an update type 15b, and a data section 15c. The operation of one embodiment of the present invention will be explained using FIGS. 1 and 2. FIG.

【0015】まず、二重化されているシステムについて
以下説明する。通常運用時にアプリケーションプログラ
ム3からデータベースファイルに対する更新要求が発行
されると、データベース処理装置2のデータベース処理
機構6によって主データベースファイル13に対してデ
ータの更新が行われる。このとき同時に、データベース
処理機構6は副データベースファイル14に対してもデ
ータの更新を行う。
First, a duplex system will be explained below. When the application program 3 issues an update request to the database file during normal operation, the database processing mechanism 6 of the database processing device 2 updates the data in the main database file 13. At this time, the database processing mechanism 6 also updates data in the sub database file 14.

【0016】オペレータからコンソール入出力装置4を
介してオペレーション受付け装置5に再編成要求が発行
されると、オペレーション受付け装置5はその再編成要
求をデータベース処理装置2に通知する。データベース
処理装置2は再編成要求を受取ると、データベースファ
イル再編成機構7の再編成管理部8においてその要求を
受付ける。
When an operator issues a reorganization request to the operation receiving device 5 via the console input/output device 4, the operation receiving device 5 notifies the database processing device 2 of the reorganization request. When the database processing device 2 receives a reorganization request, the reorganization management section 8 of the database file reorganization mechanism 7 accepts the request.

【0017】再編成管理部8はその要求を受付けると、
データベース処理機構6に対して副データベースファイ
ル14への更新を停止させるとともに、再編成中の履歴
情報を出力するよう要求を出力する。データベース処理
機構6はデータベースファイル再編成機構7の再編成中
更新履歴出力部11に重複のないキーあるいはデータベ
ース処理機構6が暗黙に付加したファイル内で一意なレ
コード識別子15aと、追加や削除などの更新種別15
bと、更新データ部15cとが対となったレコード15
−1〜15−nの出力を開始する。再編成中更新履歴出
力部11はこのレコード15−1〜15−nを再編成中
履歴ファイル15に出力する。よって、再編成中履歴フ
ァイル15には副データベースファイル14の再編成が
行われるときの、主データベースファイル13の更新履
歴が記録される。
When the reorganization management unit 8 receives the request,
It makes the database processing mechanism 6 stop updating the secondary database file 14, and outputs a request to output history information during reorganization. The database processing mechanism 6 inputs a unique key or a unique record identifier 15a within the file implicitly added by the database processing mechanism 6 to the update history output unit 11 during reorganization of the database file reorganization mechanism 7, and information such as additions, deletions, etc. Update type 15
A record 15 in which b and the update data section 15c are paired
Start outputting -1 to 15-n. The reorganization update history output unit 11 outputs these records 15-1 to 15-n to the reorganization history file 15. Therefore, the update history of the main database file 13 when the sub database file 14 is reorganized is recorded in the reorganization history file 15.

【0018】データベース処理機構6から再編成管理部
8に副データベースファイル14の更新停止の応答がく
ると、再編成管理部8はデータベースファイルセーブ部
9に副データベースファイル14のデータをセーブする
よう要求を出力する。データベースファイルセーブ部9
は再編成管理部8からの要求にしたがって副データベー
スファイル14のデータを読出し、該データを二次記憶
装置16に出力する。
When a response to stop updating the secondary database file 14 is received from the database processing mechanism 6 to the reorganization management unit 8, the reorganization management unit 8 requests the database file saving unit 9 to save the data of the secondary database file 14. Output. Database file save section 9
reads data from the secondary database file 14 in accordance with a request from the reorganization management section 8 and outputs the data to the secondary storage device 16.

【0019】副データベースファイル14のデータの二
次記憶装置16へのセーブが終了すると、再編成管理部
8は二次記憶装置16にセーブしたデータによる副デー
タベースファイル14の再編成要求をデータベース再編
成部10に出力する。データベース再編成部10は再編
成管理部8からの要求にしたがって二次記憶装置16か
らデータを読込み、アクセス効率が上がるように該デー
タを整列してから副データベースファイル14に書込ん
だり、索引を再作成するなどの再編成処理を行う。
When the data of the secondary database file 14 has been saved to the secondary storage device 16, the reorganization management unit 8 sends a request for reorganization of the secondary database file 14 using the data saved to the secondary storage device 16 for database reorganization. output to section 10. The database reorganization unit 10 reads data from the secondary storage device 16 in accordance with a request from the reorganization management unit 8, arranges the data to improve access efficiency, and then writes it to the secondary database file 14 or indexes the data. Perform reorganization processing such as re-creation.

【0020】データベース再編成部10によって副デー
タベースファイル14の再編成が終了すると、再編成管
理部8は再編成後ファイル更新部12に再編成開始後の
更新イメージを反映するよう要求を出力する。再編成後
ファイル更新部12は再編成管理部8からの要求にした
がって再編成中履歴ファイル15からレコード15−1
〜15−nを順次読出し、レコード15−1〜15−n
中のレコード識別子15aおよび更新種別15bにした
がって、レコード15−1〜15−n中のデータ部15
cによって再編成後の副データベースファイル14を更
新していく。
When the database reorganization unit 10 completes the reorganization of the secondary database file 14, the reorganization management unit 8 outputs a request to the post-reorganization file update unit 12 to reflect the updated image after the start of reorganization. The post-reorganization file update unit 12 updates record 15-1 from the reorganization history file 15 in accordance with a request from the reorganization management unit 8.
~15-n sequentially, records 15-1 to 15-n
Data section 15 in records 15-1 to 15-n according to record identifier 15a and update type 15b therein.
The reorganized secondary database file 14 is updated by c.

【0021】副データベースファイル14の更新が主デ
ータベースファイル13の更新に追付いた時点で、再編
成後ファイル更新部12から再編成管理部8にその旨が
通知される。再編成管理部8は再編成後ファイル更新部
12からの通知を受けると、更新データベースファイル
切替えの要求をデータベース処理機構6に発行する。デ
ータベース処理機構6は再編成管理部8からの要求にし
たがって、それ以降更新するデータベースファイルを主
データベースファイル13から副データベースファイル
14に切替える。このとき、再編成中履歴ファイル15
へのデータ出力は継続して行われる。
When the update of the secondary database file 14 catches up with the update of the main database file 13, the post-reorganization file update section 12 notifies the reorganization management section 8 of this fact. When the reorganization management section 8 receives the notification from the post-reorganization file update section 12, it issues a request for switching the updated database file to the database processing mechanism 6. In response to a request from the reorganization management unit 8, the database processing mechanism 6 switches the database file to be updated thereafter from the main database file 13 to the sub database file 14. At this time, the reorganization history file 15
Data output to continues.

【0022】データベース処理機構6から再編成管理部
8に更新データベースファイル切替え完了が通知される
と、再編成管理部8はデータベースファイル再編成部1
0に主データベースファイル13の再編成要求を出力す
る。データベースファイル再編成部10は再編成管理部
8からの要求にしたがって、上述の再編成処理と同様に
して、二次記憶装置16から読込んだデータを整列して
主データベースファイル13に書込んだり、索引を再作
成するなどの再編成処理を行う。
When the database processing mechanism 6 notifies the reorganization management unit 8 of the completion of switching the updated database file, the reorganization management unit 8 updates the database file reorganization unit 1.
A reorganization request for the main database file 13 is output to 0. In accordance with a request from the reorganization management unit 8, the database file reorganization unit 10 arranges the data read from the secondary storage device 16 and writes it to the main database file 13 in the same manner as the reorganization processing described above. , perform reorganization processing such as rebuilding indexes.

【0023】データベース再編成部10によって主デー
タベースファイル13の再編成が終了すると、再編成管
理部8は再編成後ファイル更新部12に再編成開始後の
更新イメージを反映するよう要求を出力する。再編成後
ファイル更新部12は再編成管理部8からの要求にした
がって再編成中履歴ファイル15からレコード15−1
〜15−nを順次読出し、レコード15−1〜15−n
中のレコード識別子15aおよび更新種別15bにした
がって、レコード15−1〜15−n中のデータ部15
cによって再編成後の主データベースファイル13を更
新していく。
When the database reorganization unit 10 completes the reorganization of the main database file 13, the reorganization management unit 8 outputs a request to the post-reorganization file update unit 12 to reflect the updated image after the start of reorganization. The post-reorganization file update unit 12 updates record 15-1 from the reorganization history file 15 in accordance with a request from the reorganization management unit 8.
~15-n sequentially, records 15-1 to 15-n
Data section 15 in records 15-1 to 15-n according to record identifier 15a and update type 15b therein.
The reorganized main database file 13 is updated by c.

【0024】主データベースファイル13の更新が副デ
ータベースファイル14の更新に追付いたとき、主デー
タベースファイル13および副データベースファイル1
4の内容がまったく同一になる。この時点で、再編成後
ファイル更新部12から再編成管理部8にその旨が通知
される。再編成管理部8は再編成後ファイル更新部12
からの通知を受けると、更新データベースファイル切替
えの要求をデータベース処理機構6に発行する。データ
ベース処理機構6は再編成管理部8からの要求にしたが
って、それ以降更新するデータベースファイルを副デー
タベースファイル14から主データベースファイル13
に切替える。これによって、主データベースファイル1
3および副データベースファイル14の動的再編成処理
が終了する。
When the update of the main database file 13 catches up with the update of the sub database file 14, the main database file 13 and the sub database file 1
The contents of 4 are exactly the same. At this point, the post-reorganization file update unit 12 notifies the reorganization management unit 8 of this fact. The reorganization management unit 8 is a post-reorganization file update unit 12
Upon receiving the notification from , it issues a request for switching the updated database file to the database processing mechanism 6 . In accordance with a request from the reorganization management unit 8, the database processing mechanism 6 transfers the database files to be updated thereafter from the secondary database file 14 to the main database file 13.
Switch to. This allows the main database file 1
The dynamic reorganization processing of 3 and the secondary database file 14 ends.

【0025】この後、副データベースファイル14は再
編成前のように補助としてデータベース処理機構6によ
って主データベースファイル13と同時に更新される。
Thereafter, the secondary database file 14 is updated simultaneously with the main database file 13 by the auxiliary database processing mechanism 6 as before the reorganization.

【0026】次に、二重化されていないシステムについ
て以下説明する。通常運用時にアプリケーションプログ
ラム3からデータベースファイルに対する更新要求が発
行されると、データベース処理装置2のデータベース処
理機構6によって主データベースファイル13に対して
データの更新が行われる。このとき同時に、データベー
ス処理機構6は更新の記録を逐一履歴ファイル19に出
力する。
Next, a non-duplex system will be explained below. When the application program 3 issues an update request to the database file during normal operation, the database processing mechanism 6 of the database processing device 2 updates the data in the main database file 13. At the same time, the database processing mechanism 6 outputs update records one by one to the history file 19.

【0027】オペレータからコンソール入出力装置4を
介してオペレーション受付け装置5に再編成要求が発行
されると、オペレーション受付け装置5はその再編成要
求をデータベース処理装置2に通知する。データベース
処理装置2は再編成要求を受取ると、データベースファ
イル再編成機構7の再編成管理部8においてその要求を
受付ける。
When an operator issues a reorganization request to the operation receiving device 5 via the console input/output device 4, the operation receiving device 5 notifies the database processing device 2 of the reorganization request. When the database processing device 2 receives a reorganization request, the reorganization management section 8 of the database file reorganization mechanism 7 accepts the request.

【0028】再編成管理部8はその要求を受付けると、
副ファイル作成部17に対して副データベースファイル
の作成要求を出力する。副ファイル作成部17は再編成
管理部8からの要求にしたがって二次記憶装置16から
前回セーブしたデータを読込み、副データベースファイ
ル14を作成する。また、副ファイル作成部17が副デ
ータベースファイル14の作成を終了すると、再編成管
理部8は副ファイル更新部18に対して副データベース
ファイル14の更新要求を出力する。副ファイル更新部
18は再編成管理部8からの要求にしたがって履歴ファ
イル19から更新の記録を読込み、二次記憶装置16に
前回データをセーブした以降に更新された更新イメージ
を副データベースファイル14に出力することによって
、副データベース14を主データベースファイル13と
同一イメージにして一時的にデータベースファイルを二
重化する。
[0028] When the reorganization management unit 8 receives the request,
A sub database file creation request is output to the sub file creation unit 17. The secondary file creation unit 17 reads the previously saved data from the secondary storage device 16 in accordance with a request from the reorganization management unit 8, and creates the secondary database file 14. Furthermore, when the sub-file creation unit 17 finishes creating the sub-database file 14, the reorganization management unit 8 outputs a request to update the sub-database file 14 to the sub-file update unit 18. The secondary file update unit 18 reads the update record from the history file 19 in accordance with a request from the reorganization management unit 8, and stores the updated image that has been updated since the last time the data was saved in the secondary storage device 16 into the secondary database file 14. By outputting, the secondary database 14 is made into the same image as the main database file 13, thereby temporarily duplicating the database file.

【0029】次に、再編成管理部8はデータベース処理
機構6に対して副データベースファイル14への更新を
停止させる。このとき、副ファイル更新部18が副デー
タベースファイル14を更新していれば、再編成管理部
8は副ファイル更新部18に停止要求を出力する。副フ
ァイル更新部18では再編成管理部8からの要求にした
がって、再編成開始時以降に行われた主データベースフ
ァイル13に対する更新の副データベースファイル14
への反映が停止される。
Next, the reorganization management unit 8 causes the database processing mechanism 6 to stop updating the secondary database file 14. At this time, if the secondary file updating unit 18 is updating the secondary database file 14, the reorganization management unit 8 outputs a stop request to the secondary file updating unit 18. In accordance with a request from the reorganization management unit 8, the sub file update unit 18 updates the sub database file 14 of updates made to the main database file 13 after the start of reorganization.
reflection will be stopped.

【0030】同時に、再編成管理部8はデータベース処
理機構6に対して再編成中の履歴情報を出力するよう要
求を出力する。データベース処理機構6はデータベース
ファイル再編成機構7の再編成中更新履歴出力部11に
重複のないキーあるいはデータベース処理機構6が暗黙
に付加したファイル内で一意なレコード識別子15aと
、追加や削除などの更新種別15bと、更新データ部1
5cとが対となったレコード15−1〜15−nの出力
を開始する。再編成中更新履歴出力部11はこのレコー
ド15−1〜15−nを再編成中履歴ファイル15に出
力する。
At the same time, the reorganization management section 8 outputs a request to the database processing mechanism 6 to output history information during reorganization. The database processing mechanism 6 inputs a unique key or a unique record identifier 15a within the file implicitly added by the database processing mechanism 6 to the update history output unit 11 during reorganization of the database file reorganization mechanism 7, and information such as additions, deletions, etc. Update type 15b and update data section 1
The output of records 15-1 to 15-n paired with 5c is started. The reorganization update history output unit 11 outputs these records 15-1 to 15-n to the reorganization history file 15.

【0031】データベース処理機構6から再編成管理部
8に副データベースファイル14の更新停止の応答がく
ると、あるいは副ファイル更新部18から再編成管理部
8に、再編成開始時までの履歴ファイル19の副データ
ベースファイル14への反映が終わって副データベース
ファイル14の更新を停止した旨の応答がくると、再編
成管理部8はデータベースファイルセーブ部9に副デー
タベースファイル14のデータをセーブする要求を出力
する。データベースファイルセーブ部9は再編成管理部
8からの要求にしたがって副データベースファイル14
のデータを読出し、該データを二次記憶装置16に出力
する。
When a response to stop updating the secondary database file 14 is received from the database processing mechanism 6 to the reorganization management unit 8, or from the secondary file update unit 18 to the reorganization management unit 8, the history file 19 up to the start of reorganization is sent. When the response to the effect that the update of the secondary database file 14 has been stopped after the data has been reflected in the secondary database file 14 is received, the reorganization management unit 8 sends a request to the database file save unit 9 to save the data in the secondary database file 14. Output. The database file save unit 9 saves the secondary database file 14 according to a request from the reorganization management unit 8.
, and outputs the data to the secondary storage device 16.

【0032】副データベースファイル14のデータの二
次記憶装置16へのセーブが終了すると、再編成管理部
8は二次記憶装置16にセーブしたデータによる副デー
タベースファイル14の再編成要求をデータベース再編
成部10に出力する。データベース再編成部10は再編
成管理部8からの要求にしたがって二次記憶装置16か
らデータを読込み、アクセス効率が上がるように該デー
タを整列してから副データベースファイル14に書込ん
だり、索引を再作成するなどの再編成処理を行う。
When the data of the secondary database file 14 has been saved to the secondary storage device 16, the reorganization management unit 8 requests database reorganization of the secondary database file 14 using the data saved to the secondary storage device 16. output to section 10. The database reorganization unit 10 reads data from the secondary storage device 16 in accordance with a request from the reorganization management unit 8, arranges the data to improve access efficiency, and then writes it to the secondary database file 14 or indexes the data. Perform reorganization processing such as re-creation.

【0033】データベース再編成部10によって副デー
タベースファイル14の再編成が終了すると、再編成管
理部8は再編成後ファイル更新部12に再編成開始後の
更新イメージを反映するよう要求を出力する。再編成後
ファイル更新部12は再編成管理部8からの要求にした
がって再編成中履歴ファイル15からレコード15−1
〜15−nを順次読出し、レコード15−1〜15−n
中のレコード識別子15aおよび更新種別15bにした
がって、レコード15−1〜15−n中のデータ部15
cによって再編成後の副データベースファイル14を更
新していく。
When the database reorganization unit 10 completes the reorganization of the secondary database file 14, the reorganization management unit 8 outputs a request to the post-reorganization file update unit 12 to reflect the updated image after the start of reorganization. The post-reorganization file update unit 12 updates record 15-1 from the reorganization history file 15 in accordance with a request from the reorganization management unit 8.
~15-n sequentially, records 15-1 to 15-n
Data section 15 in records 15-1 to 15-n according to record identifier 15a and update type 15b therein.
The reorganized secondary database file 14 is updated by c.

【0034】副データベースファイル14の更新が主デ
ータベースファイル13の更新に追付いた時点で、再編
成後ファイル更新部12から再編成管理部8にその旨が
通知される。再編成管理部8は再編成後ファイル更新部
12からの通知を受けると、更新データベースファイル
切替えの要求をデータベース処理機構6に発行する。デ
ータベース処理機構6は再編成管理部8からの要求にし
たがって、それ以降更新するデータベースファイルを主
データベースファイル13から副データベースファイル
14に切替える。このとき、再編成中履歴ファイル15
へのデータ出力は継続して行われる。
When the update of the secondary database file 14 catches up with the update of the main database file 13, the post-reorganization file update section 12 notifies the reorganization management section 8 of this fact. When the reorganization management section 8 receives the notification from the post-reorganization file update section 12, it issues a request for switching the updated database file to the database processing mechanism 6. In response to a request from the reorganization management unit 8, the database processing mechanism 6 switches the database file to be updated thereafter from the main database file 13 to the sub database file 14. At this time, the reorganization history file 15
Data output to continues.

【0035】データベース処理機構6から再編成管理部
8に更新データベースファイル切替え完了が通知される
と、再編成管理部8はデータベースファイル再編成部1
0に主データベースファイル13の再編成要求を出力す
る。データベースファイル再編成部10は再編成管理部
8からの要求にしたがって、上述の再編成処理と同様に
して、二次記憶装置16から読込んだデータを整列して
主データベースファイル13に書込んだり、索引を再作
成するなどの再編成処理を行う。
When the database processing mechanism 6 notifies the reorganization management unit 8 of the completion of switching the updated database file, the reorganization management unit 8 updates the database file reorganization unit 1.
A reorganization request for the main database file 13 is output to 0. In accordance with a request from the reorganization management unit 8, the database file reorganization unit 10 arranges the data read from the secondary storage device 16 and writes it to the main database file 13 in the same manner as the reorganization processing described above. , perform reorganization processing such as rebuilding indexes.

【0036】データベース再編成部10によって主デー
タベースファイル13の再編成が終了すると、再編成管
理部8は再編成後ファイル更新部12に再編成開始後の
更新イメージを反映するよう要求を出力する。再編成後
ファイル更新部12は再編成管理部8からの要求にした
がって再編成中履歴ファイル15からレコード15−1
〜15−nを順次読出し、レコード15−1〜15−n
中のレコード識別子15aおよび更新種別15bにした
がって、レコード15−1〜15−n中のデータ部15
cによって再編成後の主データベースファイル13を更
新していく。
When the database reorganization unit 10 completes the reorganization of the main database file 13, the reorganization management unit 8 outputs a request to the post-reorganization file update unit 12 to reflect the updated image after the start of reorganization. The post-reorganization file update unit 12 updates record 15-1 from the reorganization history file 15 in accordance with a request from the reorganization management unit 8.
~15-n sequentially, records 15-1 to 15-n
Data section 15 in records 15-1 to 15-n according to record identifier 15a and update type 15b therein.
The reorganized main database file 13 is updated by c.

【0037】主データベースファイル13の更新が副デ
ータベースファイル14の更新に追付いたとき、主デー
タベースファイル13および副データベースファイル1
4の内容がまったく同一になる。この時点で、再編成後
ファイル更新部12から再編成管理部8にその旨が通知
される。再編成管理部8は再編成後ファイル更新部12
からの通知を受けると、更新データベースファイル切替
えの要求をデータベース処理機構6に発行する。データ
ベース処理機構6は再編成管理部8からの要求にしたが
って、それ以降更新するデータベースファイルを副デー
タベースファイル14から主データベースファイル13
に切替える。これによって、主データベースファイル1
3および副データベースファイル14の動的再編成処理
が終了する。
When the update of the main database file 13 catches up with the update of the sub database file 14, the main database file 13 and the sub database file 1
The contents of 4 are exactly the same. At this point, the post-reorganization file update unit 12 notifies the reorganization management unit 8 of this fact. The reorganization management unit 8 is a post-reorganization file update unit 12
Upon receiving the notification from , it issues a request for switching the updated database file to the database processing mechanism 6 . In accordance with a request from the reorganization management unit 8, the database processing mechanism 6 transfers the database files to be updated thereafter from the secondary database file 14 to the main database file 13.
Switch to. This allows the main database file 1
The dynamic reorganization processing of 3 and the secondary database file 14 ends.

【0038】この後、副データベースファイル14は次
回の再編成処理のためにデータベースファイルセーブ部
9によってそのデータが二次記憶装置16に出力されて
から解放される。
Thereafter, the data of the secondary database file 14 is outputted to the secondary storage device 16 by the database file save section 9 for the next reorganization process, and then released.

【0039】尚、副データベース14が副ファイル作成
部17によって作成されてから、副ファイル更新部18
によって主データベースファイル13と同一イメージに
されたときに、データベース処理機構6によってデータ
ベースファイルの切替えを行うことによって、主データ
ベースファイル13の再編成を先に行うことも可能であ
る。
Note that after the sub database 14 is created by the sub file creation section 17, the sub file update section 18
It is also possible to reorganize the main database file 13 first by switching the database file using the database processing mechanism 6 when the main database file 13 is made into the same image as the main database file 13.

【0040】このように、データベースシステムを主デ
ータベースファイル13と副データベースファイル14
とにより二重化し、それらのうち一方を用いてデータベ
ースファイルの再編成を行っているとき、他方を用いて
データベースシステムの運用を続行するとともに、その
ときの更新情報を再編成中更新履歴出力部11を介して
再編成中履歴ファイル15に保持しておき、データベー
スファイルの再編成終了後に再編成中履歴ファイル15
の更新情報を元に再編成したデータベースファイルの更
新を行うようにすることによって、運用中のデータベー
スシステムを停止することなく、データベースファイル
の再編成処理を行うことができる。
[0040] In this way, the database system is divided into the main database file 13 and the sub database file 14.
When the database file is reorganized using one of them, the database system continues to operate using the other one, and the update history output unit 11 outputs the updated information at that time. It is stored in the reorganization history file 15 via the reorganization history file 15 after the database file reorganization is completed.
By updating the reorganized database file based on the update information, the database file reorganization process can be performed without stopping the database system in operation.

【0041】また、データベースシステムの運用中にデ
ータベースファイルの再編成処理を行っているにもかか
わらず、ユーザがアクセスしているデータベースファイ
ルにはまったくI/Oをかけていないため、アプリケー
ションプログラム3に対してファイルアクセスがビジー
となったり、デッドロックとなったりすることはない。 よって、ユーザのアプリケーションプログラムに悪影響
を与えることなく、処理速度を落とすこともない。すな
わち、ユーザのアプリケーションプログラムの実行を阻
害したり、システムの処理能力を低下させることなく、
長時間運用を止められないシステムでもデータベースフ
ァイルの再編成を行うことができる。
[0041]Also, even though the database file is reorganized during operation of the database system, no I/O is performed on the database file being accessed by the user, so the application program 3 On the other hand, file access is never busy or deadlock occurs. Therefore, the user's application program is not adversely affected and the processing speed is not reduced. In other words, without interfering with the execution of user application programs or reducing system processing capacity,
Database files can be reorganized even in systems where operation cannot be stopped for a long time.

【0042】[0042]

【発明の効果】以上説明したように本発明によれば、デ
ータベースシステムのデータベースファイルを二重化し
、それらのうち一方を用いてデータベースファイルの再
編成を行っているとき、他方を用いてデータベースシス
テムの運用を続行するとともに、そのときの更新情報を
保持しておき、データベースファイルの再編成終了後に
保持された更新情報を元に再編成したデータベースファ
イルの更新を行うようにすることによって、ユーザのア
プリケーションプログラムの実行を阻害したり、システ
ムの処理能力を低下させることなく、長時間運用を止め
られないシステムでもデータベースファイルの再編成を
行うことができるという効果がある。
As explained above, according to the present invention, when the database files of a database system are duplicated and one of them is used to reorganize the database file, the other one is used to reorganize the database file. By continuing the operation, retaining the updated information at that time, and updating the reorganized database file based on the updated information after the database file reorganization is completed, the user application This has the effect that database files can be reorganized even in systems that cannot be stopped for long periods of time without interfering with program execution or reducing system processing capacity.

【図面の簡単な説明】[Brief explanation of the drawing]

【図1】本発明の一実施例の構成を示すブロック図であ
る。
FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention.

【図2】図1の再編成中履歴ファイルの構成を示す図で
ある。
FIG. 2 is a diagram showing the structure of the reorganization history file in FIG. 1;

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

1  ホスト計算機 2  データベース処理装置 6  データベース処理機構 7  データベースファイル再編成機構8  再編成管
理部 9  データベースファイルセーブ部 10  データベースファイル再編成部11  再編成
中更新履歴出力部 12  再編成後ファイル更新部 13  主データベースファイル 14  副データベースファイル 15  再編成中履歴ファイル 16  二次記憶装置 17  副ファイル作成部 18  副ファイル更新部 19  履歴ファイル
1 Host computer 2 Database processing device 6 Database processing mechanism 7 Database file reorganization mechanism 8 Reorganization management section 9 Database file save section 10 Database file reorganization section 11 Update history output section during reorganization 12 Post-reorganization file update section 13 Main Database file 14 Sub-database file 15 Reorganization history file 16 Secondary storage device 17 Sub-file creation section 18 Sub-file update section 19 History file

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】  同一データのファイルを夫々格納する
第1および第2のデータベースファイルと、前記第1お
よび第2のデータベースファイルの再編成時に前記第1
および第2のデータベースファイルのうち一方をデータ
ベースシステムから切離す切離し手段と、前記切離し手
段によって前記データベースシステムから切離されたデ
ータベースファイルの内容を二次記憶装置に格納するデ
ータベースセーブ手段と、前記二次記憶装置に格納され
た内容を基にデータベースファイルの内容を再編成する
再編成手段と、前記再編成手段によるデータベースファ
イルの再編成時に他方のデータベースファイルに対する
更新履歴情報を保持する保持手段と、前記再編成手段に
よって再編成されたデータベースファイルの内容を前記
保持手段に保持された前記更新履歴情報にしたがって更
新する更新手段とを設けたことを特徴とするデータベー
ス処理装置。
1. First and second database files that store files of the same data, respectively; and when the first and second database files are reorganized, the first
and a detaching means for detaching one of the second database files from the database system; a database saving means for storing the contents of the database file detached from the database system by the detaching means in a secondary storage device; a reorganization means for reorganizing the contents of the database file based on the contents stored in the second storage device; a holding means for retaining update history information for the other database file when the database file is reorganized by the reorganization means; A database processing apparatus comprising: an updating means for updating the contents of the database file reorganized by the reorganizing means in accordance with the update history information held in the holding means.
【請求項2】  第1のデータベースファイルの再編成
時に前記第1のデータベースファイルと同一データのフ
ァイルを格納する第2のデータベースファイルを作成す
る作成手段と、前記第1のデータベースファイルの再編
成時に前記第1および第2のデータベースファイルのう
ち一方を前記データベースシステムから切離す切離し手
段と、前記切離し手段によって前記データベースシステ
ムから切離されたデータベースファイルの内容を二次記
憶装置に格納するデータベースセーブ手段と、前記二次
記憶装置に格納された内容を基にデータベースファイル
の内容を再編成する再編成手段と、前記再編成手段によ
るデータベースファイルの再編成時に他方のデータベー
スファイルに対する更新履歴情報を保持する保持手段と
、前記再編成手段によって再編成されたデータベースフ
ァイルの内容を前記保持手段に保持された前記更新履歴
情報にしたがって更新する更新手段とを設けたことを特
徴とするデータベース処理装置。
2. Creation means for creating a second database file storing a file with the same data as the first database file when reorganizing the first database file; and when reorganizing the first database file. a detaching means for detaching one of the first and second database files from the database system; and a database saving means for storing the contents of the database file detached from the database system by the detaching means in a secondary storage device. and a reorganization means for reorganizing the contents of the database file based on the contents stored in the secondary storage device, and retaining update history information for the other database file when the database file is reorganized by the reorganization means. A database processing device comprising: a holding means; and an updating means for updating the contents of the database file reorganized by the reorganizing means in accordance with the update history information held in the holding means.
JP3036845A 1991-02-06 1991-02-06 Data base processor Pending JPH04255040A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3036845A JPH04255040A (en) 1991-02-06 1991-02-06 Data base processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3036845A JPH04255040A (en) 1991-02-06 1991-02-06 Data base processor

Publications (1)

Publication Number Publication Date
JPH04255040A true JPH04255040A (en) 1992-09-10

Family

ID=12481100

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3036845A Pending JPH04255040A (en) 1991-02-06 1991-02-06 Data base processor

Country Status (1)

Country Link
JP (1) JPH04255040A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007026062A (en) * 2005-07-15 2007-02-01 Univ Of Tokyo Reorganization method and system for database

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007026062A (en) * 2005-07-15 2007-02-01 Univ Of Tokyo Reorganization method and system for database

Similar Documents

Publication Publication Date Title
KR930008684B1 (en) Data base backup method
US5787304A (en) Multipath I/O storage systems with multipath I/O request mechanisms
JP2000347917A (en) Method for controlling data duplex operation and duplicated storage subsystem
US7225206B2 (en) System and method for reorganizing stored data
US7421456B2 (en) Method and system for data processing with database reorganization for the same
JPH07152498A (en) Information processing system
JP3378594B2 (en) Processing unit that performs database relocation
JPH10289217A (en) Log stream management system
EP0097239B1 (en) Method and apparatus for restoring data in a computing system
JPH04255040A (en) Data base processor
JP2545436B2 (en) Distributed database commitment processor
JPH0789334B2 (en) Database management processing method
EP0096199A2 (en) Method and apparatus for logging journal data in a computing apparatus
JPH1185594A (en) Information processing system for remote copy
JP3330006B2 (en) Network system including information storage system, input system of the system, and
JP2666426B2 (en) Duplex auxiliary storage device
JP2912657B2 (en) File access processor
KR100199268B1 (en) T-tree index structure retrieval in dbms
JPH05151037A (en) Reorganization processing system for database in business processing
JPH1198448A (en) Video server system and access processing method therefor
JPH07146809A (en) Information processor
JPH0346033A (en) Data transfer control method for inter-job
JP2004302919A (en) Replication system and program therefor
JPH01180651A (en) Commit synchronization control system for report file output
JPH01189741A (en) Journal output system