JPH07101393B2 - Reorganization method - Google Patents
Reorganization methodInfo
- Publication number
- JPH07101393B2 JPH07101393B2 JP63269945A JP26994588A JPH07101393B2 JP H07101393 B2 JPH07101393 B2 JP H07101393B2 JP 63269945 A JP63269945 A JP 63269945A JP 26994588 A JP26994588 A JP 26994588A JP H07101393 B2 JPH07101393 B2 JP H07101393B2
- Authority
- JP
- Japan
- Prior art keywords
- storage unit
- reorganization
- data
- unit
- records
- 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.)
- Expired - Lifetime
Links
- 230000008521 reorganization Effects 0.000 title claims description 75
- 238000000034 method Methods 0.000 title claims description 21
- 230000008569 process Effects 0.000 claims description 13
- 238000010586 diagram Methods 0.000 description 5
- 230000004913 activation Effects 0.000 description 3
- 230000003213 activating effect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000008520 organization Effects 0.000 description 2
- 206010011469 Crying Diseases 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 238000009940 knitting Methods 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明は電子計算機システムのデータベースシステムに
おけるデータの再編成方式に関するものである。The present invention relates to a data reorganization method in a database system of an electronic computer system.
データベースシステムにおいては、データをデータレコ
ードとしてデータファイル内に格納してあり、データレ
コードとしては、通常、検索する際のキー値となる検索
キーを定義してある索引レコードと、索引レコードを介
してアクセスされるバイアレコードとがある。また、一
般に、データファイルは複数の格納単位から構成されて
いる。In a database system, data is stored in a data file as a data record, and as a data record, an index record that defines a search key that is a key value for a search is usually used. There is a via record that is accessed. Further, generally, the data file is composed of a plurality of storage units.
ところで、いったん所定の規則に基づいて編成されたデ
ータファイルであっても、その後の事情により他の規則
(例えば、各格納単位における索引レコードの数に制限
がなかったデータファイルを、各格納単位における索引
レコードの数を所定の数に制限する如き。)に基づいた
データファイルに編成し直す必要が生じることがしばし
ばあり、従来は第7図に示すような構成により再編成を
行っていた。By the way, even if a data file is once organized according to a predetermined rule, another rule (for example, a data file in which the number of index records in each storage unit is not limited by It is often necessary to reorganize into a data file based on (for example, limiting the number of index records to a predetermined number). Conventionally, reorganization was performed by the configuration shown in FIG.
すなわち、第7図において、再編成手段2′はデータフ
ァイル読込み手段4′を起動することによりデータファ
イル1′から全てのデータレコードを一括してメモリ
5′に読み込み、その後、再編成手段2′はデータファ
イル作成手段6′を起動し、新たな規則に基づく編成を
行わせてデータファイル1′にデータレコードを格納す
るものであった。That is, in FIG. 7, the reorganizing means 2'reads all the data records from the data file 1'into the memory 5'by activating the data file reading means 4 ', and then the reorganizing means 2'. Is to activate the data file creating means 6'to perform the organization based on the new rule and store the data record in the data file 1 '.
上述したように、従来の再編成方式ではデータファイル
全体を一括して再編成するようにしていたため、その処
理を行っている間はデータファイルを占有する必要があ
り、データベースシステムを一時的に停止しなければな
らず、データベースシステムの利用者に対して大きな影
響を与えるという欠点があった。特に、近年のデータベ
ースの巨大化に伴って再編成に要する時間も増し、上記
の欠点が一層深刻となっていた。As described above, in the conventional reorganization method, the entire data file is reorganized in a batch, so it is necessary to occupy the data file during the processing, and the database system is temporarily stopped. However, there is a drawback that it has a great impact on the users of the database system. In particular, the time required for reorganization has increased with the enormous growth of databases in recent years, and the above-mentioned drawbacks have become more serious.
本発明は上記の点に鑑み提案されたものであり、その目
的とするところは、データファイル全体を占有すること
なく、サービスの定価を最小限にとどめて再編成を行う
ことのできる再編成方式を提供することである。The present invention has been proposed in view of the above points, and an object thereof is a reorganization method capable of performing reorganization while keeping a fixed price of a service to a minimum without occupying an entire data file. Is to provide.
本発明は上記の目的を達成するため、索引レコードとバ
イアレコードとを含む複数の格納単位から構成されるデ
ータファイルに対して、個々の格納単位に含まれる索引
レコードの数ができるだけ所定個数と一致するように再
編成を行う方式において、 起動を待って部分再編成対象となる格納単位内のデータ
レコードを一括してメモリ上に読み込む格納単位読込み
手段と、 起動を待ってメモリ上に読み込まれたデータレコードか
ら、索引レコードの数が前記所定個数と一致する新たな
格納単位を再作成し、索引レコードの数が前記所定個数
に満たない格納単位は最大1つ再作成する格納単位作成
手段と、 起動を待って部分再編成対象となる格納単位内のデータ
レコードを占有状態にしてその格納単位に対し前記格納
単位読込み手段および前記格納単位作成手段を起動して
前記データファイルを部分的に再編成した後に前記格納
単位作成手段で再作成された格納単位内のデータレコー
ドの占有状態を解除する部分再編成手段と、 前記データファイル内の格納単位に対して順次に部分再
編成対象とする格納単位を定めて前記部分再編集手段を
起動し、索引レコードの数が前記所定個数に満たない格
納単位が再作成された場合にはその格納単位と他の格納
単位との部分再編成対象となる格納単位に定めて前記部
分再編成手段を起動し、前記データファイル内の全ての
格納単位の索引レコード数が前記所定個数と一致する
か、または1つの格納単位だけが前記所定個数に満たな
い索引レコード格納数となり且つそれ以外の全ての格納
単位の索引レコード格納数が前記所定個数と一致する
と、再編成処理を終了する再編成手段とを備えている。In order to achieve the above-mentioned object, the present invention has a data file composed of a plurality of storage units including an index record and a via record, and the number of index records included in each storage unit matches the predetermined number as much as possible. In the method of performing reorganization as described above, a storage unit reading unit that waits for startup and reads the data records in the storage unit that is the target of partial reorganization into the memory at once, and a unit that reads data records in the memory after starting Storage unit creation means for recreating a new storage unit in which the number of index records matches the predetermined number from the data records, and recreating at most one storage unit in which the number of index records does not reach the predetermined number; Waiting for activation, the data record in the storage unit to be partially reorganized is placed in an occupied state, and the storage unit reading means and the storage unit are stored in the storage unit. Partial reorganization means for activating the delivery unit creation means to partially reorganize the data file and then releasing the occupied state of the data record in the storage unit recreated by the storage unit creation means; and the data file When the storage unit to be partially reorganized is sequentially determined for the storage units in the table and the partial reediting means is activated, and a storage unit in which the number of index records does not reach the predetermined number is recreated, The partial reorganization means is activated by setting the storage unit to be a partial reorganization target of the storage unit and another storage unit, and the number of index records of all the storage units in the data file matches the predetermined number. Alternatively, if only one storage unit has the number of stored index records that is less than the predetermined number and the number of stored index records of all other storage units matches the predetermined number, And a reorganization unit to terminate the knitting process.
本発明の再編成方式にあっては、再編成手段がデータフ
ァイル内の格納単位に対して順次に部分再編成対象とす
る格納単位を定めて部分再編成手段を起動し、部分再編
成手段は部分再編成対象となる格納単位内のデータレコ
ードを占有状態にすることによりそれらの格納単位内の
データレコードに対する利用者のアクセスを禁止して、
それらの格納単位に対し格納単位読込み手段を起動して
格納単位のデータレコードを一括してメモリ上に読み込
ませ、次いで格納単位作成手段を起動してメモリ上に読
み込まれたデータレコードから、索引レコードの数が所
定個数と一致する新たな格納単位を再作成させてデータ
ファイルを部分的に再編成した後、この再作成された格
納単位内のデータレコードの占有状態を解除して利用者
からのアクセスを可能とさせる。再編成手段は、このよ
うな部分的再編成を、データファイル内の全ての格納単
位の索引レコード数が所定個数と一致するか、または1
つの格納単位だけが所定個数に満たない索引レコード格
納数となり且つそれ以外の全ての格納単位の索引レコー
ド格納数が所定個数と一致するまで繰り返す。なお、再
編成手段は、部分再編成手段により索引レコードの数が
所定個数に満たない格納単位が再作成された場合にはそ
の格納単位と他の格納単位とを部分再編成対象となる格
納単位に定めて部分再編成手段を起動する。According to the reorganization method of the present invention, the reorganization unit sequentially determines the storage units to be subjected to the partial reorganization with respect to the storage units in the data file, and activates the partial reorganization unit. By occupying the data records in the storage unit that is the target of partial reorganization, prohibiting the user's access to the data records in those storage units,
For those storage units, the storage unit reading means is activated to collectively read the data records of the storage units into the memory, and then the storage unit creating means is activated to extract the index records from the data records read into the memory. After recreating a new storage unit whose number matches the specified number and partially reorganizing the data file, release the occupied state of the data record in this recreated storage unit and Allow access. The reorganization means performs such partial reorganization when the number of index records of all storage units in the data file matches a predetermined number, or 1
This process is repeated until only one storage unit has the number of stored index records that is less than the predetermined number and the number of stored index records of all other storage units matches the predetermined number. It should be noted that the reorganization means, when the storage unit in which the number of index records does not reach a predetermined number is recreated by the partial reorganization means, the storage unit and the other storage unit are storage units to be partially reorganized. Then, the partial reorganization means is activated.
以下、本発明の実施例につき図面を参照して説明する。 Embodiments of the present invention will be described below with reference to the drawings.
第1図は本発明の再編成方式の一実施例を示す構成図で
ある。第1図において、1は再編成の対象となるデータ
レコードを格納したデータファイルであり、第2図に示
すように複数の格納単位11から構成され、更に格納単位
11はそれぞれ複数の索引レコードaと、それらの関連付
けられた複数のバイアレコードbとを含んでいる。な
お、図では互いに関連付けられたデータレコードを実線
で結合して示してある。また、バイアレコードbはその
属する索引レコードaと同じ格納単位内の近い位置に配
置されるように管理されている。FIG. 1 is a block diagram showing an embodiment of the reorganization system of the present invention. In FIG. 1, reference numeral 1 is a data file that stores data records to be reorganized, and is composed of a plurality of storage units 11 as shown in FIG.
Each 11 contains a plurality of index records a and their associated plurality of via records b. In the figure, the data records that are associated with each other are shown connected by a solid line. Further, the via record b is managed so as to be arranged at a close position in the same storage unit as the index record a to which it belongs.
第1図において、他の構成として、再編成手段2と、部
分再編成手段3と、格納単位読込み手段4と、格納単位
作成手段6とが設けられている。なお、メモリ5は処理
を実行する電子計算機システムの主記憶である。In FIG. 1, a reorganization unit 2, a partial reorganization unit 3, a storage unit reading unit 4, and a storage unit creation unit 6 are provided as other configurations. The memory 5 is the main memory of the computer system that executes the process.
第3図、第4図および第5図はそれぞれ第1図における
再編成手段2、部分再編成手段3および格納単位作成手
段6の処理を示したフローチャートであり、再編成手段
2が適宜に部分再編成手段3を起動し、部分再編成手段
3が適宜に格納単位読込み手段4および格納単位作成手
段6を起動するようになっている。なお、格納単位読込
み手段4は、起動を待ってデータファイル1におけるい
くつかの格納単位内のデータレコードを一括してメモリ
5上に読み込むという簡単な処理であるため、フローチ
ャートとしては図示していない。FIGS. 3, 4, and 5 are flowcharts showing the processes of the reorganization unit 2, the partial reorganization unit 3, and the storage unit creation unit 6 in FIG. 1, respectively. The reorganization means 3 is activated, and the partial reorganization means 3 activates the storage unit reading means 4 and the storage unit creation means 6 as appropriate. It should be noted that the storage unit reading means 4 is a simple process of waiting for activation and reading the data records in several storage units in the data file 1 into the memory 5 all at once, and therefore is not shown as a flowchart. .
以下、各手段の動作について説明する。The operation of each means will be described below.
第5図において、格納単位作成手段6が起動されると、
予め指定された所定の規則に合う格納単位を作成するの
に充分なデータレコードがメモリ5にあるか否かをチェ
ックし(ステップ61)、ある場合にはメモリ5から格納
単位ひとつ分のデータレコードを取り出し(ステップ6
2)、所定の規則に基づいて新たな格納単位を作成し
(ステップ63)、ステップ61に戻る。また、ステップ61
で充分なデータレコードが泣い場合にはメモリ5から残
りのデータレコードを取り出し(ステップ64)、所定の
規則には基づかないが、新たな格納単位を1つ作成し
(ステップ65)、処理を終了する。In FIG. 5, when the storage unit creating means 6 is activated,
It is checked whether or not there are enough data records in the memory 5 to create a storage unit that complies with a predetermined rule specified in advance (step 61), and if there is, a data record of one storage unit from the memory 5 is checked. Take out (step 6
2) Create a new storage unit based on a predetermined rule (step 63), and return to step 61. Also, step 61
If enough data records are crying, the remaining data records are taken out from the memory 5 (step 64), one new storage unit is created (step 65), which is not based on the prescribed rule, and the process ends. To do.
第4図において、部分再編成手段3が起動されると、再
編成対象となる幾つかの格納単位について利用者からの
アクセスを禁止するためにそれらの格納単位内のデータ
レコード(索引レコードおよびバイアレコード)を占有
状態(排他状態)にして、それらの格納単位に対して格
納単位読込み手段4を起動してそれらの格納単位内のデ
ータレコードをメモリ5に読み込ませ(ステップ31)、
次いで、格納単位作成手段6を起動し、新たな格納単位
を作成させて(ステップ32)、データファイルを部分的
に再編成した後、新たに作成された格納単位内のデータ
レコードに対する前記占有状態を解除してそれらのデー
タレコードに対する利用者からのアクセスを可能にし、
処理を終了する。すなわち、上記の処理により、対象と
なった複数の格納単位について、データファイル1全体
として見れば部分的に再編成が行われる。In FIG. 4, when the partial reorganization unit 3 is activated, some data units (index records and via records) in the storage units to be reorganized in order to prohibit access from the user. The records are set in the occupied state (exclusive state), the storage unit reading means 4 is activated for these storage units, and the data records in these storage units are read into the memory 5 (step 31).
Then, the storage unit creating means 6 is activated to create a new storage unit (step 32), and after partially reorganizing the data file, the occupancy state for the data record in the newly created storage unit. To allow users to access those data records,
The process ends. That is, by the above processing, the plurality of target storage units are partially reorganized when viewed as the entire data file 1.
第3図において、再編成手段2は、データファイル1の
先頭の幾つかの格納単位に対して部分再編成手段3を起
動し(ステップ21)、その処理終了を待ってデータファ
イル1の最後までの部分再編成手段3による処理を行っ
たか否かをチェックし(ステップ22)、最後まで実行し
た場合には全ての処理を終了する。また、ステップ22に
おいて最後まで実行していない場合には、部分再編成手
段3の実行により予め指定された規則に合致しない格納
単位が作成されたか否かをチェックし(ステップ23)、
作成されていない場合はデータファイル1の次の幾つか
の格納単位に対して部分再編成手段3を起動し(ステッ
プ25)、ステップ22に戻る。また、ステップ23において
規則に合致しない格納単位が作成されたと判断された場
合には、その規則に合致しない格納単位とデータファイ
ル1の次の幾つかの格納単位とに対して部分再編成手段
3を起動し(ステップ24)、ステップ22に戻る。これら
の処理により、データファイル1全体を同時に占有する
ことなく再編成が行われる。In FIG. 3, the reorganization means 2 activates the partial reorganization means 3 for some storage units at the beginning of the data file 1 (step 21), waits for the end of the processing, and waits until the end of the data file 1. It is checked whether or not the processing by the partial reorganization means 3 has been performed (step 22), and when the processing is executed to the end, all processing is ended. If it has not been executed to the end in step 22, it is checked whether or not a storage unit that does not match the rule specified in advance has been created by the execution of the partial reorganization means 3 (step 23),
If it has not been created, the partial reorganization means 3 is started for the next several storage units of the data file 1 (step 25), and the process returns to step 22. If it is determined in step 23 that a storage unit that does not conform to the rule has been created, the partial reorganization means 3 is performed for the storage unit that does not conform to the rule and the next several storage units of the data file 1. Is started (step 24) and the process returns to step 22. By these processes, reorganization is performed without occupying the entire data file 1 at the same time.
第6図は実施例の動作によってデータファイル1の内容
がどう変化するかを具体的に示したものであり、データ
ファイル1は初めに格納単位11A,11B,11C,11Dに分割さ
れているものとする。なお、「●」で表すaは索引レコ
ード、「○」で表すbはバイアレコードである。また、
再編成する際の規則として「部分再編成手段3で同時に
処理の対象とする格納単位の数は2とし、各格納単位に
おける索引レコードaの数を2つにする。」を採用した
場合の例である。FIG. 6 specifically shows how the contents of the data file 1 are changed by the operation of the embodiment. The data file 1 is initially divided into storage units 11A, 11B, 11C, 11D. And In addition, a represented by "●" is an index record, and b represented by "○" is a via record. Also,
An example of a case in which "the number of storage units simultaneously processed by the partial reorganization unit 3 is 2 and the number of index records a in each storage unit is 2" is adopted as a rule for reorganization Is.
しかして、初めの(イ)の状態で再編成手段2が処理を
開始すると、再編成手段2はデータファイル1内の格納
単位11A,11Bに対して部分再編成手段3を起動し、部分
再編成手段3は、格納単位11A,11B内のデータレコーダ
を占有状態にして、(ロ)のように格納単位11A,11Bに
対し格納単位読込み手段4を起動して格納単位11A,11B
内のデータレコードを一括してメモリ5上に読み込み、
次いで格納単位作成手段6を起動してメモリ5上に読み
込まれたデータレコードから前述の規則に従って格納単
位を再作成し、(ハ)に示すように規則に合致した格納
単位11A′,11B′と規則に合致しない格納単位11Eとを含
むデータファイル1に再編成し、格納単位11A′,11B′1
1E内のデータレコードの占有状態を解除して、これらの
データレコードに対する利用者からのアクセスを可能と
する。Then, when the reorganization means 2 starts the processing in the state of (a) at the beginning, the reorganization means 2 activates the partial reorganization means 3 for the storage units 11A and 11B in the data file 1 to perform the partial reorganization. The organization unit 3 makes the data recorders in the storage units 11A and 11B occupied, and activates the storage unit reading unit 4 for the storage units 11A and 11B as shown in (b) to store the storage units 11A and 11B.
Read all the data records in the memory into the memory 5,
Then, the storage unit creating means 6 is activated to recreate the storage unit from the data record read on the memory 5 in accordance with the above-mentioned rule, and as shown in (C), the storage unit 11A ', 11B' conforming to the rule is obtained. Reorganized into a data file 1 containing storage units 11E that do not conform to the rules, and storage units 11A ', 11B'1
The exclusive state of the data records in 1E is released, and the user can access these data records.
ここで、格納単位11A,11Bの再編成中は、他の格納単位1
1C,11D内のデータレコードは占有状態とされていないた
め、データファイル1の利用者は格納単位11A,11Bの再
編成中においても他の格納単位11C,11D内のデータレコ
ードに対するアクセスは可能である。Here, while the storage units 11A and 11B are being reorganized, other storage units 1
Since the data records in 1C and 11D are not occupied, the user of the data file 1 can access the data records in other storage units 11C and 11D even while the storage units 11A and 11B are being reorganized. is there.
次いで再編成手段2はデータファイル1内の格納単位11
E,11Cに対して部分再編成手段3を起動し、部分再編成
手段3は、格納単位11E,11C内のデータレコードを占有
状態にして、(ニ)のように格納単位11E,11Cに対し格
納単位読込み手段4を起動して格納単位11E,11C内のデ
ータレコードを一括してメモリ5上に読み込み、次いで
格納単位作成手段6を起動してメモリ5上に読み込まれ
たデータレコードから前述の規則に従って格納単位を再
作成し、(ホ)に示すように規則に合致した格納単位11
E′,11C′を含むデータファイル1に再編成し、格納単
位11E′,11C′内のデータレコードの占有状態を解除し
て、これらのデータレコードに対する利用者からのアク
セスを可能とする。Next, the reorganization means 2 uses the storage unit 11 in the data file 1
The partial reorganization means 3 is activated for E, 11C, and the partial reorganization means 3 makes the data records in the storage units 11E, 11C occupy and for the storage units 11E, 11C as shown in (d). The storage unit reading means 4 is activated to collectively read the data records in the storage units 11E and 11C onto the memory 5, and then the storage unit creating means 6 is activated to start the above-mentioned data record from the data record read onto the memory 5. Recreate the storage unit according to the rules, and as shown in (e), the storage unit that conforms to the rules 11
The data file 1 including E'and 11C 'is reorganized, and the occupied states of the data records in the storage units 11E' and 11C 'are released so that the user can access these data records.
ここで、格納単位11E,11Cの再編成中は、他の格納単位1
1A′,11B′,11D内のデータレコードは占有状態とされて
いないため、データファイル1の利用者は格納単位11E,
11Cの再編成中においても他の格納単位11A′,11B′,11D
内のデータレコードに対するアクセスは可能である。Here, while the storage units 11E and 11C are being reorganized, other storage units 1
Since the data records in 1A ', 11B', and 11D are not occupied, the user of the data file 1 stores the storage unit 11E,
Other storage units 11A ', 11B', 11D even during reorganization of 11C
Access to the data records in is possible.
次いで、再編成手段2はデータファイル1内の格納単位
11Dに対して部分再編成手段3を起動し、部分再編成手
段3は、格納単位11D内のデータレコードを占有状態に
して、(ヘ)のように格納単位11Dに対し格納単位読込
み手段4を起動して格納単位11D内のデータレコードを
一括してメモリ5上に読み込み、次いで格納単位作成手
段6を起動してメモリ5上に読み込まれたデータレコー
ドから前述の規則に従って格納単位を再作成し、(ト)
に示すように規則に合致した格納単位11D′を含むデー
タファイル1に再編成し、格納単位11D′内のデータレ
コードの占有状態を解除して、これらのデータレコード
に対する利用者からのアクセスを可能とする。Next, the reorganization unit 2 stores the storage unit in the data file 1.
The partial reorganization means 3 is activated for 11D, and the partial reorganization means 3 sets the data record in the storage unit 11D to the occupied state, and the storage unit reading means 4 is executed for the storage unit 11D as shown in (f). Upon activation, the data records in the storage unit 11D are collectively read into the memory 5, and then the storage unit creating means 6 is activated to recreate the storage unit from the data records read into the memory 5 according to the above-mentioned rules. , (G)
As shown in, the data file 1 containing the storage unit 11D 'that conforms to the rules is reorganized, the data records in the storage unit 11D' are released from the occupied state, and the user can access these data records. And
ここで、格納単位11Dの再編成中は、他の格納単位11
A′,11B′,11E′,11C′内のデータレコードは占有状態
とされていないため、データファイル1の利用者は格納
単位11A′,11B′,11E′,11C′内のデータレコードに対
するアクセスは可能である。Here, while the storage unit 11D is being reorganized, another storage unit 11D is
Since the data records in A ', 11B', 11E ', 11C' are not occupied, the user of the data file 1 can access the data records in the storage units 11A ', 11B', 11E ', 11C'. Is possible.
そして、格納単位11Dの再編成処理が終了した時点で、
データファイル1内の全ての格納単位11A〜11Dについて
処理が終了したので、再編成処理を終了する。Then, when the reorganization processing of the storage unit 11D is completed,
Since the processing has been completed for all the storage units 11A to 11D in the data file 1, the reorganization processing is completed.
なお、第6図の例では、データファイル1の偶数個の索
引レコードが存在していた為に、再編成後の各格納単位
にそれぞれ2個の索引レコードを含ませることができ
た。しかし、データファイル1に奇数個の索引レコード
が存在していた場合には、一番最後の格納単位を部分再
編成したときに、所定個数である2個に満たない1個の
索引レコードしか含まない格納単位が作成されることに
なるが、これは致し方ないことであり、再編成手段2
は、このような規則に合致しない1つの格納単位が作成
された状態で再編成処理を終了する。In the example of FIG. 6, since there are even number of index records in the data file 1, it is possible to include two index records in each storage unit after reorganization. However, when the data file 1 has an odd number of index records, when the last storage unit is partially reorganized, only one index record that is less than the predetermined number of two is included. A storage unit that does not exist will be created, but this is inevitable and the reorganization means 2
Ends the reorganization process in the state where one storage unit that does not conform to such a rule is created.
また、部分再編成中の格納単位内のデータレコードは占
有状態にされているため、部分再編成中の格納単位内の
データレコードに対して利用者がアクセスを要求した場
合、そのアクセス要求はそのデータレコードの占有状態
が解除されるまで待たされることになる。Further, since the data record in the storage unit during the partial reorganization is in an occupied state, when the user requests access to the data record in the storage unit during the partial reorganization, the access request is It is necessary to wait until the exclusive state of the data record is released.
以上説明したように、本発明の再編成方式にあっては、
データファイルに対して部分的に再編成を行い、これを
繰り返すようにしているので、データファイル全体を同
時に占有することがなく、よってデータベースシステム
を停止させなくても再編成を行うことができ、利用者に
対するサービスの低下を最小限にとどめることができる
効果がある。As described above, in the reorganization method of the present invention,
Since the data file is partially reorganized and this process is repeated, it is possible to perform reorganization without stopping the database system without occupying the entire data file at the same time. This has the effect of minimizing the degradation of service to users.
第1図は本発明の再編成方式の一実施例を示す構成図、 第2図は第1図におけるデータファイルの論理的構成
図、 第3図は第1図における再編成手段の処理のフローチャ
ート、 第4図は第1図における部分再編成手段の処理のフロー
チャート、 第5図は第1図における格納単位作成手段の処理のフロ
ーチャート、 第6図は再編成に伴うデータファイルの変化を示す図お
よび、 第7図は従来の再編成方式の構成図である。 図において、 1……データファイル 11……格納単位 a……索引レコード b……バイアレコード 2……再編成手段 3……部分再編成手段 4……格納単位読込み手段 5……メモリ 6……格納単位作成手段FIG. 1 is a block diagram showing an embodiment of the reorganization system of the present invention, FIG. 2 is a logical block diagram of the data file in FIG. 1, and FIG. 3 is a flowchart of the processing of the reorganization means in FIG. 4, FIG. 4 is a flow chart of the processing of the partial reorganization means in FIG. 1, FIG. 5 is a flow chart of the processing of the storage unit creation means in FIG. 1, and FIG. 6 is a diagram showing the change of the data file accompanying the reorganization. And FIG. 7 is a block diagram of a conventional reorganization system. In the figure, 1 ... Data file 11 ... Storage unit a ... Index record b ... Via record 2 ... Reorganization means 3 ... Partial reorganization means 4 ... Storage unit reading means 5 ... Memory 6 ... Storage unit creation means
Claims (1)
数の格納単位から構成されるデータファイルに対して、
個々の格納単位に含まれる索引レコードの数ができるだ
け所定個数と一致するように再編成を行う方式におい
て、 起動を持って部分再編集対象となる格納単位内のデータ
レコードを一括してメモリ上に読み込む格納単位読込み
手段と、 起動を待ってメモリ上に読み込まれたデータレコードか
ら、索引レコードの数が前記所定個数と一致する新たな
格納単位を再作成し、索引レコードの数が前記所定個数
に満たない格納単位は最大1つ再作成する格納単位作成
手段と、 起動を待って部分再編成対象となる格納単位内のデータ
レコードを占有状態にしてその格納単位に対し前記格納
単位読込み手段および前記格納単位作成手段を起動して
前記データファイルを部分的に再編成した後に前記格納
単位作成手段で再作成された格納単位内のデータレコー
ドの占有状態を解除する部分再編成手段と、 前記データファイル内の格納単位に対して順次に部分再
編成対象とする格納単位を定めて前記部分再編成手段を
起動し、索引レコードの数が前記所定個数に満たない格
納単位が再編成された場合にはその格納単位と他の格納
単位とを部分再編成対象となる格納単位に定めて前記部
分再編成手段を起動し、前記データファイル内の全ての
格納単位の索引レコード数が前記所定個数と一致する
か、または1つの格納単位だけが前記所定個数に満たな
い索引レコード格納数となり且つそれ以外の全ての格納
単位の索引レコード格納数が前記所定個数と一致する
と、再編成処理を終了する再編成手段とを備えたことを
特徴とする再編成方式。1. A data file composed of a plurality of storage units including an index record and a via record,
In the method of reorganizing so that the number of index records included in each storage unit matches as much as possible to the specified number, the data records in the storage unit that is the target of partial re-editing are collectively stored on the memory at startup. A storage unit reading means for reading and a new storage unit in which the number of index records matches the above-mentioned predetermined number are recreated from the data records read on the memory after starting up, and the number of index records becomes the above-mentioned predetermined number. A storage unit creation unit that recreates a maximum of one storage unit that does not meet, a data record in the storage unit that is the target of partial reorganization after being activated, is occupied, and the storage unit reading unit and the storage unit The data unit in the storage unit recreated by the storage unit creation unit after the storage unit creation unit is activated to partially reorganize the data file A partial reorganization unit that releases the occupied state of the card, and a storage unit that is a target of the partial reorganization is sequentially defined for the storage units in the data file, and the partial reorganization unit is activated to determine the number of index records. When a storage unit of less than the predetermined number is reorganized, the storage unit and another storage unit are set as the storage unit to be the partial reorganization target, the partial reorganization means is activated, and the data file The number of index records of all the storage units in the storage unit matches the predetermined number, or only one storage unit has the number of stored index records less than the predetermined number and the number of stored index records of all other storage units And a predetermined number, the reorganization means for terminating the reorganization process.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63269945A JPH07101393B2 (en) | 1988-10-26 | 1988-10-26 | Reorganization method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63269945A JPH07101393B2 (en) | 1988-10-26 | 1988-10-26 | Reorganization method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH02116936A JPH02116936A (en) | 1990-05-01 |
| JPH07101393B2 true JPH07101393B2 (en) | 1995-11-01 |
Family
ID=17479396
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP63269945A Expired - Lifetime JPH07101393B2 (en) | 1988-10-26 | 1988-10-26 | Reorganization method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH07101393B2 (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH0488440A (en) * | 1990-07-25 | 1992-03-23 | Nec Corp | Data base reorganizing system |
| JP3378594B2 (en) * | 1992-09-25 | 2003-02-17 | 富士通株式会社 | Processing unit that performs database relocation |
| JP4683546B2 (en) * | 2005-07-15 | 2011-05-18 | 国立大学法人 東京大学 | Database reorganization method and database reorganization system |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS638950A (en) * | 1986-06-30 | 1988-01-14 | Nec Corp | Reorganizing system for hierarchical file |
| JPS63180148A (en) * | 1987-01-21 | 1988-07-25 | Fujitsu Ltd | Processing system for on-the-fly reformation of data base |
| JPS63257849A (en) * | 1987-04-16 | 1988-10-25 | Fujitsu Ltd | Reorganizing method for file in use |
| JPH0225946A (en) * | 1988-07-15 | 1990-01-29 | Casio Comput Co Ltd | File controller |
-
1988
- 1988-10-26 JP JP63269945A patent/JPH07101393B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPH02116936A (en) | 1990-05-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5535381A (en) | Apparatus and method for copying and restoring disk files | |
| US4752910A (en) | Method and apparatus for continuous after-imaging | |
| EP0369052A1 (en) | Data base access system | |
| JPH07101393B2 (en) | Reorganization method | |
| JP2539347B2 (en) | File management method | |
| US5832491A (en) | System for processing a database relocation in parallel with the execution of an application program | |
| US5978810A (en) | Data management system and method for storing a long record in a set of shorter keyed records | |
| JP2586610B2 (en) | File creation method | |
| JP2874421B2 (en) | Sort work file space management method | |
| JP2912657B2 (en) | File access processor | |
| JP3061385B2 (en) | Data management device and data management method | |
| JPH09244932A (en) | Disk array device | |
| KR100261177B1 (en) | Message handling routine | |
| JP3578501B2 (en) | Document search method and apparatus | |
| JPS593549A (en) | File management method | |
| JP2604787B2 (en) | Two-dimensional data storage method | |
| JPH0398110A (en) | Multiplex data reading system | |
| JP2546528B2 (en) | Variable-length block storage system for fixed-length sector disk | |
| CA1243126A (en) | Method and apparatus for continuous after-imaging | |
| JPH03268038A (en) | Data storing system | |
| JPH0423143A (en) | Data storing system | |
| JPH03225412A (en) | File data read system | |
| JPH048816B2 (en) | ||
| JPS62177642A (en) | File management system for postscript filing device | |
| JPS6111861A (en) | Program access control system |