JP3667953B2 - Database reorganization apparatus and computer-readable recording medium - Google Patents

Database reorganization apparatus and computer-readable recording medium Download PDF

Info

Publication number
JP3667953B2
JP3667953B2 JP26116697A JP26116697A JP3667953B2 JP 3667953 B2 JP3667953 B2 JP 3667953B2 JP 26116697 A JP26116697 A JP 26116697A JP 26116697 A JP26116697 A JP 26116697A JP 3667953 B2 JP3667953 B2 JP 3667953B2
Authority
JP
Japan
Prior art keywords
prime
area
reorganization
overflow
page
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 - Fee Related
Application number
JP26116697A
Other languages
Japanese (ja)
Other versions
JPH11102311A (en
Inventor
敏治 巽
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP26116697A priority Critical patent/JP3667953B2/en
Publication of JPH11102311A publication Critical patent/JPH11102311A/en
Application granted granted Critical
Publication of JP3667953B2 publication Critical patent/JP3667953B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

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

Description

【0001】
【発明の属する技術分野】
本発明は、プライム領域から溢れたレコードをオーバーフロー領域に格納するデータベースで用いられるデータベース再編成装置と、その実現に用いられるプログラムが記されるコンピュータ読み取り可能な記録媒体とに関し、特に、簡単な制御に従ってデータベースの効率的な再編成処理を実行できるようにするデータベース再編成装置と、その実現に用いられるプログラムが記されるコンピュータ読み取り可能な記録媒体とに関する。
【0002】
保険業務などに用いられるデータベースでは、特定の事業所などに当初想定した以上の被保険者が加入することで、特定の事業所などに大量のレコードが発生することがある。一方、データベースでは、レコードを削除し追加していくことで断片的な空き領域が生成されることになる。
【0003】
これから、データベースでは、レコードを再配置していくという再編成処理を実行する必要があるが、この再編成処理は、業務処理の遂行を妨げることなく実行する必要があるとともに、アクセス性能の向上を実現する形態で実行する必要がある。
【0004】
【従来の技術】
データベースでは、プライムページにレコードを追加していくときに、空き領域がなくなると、オーバーフローページにレコードを格納していく構成を採っている。従って、レコードが削除された後にレコードが追加されると、レコード長の関係で、プライムページやオーバーフローページに断片的な空き領域が生成されることになる。そこで、この空き領域を整理するレコード再配置処理が必要となる。
【0005】
このレコード再配置処理は、業務処理の必要とするデータベースへのアクセスを禁止することになることから、従来では、データベースの運用を停止させた状態で実行するという構成を採っている。
【0006】
しかし、それでは、レコード再配置処理を行っている間、業務処理を遂行できないという問題点がある。
そこで、本発明者は、特開平6-110743 号で、業務処理と並列する形態で、プライムページ及びオーバーフローページのレコードを一時的に退避させてから、それらのレコードを削除し、その後、退避させたレコードをプライムページからオーバーフローページへと順番に詰めて再配置していくというレコード再配置処理の発明を開示した。
【0007】
この発明では、データベースに対する業務処理のアクセス頻度が少ないときを検出して、そのときに、先頭から順番に、業務処理が排他獲得していないプライムページ及びオーバーフローページを排他獲得して、それに対してレコード再配置処理を実行することで、レコード再配置処理と業務処理との並列処理を実現するという構成を採っている。
【0008】
【発明が解決しようとする課題】
しかしながら、特開平6-110743 号で開示した発明では、データベースに対する業務処理のアクセス頻度が少なくなるときを検出して、レコード再配置処理を実行するという構成を採っていることから、複雑な制御が必要になるという問題点があった。
【0009】
すなわち、業務処理のアクセス頻度が少なくなるときを検出するための複雑な制御が必要になるという問題点があった。
更に、特開平6-110743 号で開示した発明では、プライムページにレコードを詰めていって、オーバーフローページにレコードが残るときには、それをそのままオーバーフローページに残しておくという構成を採っていることから、アクセス性能の低下を解消できないという問題点があった。
【0010】
すなわち、オーバーフローページのアクセス性能は、プライムページのアクセス性能よりも劣るので、オーバーフローページにレコードが残されることで、アクセス性能の低下を解消できないという問題点があった。
【0011】
本発明はかかる事情に鑑みてなされたものであって、簡単な制御に従ってデータベースの効率的な再編成処理を実行できるようにする新たなデータベース再編成装置の提供と、その実現に用いられるプログラムが記されるコンピュータ読み取り可能な記録媒体の提供とを目的とする。
【0012】
【課題を解決するための手段】
この目的を達成するために、本発明のデータベース再編成装置は、プライム領域から溢れたレコードをオーバーフロー領域に格納するデータベースで用いられるときにあって、(1)業務処理のアクセス時に、アクセス先のプライム領域の持つオーバーフロー領域が規定の大きさ以上であるのか否かを検出する検出手段と、(2)検出手段により規定の大きさ以上のオーバーフロー領域を持つと検出されるときに、即時モードか一括モードのどちらが設定されているのかを判断する判断手段と、(3)即時モードに設定されていることが判断される場合に、検出手段により規定の大きさ以上のオーバーフロー領域を持つと検出されたプライム領域を指定して再編成の実行を指示し、一方、一括モードに設定されていることが判断される場合に、該プライム領域の識別子を保存領域に保存する実行手段と、(4)実行手段の発行する再編成の実行指示に応答して、検出手段により規定の大きさ以上のオーバーフロー領域を持つと検出されたプライム領域の排他獲得要求を発行する発行手段と、(5)即時モードに設定されていることが判断される場合にあって、発行手段の発行に応答してプライム領域が排他獲得されるときに、該プライム領域及び対をなすオーバーフロー領域のレコードを退避させてから削除し、続いて該退避レコードを該プライム領域に再配置するとともに、そのとき入りきれないレコードについては、新たに1つ又は複数のプライム領域を作成して、そこに格納し、一方、一括モードに設定されていることが判断される場合にあって、業務処理が終了するときに、保存領域に識別子の保存されるプライム領域を処理対象として、該プライム領域及び対をなすオーバーフロー領域のレコードを退避させてから削除し、続いて該退避レコードを該プライム領域に再配置するとともに、そのとき入りきれないレコードについては、新たに1つ又は複数のプライム領域を作成して、そこに格納する再編成手段とを備えるように構成する。
この構成を採るときにあって、発行手段は、業務処理よりも低い優先度を指定しつつ、プライム領域の排他獲得要求を発行することがある。
また、発行手段は、再編成手段の処理が終了していることを条件にして、次のプライム領域の排他獲得要求を発行することがある。
また、検出手段は、先に検出したプライム領域に対する再編成処理が終了していないときには、検出処理に従って該プライム領域が規定の大きさ以上のオーバーフロー領域を持つと検出されても、それを無視するように処理することがある。
また、発行手段は、先に発行したプライム領域に対する再編成処理が終了していないときには、検出手段により該プライム領域が検出されるときにも、それを無視するように処理することがある。
ここで、本発明を実現すべく設けられる各処理手段の持つ機能は具体的にはプログラムで実現されるものであり、このプログラムは、フロッピィディスクなどに記憶されたり、サーバなどのディスクなどに記憶され、それらからインストールされてメモリ上で動作することで、本発明を実現することになる。
このように構成される本発明では、即時モードに設定されている場合には、業務処理のアクセス時に、それと同期を取って、オーバーフロー領域が大きくなるプライム領域を検出し、業務処理よりも低い優先度を指定しつつ、そのプライム領域の排他獲得を実行して、その排他獲得したプライム領域及び対をなすオーバーフロー領域を処理対象としてレコードを再配置するとともに、そのオーバーフロー領域にレコードが残るときには、新たにプライム領域を作成してそこにレコードを配置していくことで、データベースの再編成を実行する構成を採る。
そして、本発明では、一括モードに設定されている場合には、業務処理アクセスの延長でオーバーフロー領域が大きくなるプライム領域を検出すると、それらのプライム領域の識別子を保存領域に保存する構成を採って、業務処理が終了すると、それらのプライム領域を処理対象として、処理対象となるプライム領域及び対をなすオーバーフロー領域を処理対象としてレコードを再配置するとともに、そのオーバーフロー領域にレコードが残るときには、新たにプライム領域を作成してそこにレコードを配置していくことで、データ ベースの再編成を実行する構成を採る。
このようにして、本発明によれば、即時モードに設定しておくことで、業務処理のアクセスと連動させつつ、局所的なデータベースの再編成処理を実行することで、簡単な制御に従って、業務処理と並列する形態で、データベースの再編成処理を実行できるようになる。
このとき、オーバーフロー領域が残らない形態でデータベースの再編成処理を実行することから、アクセス性能の向上を実現できるデータベースの再編成処理を実行できるようになる。
そして、本発明によれば、一括モードに設定しておくことで、業務処理の終了時点に、データベースにアクセスしなくても、再編成処理の対象となるプライム領域を特定できることでデータベースの再編成処理を実行できるようになる。
このとき、オーバーフロー領域が残らない形態でデータベースの再編成処理を実行することから、アクセス性能の向上を実現できるデータベースの再編成処理を実行できるようになる。
【0029】
【発明の実施の形態】
以下、実施の形態に従って本発明を詳細に説明する。
本発明の実施例の説明に入る前に、図1に示す原理構成図に従って、即時モードに設定されているときの本発明の処理について説明する。
図1中、1は本発明を具備するデータベースシステム、2はデータベースシステム1にアクセスすることで業務処理を実行する1つ又は複数の業務プログラムである。
データベースシステム1は、データベース10と、データベース管理機構11と、検出手段12と、発行手段13と、退避領域14と、再編成手段15とを備える。
データベース10は、レコードを格納するプライム領域100と、プライム領域100から溢れたレコードを格納するオーバーフロー領域101と、プライム領域100に対応付けて設けられて、プライム領域100及び対をなすオーバーフロー領域101に格納されるレコードの持つキーを管理するページエントリータイプのインデックス102とを備える。
データベース管理機構11は、データベース10を管理するものであり、業務プログラム2の発行するアクセス要求に応答して、プライム領域100及び対をなすオーバーフロー領域101を排他獲得して、その排他獲得したプライム領域100及び対をなすオーバーフロー領域101へのアクセス処理を実行するものである。
検出手段12は、業務処理のアクセス時に、アクセス先のプライム領域100の持つオーバーフロー領域101が規定の大きさ以上であるのか否かを検出する。
発行手段13は、業務処理よりも低い優先度を指定しつつ、データベース管理機構11に対して、検出手段12により規定の大きさ以上のオーバーフロー領域101を持つと検出されるプライム領域100の排他獲得要求を発行する。
退避領域14は、再編成手段15の処理のための作業領域として用意されるものであり、プライム領域100及びオーバーフロー領域101のレコードを退避する。
再編成手段15は、発行手段13の発行処理に応答してプライム領域100が排他獲得されるときに、そのプライム領域100及び対をなすオーバーフロー領域101に対して再編成処理を実行する。
このように構成される本発明を具備するデータベースシステム1では、検出手段12は、業務処理のアクセス時に、アクセス先のプライム領域100の持つオーバーフロー領域101が規定の大きさ以上であるのか否かを検出し、この検出結果を受けて、発行手段13は、そのプライム領域100の持つオーバーフロー領域101が規定の大きさ以上であることが検出されると、データベース管理機構11に対して、業務処理よりも低い優先度を指定しつつ、そのプライム領域100の排他獲得要求を発行する。
この発行を受けて、データベース管理機構11は、業務処理の発行する排他獲得要求を優先しつつ、発行手段13の発行したプライム領域100が業務処理により排他獲得されていないときに、それを排他獲得して再編成手段15に通知する。
この通知を受けて、再編成手段15は、その排他獲得されたプライム領域100及び対をなすオーバーフロー領域101のレコードを退避領域14に退避させてから削除し、続いて、その退避領域14に退避させたレコードをそのプライム領域100に再配置するとともに、そのとき入りきれないレコードについては、新たに1つ又は複数のプライム領域100を開設してそこに格納し、そして、これらの処理に合わせて、プライム領域100対応に設けられるインデックス102を再構成することでデータベース10を再編成する。
この処理構成を採るときに、発行手段13は、再編成手段15に対する処理要求が競合しないようにするために、再編成手段15の処理が終了していることを条件にして、次のプライム領域100の排他獲得要求を発行することが好ましい。
また、この処理構成を採るときに、重複処理を排除するために、検出手段12は、先に検出したプライム領域100に対する再編成処理が終了していないときには、検出処理に従ってそのプライム領域100が規定の大きさ以上のオーバーフロー領域101を持つと 検出されても、それを無視するように処理したり、発行手段13は、先に発行したプライム領域100に対する再編成処理が終了していないときには、検出手段12によりそのプライム領域100が検出されるときにも、それを無視するように処理することが好ましい。
このように、本発明では、即時モードに設定されている場合には、業務処理のアクセス時に、それと同期を取って、オーバーフロー領域101が大きくなるプライム領域100を検出し、業務処理よりも低い優先度を指定しつつ、そのプライム領域100の排他獲得を実行して、その排他獲得したプライム領域100及び対をなすオーバーフロー領域101を処理対象としてレコードを再配置するとともに、そのオーバーフロー領域101にレコードが残るときには、新たにプライム領域100を作成してそこにレコードを配置していくことで、データベース10の再編成を実行する構成を採るのである。
次に、本発明について詳細に説明する。
図2に、本発明を具備するデータシステム1の一実施例を図示する。
【0030】
図中、10はデータベース、20はDBMS、21は再編成プログラム、22は退避領域、23は起動プログラム、24は保存ファイルである。
このデータベース10は、レコードを格納する複数のプライムページ200と、プライムページ200から溢れたレコードを格納するオーバーフローページ201と、プライムページ200に対応付けて設けられて、プライムページ200及び対をなすオーバーフローページ201に格納されるレコードの持つキーを管理するページエントリータイプのインデックス202とを備える。ここで、インデックス202は、データベース10とは別のインデックスファイルに備えられることもある。
【0031】
DBMS20は、業務プログラム2の排他獲得要求に応答して、プライムページ200及び対をなすオーバーフローページ201を排他獲得して、その排他獲得したプライムページ200及び対をなすオーバーフローページ201へのアクセス処理を実行する。
【0032】
このDBMS20は、プライムページ200にレコードを格納していくときに、プライムページ200にレコードが入りきらないときには、オーバーフローページ201にレコードを格納し、レコードを削除するときには、バリッドビットを落とすことでレコードを削除する。従って、図3に示すように、プライムページ200やオーバーフローページ201に断片的な空き領域が生成されることになる。
【0033】
再編成プログラム21は、退避領域22にレコードを退避しつつ、プライムページ200及び対をなすオーバーフローページ201に対しての再編成処理を実行する。起動プログラム23は、再編成プログラム21の起動を制御するものであり、即時に起動したり、業務処理の終了後に起動する。保存ファイル24は、起動プログラム23からの格納要求に応答して、プライムページ200のページ番号をスタックする。
【0034】
図4に、DBMS20の実行する処理フローの一実施例、図5に、起動プログラム23の実行する処理フローの一実施例、図6ないし図9に、再編成プログラム21の実行する処理フローの一実施例を図示する。次に、これらの処理フローに従って、本発明について詳細に説明する。
【0035】
先ず最初に、DBMS20が本発明を実現のために新たに実行する処理について説明する。
DBMS20は、業務プログラム2からのアクセス要求に応答してプライムページ200及び対をなすオーバーフローページ201へのアクセスを実行し、それを終了すると、新たに図4の処理フローを実行することで、業務処理中に、オーバーフローページ201の多くなったプライムページ200を検出する。
【0036】
すなわち、DBMS20は、業務処理のアクセスを終了すると、図4の処理フローに示すように、先ず最初に、ステップ1で、アクセス先のプライムページ200の持つオーバーフローページ201のページ数を検出する。
【0037】
続いて、ステップ2で、その検出したオーバーフローページ201のページ数が予め設定されている規定値を超えるのか否かを判断して、超えないことを判断するときには、そのまま処理を終了し、超えることを判断するときには、ステップ3に進んで、そのプライムページ200に対して、図示しないフラグ域に「再編成要」が記録されているのか否かを判断する。
【0038】
このステップ3で、フラグ域に「再編成要」が記録されていることを判断するときには、そのまま処理を終了し、記録されていないことを判断するときには、ステップ4に進んで、フラグ域に「再編成要」を記録してから、続くステップ5で、そのプライムページ200を起動プログラム23に通知して、処理を終了する。
【0039】
ここで、フラグ域に記録される「再編成要」の記録は、後述するように、再編成プログラム21が再編成処理を実行すると消去されることになる。従って、フラグ域に「再編成要」が記録されているということは、そのプライムページ200に対しての再編成処理が未だ実行されていないことを意味する。
【0040】
このようにして、DBMS20は、業務処理のアクセスしたプライムページ200が規定以上のオーバーフローページ201を持つときには、そのプライムページ200に対する再編成処理が終了していないことを条件にして、起動プログラム23に対して、そのプライムページ200を通知するのである。
【0041】
次に、起動プログラム23の実行する処理について説明する。
起動プログラム23は、DBMS20からプライムページ200の通知を受け取ると、図5(a)の処理フローに示すように、先ず最初に、ステップ1で、ユーザの設定する動作モード(即時に再編成処理に入ることを指示する即時モードと、業務処理の終了後に再編成処理に入ることを指示する一括モードとがある)が即時モードであるのか否かを判断して、即時モードであることを判断するときには、ステップ2に進んで、再編成プログラム21が空いているのか否かをチェックし、空いていないときには、それが空くのを待つ。
【0042】
ここで、このステップ2の処理を実行するのは、再編成プログラム21が空いていないのに、以下の処理に進むと、再編成処理を実行できないのに、プライムページ200及びオーバーフローページ201が排他獲得されてしまい、業務処理の遂行が妨げられることになるからである。
【0043】
このステップ2で、再編成プログラム21が空くことを検出すると、続いて、ステップ3で、即時モードを通知しつつ、DBMS20から通知されたプライムページ200を指定して再編成プログラム21を起動して、処理を終了する。
【0044】
一方、ステップ1で、即時モードでないことを判断するとき、すなわち、ユーザの設定する動作モードが一括モードであることを判断するときには、ステップ4に進んで、DBMS20から通知されたプライムページ200を保存ファイル24にスタックして、処理を終了する。
【0045】
また、この起動プログラム23は、業務プログラム2による業務処理が終了すると、図5(b)の処理フローに示すように、一括モードを通知しつつ、再編成プログラム21を起動する処理を実行する。
【0046】
このようにして、起動プログラム23は、DBMS20からプライムページ200の通知を受け取ると、即時モードに設定されているときには、そのプライムページ200を指定して再編成プログラム21を起動することで、再編成処理を依頼するのである。そして、一括モードに設定されているときには、そのプライムページ200を保存ファイル24にスタックし、業務処理が終了するときに、再編成プログラム21を起動することで、再編成処理を依頼するのである。
【0047】
なお、再編成プログラム21が空くのを待っている間に、次々と、DBMS20からプライムページ200が通知されることがある。このときには、起動プログラム23は、それらをキューイングする構成を採って、再編成プログラム21が空くのを待ちながら、順番に、再編成プログラム21に対して再編成処理を依頼していくことになる。
【0048】
次に、再編成プログラム21の実行する処理について説明する。
再編成プログラム21は、起動プログラム23から起動されると、図6ないし図9の処理フローを実行することで、DBMS20により検出されたプライムページ201に対する再編成処理を実行する。
【0049】
すなわち、再編成プログラム21は、起動プログラム23から起動されると、図6ないし図9の処理フローに示すように、先ず最初に、ステップ1で、起動プログラム23から通知される動作モードが即時モードであるのか、一括モードであるのかを判断して、即時モードであることを判断するときには、ステップ2に進んで、業務処理より低い優先度を指定しつつ、DBMS20に対して、起動プログラム23から通知されたプライムページ200及び対となるオーバーフローページ201の排他獲得要求を発行し、続くステップ3で、この排他が獲得されるのを待つ。
【0050】
このステップ3で、排他獲得を検出すると、続いて、ステップ4で、図10に示すように、排他獲得したプライムページ200及びオーバーフローページ201のレコードを退避領域22に退避させ、続くステップ5で、図11に示すように、そのプライムページ200及びオーバーフローページ201のレコードを削除する。
【0051】
続いて、ステップ6で、図12に示すように、退避領域22に退避させたレコードを、排他獲得したプライムページ200に再配置する。すなわち、プライムページ200に空き領域が生じないようにと、退避領域22に退避させたレコードをキー順に再配置していくのである。
【0052】
続いて、ステップ7で、ステップ6での再配置処理でオーバーフローページ201が必要となるのか否かを判断して、オーバーフローページ201が必要とならないことを判断するとき、すなわち、プライムページ200に全てのレコードを再配置できたことを判断するときには、ステップ8に進んで、そのプライムページ200に対応付けて設けられるインデックス202を最適化し、続くステップ9で、それまで使用していたオーバーフローページ201を返却するとともに、DBMS20がフラグ域に記録した上述の「再編成要」の記録を消去して、処理を終了する。
【0053】
一方、ステップ7で、ステップ6での再配置処理でオーバーフローページ201が必要となることを判断するとき、すなわち、プライムページ200に退避領域22に退避させた全てのレコードを再配置できないことを判断するときには、ステップ10(図7の処理フロー)に進んで、これを格納可能とする1つ又は複数の新たなプライムページ200を作成し、続くステップ11で、格納できなかったレコードを、その新たに作成したプライムページ200にキー順に配置する。
【0054】
続いて、ステップ12で、プライムページ200の増加に合わせて、インデックス202を再構成し、続くステップ13で、それまで使用していたオーバーフローページ201を返却するとともに、DBMS20がフラグ域に記録した上述の「再編成要」の記録を消去して処理を終了する。
【0055】
このようにして、再編成プログラム21は、ユーザが即時モードに設定しているときには、DBMS20が業務処理アクセスの延長で規定以上のオーバーフローページ201を持つプライムページ200を検出すると、業務処理中に、業務処理を優先しつつ、そのプライムページ200及びオーバーフローページ201を排他獲得して、必要に応じてプライムページ200を作成しつつ、オーバーフローページ201を返却しながら再編成処理を実行するのである。
【0056】
この再編成プログラム21の再編成処理に従って、例えば、図13に示すように、データベース10が、保険会社などの営業所毎に、プライムページ200を使って被保険者などのレコードを管理する構成を採るときにあって、営業所Cのレコードが大量になると、業務処理中に再編成処理が行われ、これにより、営業所Cのプライムページ200が増えて、それらのプライムページ200にレコードが再配置されていくとともに、それに合わせて、営業所Cのインデックス202が再構成されることになるので、高速のアクセス性能が実現されることになる。ここで、図中に示すPはプライムページ200、Oはオーバーフローページ201を表している。
【0057】
一方、再編成プログラム21は、図6の処理フローのステップ1で、起動プログラム23から一括モードの動作モードが通知されることを判断するときには、ステップ14(図8の処理フロー)に進んで、保存ファイル24から、起動プログラム23のスタックしたプライムページ200のページ番号を読み出す。ここで、図5(b)の処理フローで説明したように、この一括モードは、業務処理の終了と同期して通知されることになる。
【0058】
続いて、ステップ15で、保存ファイル24から読み出したプライムページ200のページ番号の中からページ番号を1つを選択し、続くステップ16で、全てのページ番号の選択を終了したのか否かを判断して、全てのページ番号の選択終了を判断するときには処理を終了する。
【0059】
一方、ステップ16で、全てのページ番号の選択終了を判断しないとき、すなわち、未処理のプライムページ200を1つ選択できたことを判断するときには、ステップ17に進んで、DBMS20に対して、選択したプライムページページ200及び対となるオーバーフローページ201の排他獲得要求を発行し、続くステップ18で、この排他が獲得されるのを待つ。ここで、業務処理は終了しているので、この排他獲得は、どのような優先度を指定して行ってもよい。
【0060】
このステップ18で、排他獲得を検出すると、続いて、ステップ19で、図10に示すように、排他獲得したプライムページ200及びオーバーフローページ201のレコードを退避領域22に退避し、続くステップ20で、図11に示すように、そのプライムページ200及びオーバーフローページ201のレコードを削除する。
【0061】
続いて、ステップ21で、図12に示すように、退避領域22に退避させたレコードを、排他獲得したプライムページ200に再配置する。すなわち、プライムページ200に空き領域が生じないようにと、退避領域22に退避したレコードをキー順に再配置していくのである。
【0062】
続いて、ステップ22で、ステップ20での再配置処理でオーバーフローページ201が必要となるのか否かを判断して、オーバーフローページ201が必要とならないことを判断するとき、すなわち、プライムページ200に全てのレコードを再配置できたことを判断するときには、ステップ23に進んで、そのプライムページ200に対応付けて設けられるインデックス202を最適化し、続くステップ24で、それまで使用していたオーバーフローページ201を返却してから、次のプライムページ200の処理に進むべくステップ15に戻る。
【0063】
一方、ステップ22で、ステップ21での再配置処理でオーバーフローページ201が必要となることを判断するとき、すなわち、プライムページ200に退避領域22に退避させた全てのレコードを再配置できないことを判断するときには、ステップ25(図9の処理フロー)に進んで、これを格納可能とする1つ又は複数の新たなプライムページ200を作成し、続くステップ26で、格納できなかったレコードを、その新たに作成したプライムページ200にキー順に配置する。
【0064】
続いて、ステップ27で、プライムページ200の増加に合わせて、インデックス202を再構成し、続くステップ28で、それまで使用していたオーバーフローページ201を返却してから、次のプライムページ200の処理に進むべくステップ15に戻る。
【0065】
このようにして、再編成プログラム21は、ユーザが一括モードに設定しているときには、DBMS20が業務処理アクセスの延長で規定以上のオーバーフローページ201を持つプライムページ200を検出すると、それらのプライムページ200のページ番号を保存ファイル24に保存する構成を採って、業務処理が終了すると、それらのプライムページ200及び対をなすオーバーフローページ201を順番に選択して、必要に応じてプライムページ200を作成しつつ、オーバーフローページ201を返却しながら再編成処理を実行するのである。
【0066】
この構成に従うと、業務処理の終了時点で、データベース10をアクセスしなくても、再編成処理対象となるプライムページ200が存在するのか否かということと、存在するときには、それがどのプライムページ200であるのかということを知ることができるので、データベース10の再編成処理を効率的に実行できるようになる。
【0067】
DBMS20は、業務処理アクセスの延長で規定以上のオーバーフローページ201を持つプライムページ200を検出する構成を採っている。これから、そのプライムページ200をアクセスする業務処理が集中する場合には、そのプライムページ200に対する再編成処理が実行される前に、何度も、そのプライムページ200がDBMS20により検出されてしまうことになる。
【0068】
そこで、DBMS20は、図4の処理フローに示したように、一度、規定以上のオーバーフローページ201を持つものと検出したプライムページ200については、再編成プログラム21による再編成処理が終わるまでは、再度検出しないようにする構成を採っている。この機能により、即時モードで動作するときに、同一のプライムページ200に対する再編成処理要求が連続しないように制御できることになる。
【0069】
この機能は、DBMS20が持つのではなくて、起動プログラム23に持たせることも可能である。
すなわち、DBMS20は、業務処理アクセスの延長で規定以上のオーバーフローページ201を持つプライムページ200を検出すると、そのプライムページ200に対する再編成処理が終わっているのか否かに関係なく、そのプライムページ200を指定して起動プログラム23を起動する構成を採る。
【0070】
そして、起動プログラム23は、この構成に合わせて、再編成プログラム21に対して再編成の処理要求を発行したプライムページ200については、その旨を記録する構成を採って、再編成処理の実行によりその記録が消去されていない間は、DBMS20から通知される同一のプライムページ200については無視する構成を採る。
【0071】
これにより、同一のプライムページ200に対する再編成処理要求が連続しないように制御できることになる。
また、上述した実施例では、ユーザの設定する動作モード(即時モードと一括モード)に従って、業務処理中に再編成処理を実行するのか、業務処理の終了後に再編成処理を実行するのかを制御する構成を採ったが、オーバーフローページ201が多くなった原因により、これを動的に制御する構成を採ることも可能である。
【0072】
例えば、オーバーフローページ201が多くなった原因がレコード数の増加によるものであるときには、例えば、業務処理の終了後に再編成処理を実行するように制御し、例えば、その原因がレコード長の増加によるものであるときには、例えば、業務処理中に再編成処理を実行するように制御するといったような構成を採ることも可能である。
【0073】
【発明の効果】
以上説明したように、本発明では、即時モードに設定することにより、業務処理のアクセス時に、それと同期を取って、オーバーフロー領域が大きくなるプライム領域を検出し、業務処理よりも低い優先度を指定しつつ、そのプライム領域の排他獲得を実行して、その排他獲得したプライム領域及び対をなすオーバーフロー領域を処理対象としてレコードを再配置するとともに、そのオーバーフロー領域にレコードが残るときには、新たにプライム領域を作成してそこにレコードを配置していくことで、データベースの再編成を実行する構成を採る。
【0074】
このようにして、本発明によれば、即時モードに設定することにより、業務処理のアクセスと連動させつつ、局所的なデータベースの再編成処理を実行することで、簡単な制御に従って、業務処理と並列する形態で、データベースの再編成処理を実行できるようになる。
【0075】
そして、本発明によれば、業務処理と並列する形態でデータベースの再編成処理を実行する構成を採るときに、オーバーフロー領域が残らない形態でデータベースの再編成処理を実行することから、アクセス性能の向上を実現できるデータベースの再編成処理を実行できるようになる。
また、本発明では、一括モードに設定することにより、業務処理アクセスの延長でオーバーフロー領域が大きくなるプライム領域を検出すると、それらのプライム領域の識別子を保存領域に保存する構成を採って、業務処理が終了すると、それらのプライム領域を処理対象として、処理対象となるプライム領域及び対をなすオーバーフロー領域を処理対象としてレコードを再配置するとともに、そのオーバーフロー領域にレコードが残るときには、新たにプライム領域を作成してそこにレコードを配置していくことで、データベースの再編成を実行する構成を採る。
このようにして、本発明によれば、一括モードに設定することにより、業務処理の終了時点に、データベースにアクセスしなくても、再編成処理の対象となるプライム領域を特定できることでデータベースの再編成処理を実行できるようになる。
そして、本発明によれば、業務処理の終了時点にデータベースの再編成処理を実行する構成を採るときに、オーバーフロー領域が残らない形態でデータベースの再編成処理を実行することから、アクセス性能の向上を実現できるデータベースの再編成処理を実行できるようになる。
【図面の簡単な説明】
【図1】本発明の原理構成図である。
【図2】本発明の一実施例である。
【図3】DBMSの処理の説明図である。
【図4】DBMSの実行する処理フローの一実施例である。
【図5】起動プログラムの実行する処理フローの一実施例である。
【図6】再編成プログラムの実行する処理フローの一実施例である。
【図7】再編成プログラムの実行する処理フローの一実施例である。
【図8】再編成プログラムの実行する処理フローの一実施例である。
【図9】再編成プログラムの実行する処理フローの一実施例である。
【図10】再編成プログラムの実行する処理の説明図である。
【図11】再編成プログラムの実行する処理の説明図である。
【図12】再編成プログラムの実行する処理の説明図である。
【図13】再編成処理の説明図である。
【符号の説明】
1 データベースシステム
2 業務プログラム
10 データベース
11 データベース管理機構
12 検出手段
13 発行手段
14 退避領域
15 再編成手段
[0001]
BACKGROUND OF THE INVENTION
  The present invention describes a database reorganization apparatus used in a database for storing records overflowing from the prime area in the overflow area, and a program used for realizing the database reorganization apparatus.RecordBe doneComputer readable recordsIn particular, a database reorganization apparatus that enables efficient reorganization processing of a database according to simple control and a program used to realize the medium are described.RecordBe doneComputer readable recordsWith media.
[0002]
In a database used for insurance business or the like, a large number of records may be generated at a specific business establishment or the like when a larger number of insured persons than the initial assumption are subscribed to the specific business establishment or the like. On the other hand, in the database, a piece of free space is generated by deleting and adding records.
[0003]
From now on, in the database, it is necessary to execute the reorganization process of rearranging records. This reorganization process must be performed without interfering with the performance of the business process, and the access performance is improved. It is necessary to execute it in the form to realize.
[0004]
[Prior art]
In the database, when a record is added to the prime page, the record is stored in the overflow page when there is no free space. Therefore, when a record is added after the record is deleted, a fragmentary free area is generated on the prime page or the overflow page due to the record length. Therefore, a record rearrangement process for organizing the empty area is necessary.
[0005]
Since this record rearrangement process prohibits access to the database required for the business process, conventionally, the record rearrangement process is configured to be executed with the database operation stopped.
[0006]
However, there is a problem that the business process cannot be performed while the record rearrangement process is being performed.
In view of this, the present inventor disclosed in Japanese Patent Laid-Open No. 6-110743, temporarily saved prime page and overflow page records in parallel with business processing, deleted those records, and then saved them. Disclosed an invention of a record rearrangement process in which new records are sequentially packed from a prime page to an overflow page and rearranged.
[0007]
According to the present invention, when the access frequency of the business process to the database is low, the prime page and the overflow page that are not exclusively acquired by the business process are acquired in order from the beginning, and the exclusive page is acquired. By executing the record rearrangement process, a parallel processing of the record rearrangement process and the business process is realized.
[0008]
[Problems to be solved by the invention]
However, the invention disclosed in Japanese Patent Application Laid-Open No. 6-110743 employs a configuration in which the record relocation process is executed by detecting when the access frequency of the business process to the database decreases, so that complicated control is performed. There was a problem that it was necessary.
[0009]
That is, there is a problem that complicated control is required to detect when the access frequency of the business process decreases.
Furthermore, in the invention disclosed in Japanese Patent Laid-Open No. 6-110743, since the prime page is filled with records and the record remains on the overflow page, it is left as it is on the overflow page. There was a problem that the degradation of access performance could not be resolved.
[0010]
That is, the access performance of the overflow page is inferior to the access performance of the prime page, and there is a problem in that the deterioration of the access performance cannot be eliminated by leaving a record on the overflow page.
[0011]
  The present invention has been made in view of such circumstances, and provides a new database reorganization apparatus that allows efficient database reorganization processing to be executed according to simple control, and a program used for realizing the same. RecordRecordBe doneComputer readable recordsThe purpose is to provide a medium.
[0012]
[Means for Solving the Problems]
  In order to achieve this object, the database reorganization apparatus according to the present invention is used in a database that stores records overflowing from the prime area in the overflow area. (1) When accessing a business process, Detection means for detecting whether or not the overflow area of the prime area is greater than or equal to a prescribed size; and (2) whether the immediate mode is selected when the detection means detects that the overflow area has a prescribed size or more. (3) When it is determined that the immediate mode is set, it is detected by the detecting means that the overflow area has a size larger than the specified size. Specified prime area and instructed execution of reorganization, on the other hand, if it is determined that the batch mode is set (4) In response to a reorganization execution instruction issued by the execution means, the detection means detects that the overflow area has a size larger than a prescribed size. Issuing means for issuing a prime area exclusive acquisition request; and (5) when it is determined that the immediate mode is set, and when the prime area is acquired exclusively in response to the issuing of the issuing means. , After evacuating and deleting the record in the overflow area that forms a pair with the prime area, and then rearranging the evacuated record in the prime area, and for the record that cannot be included at that time, newly add one or more records Is created and stored there, while it is determined that the batch mode is set, and the business process ends. The prime area in which the identifier is stored in the storage area is set as a processing target, and the record in the overflow area that forms a pair with the prime area is saved and then deleted, and then the saved record is rearranged in the prime area, and For a record that cannot be received sometimes, one or a plurality of prime areas are newly created, and reorganization means for storing the prime areas is provided.
  In adopting this configuration, the issuing means may issue a prime area exclusive acquisition request while designating a lower priority than the business process.
  The issuing means may issue an exclusive acquisition request for the next prime area on condition that the processing of the reorganization means has been completed.
  Further, when the reorganization process for the previously detected prime area is not completed, the detecting means ignores even if it is detected that the prime area has an overflow area of a predetermined size or more according to the detection process. May be processed as follows.
  Further, when the reorganization processing for the previously issued prime area is not completed, the issuing means may perform processing so as to ignore the prime area when it is detected by the detecting means.
  Here, the functions of each processing means provided to realize the present invention are specifically realized by a program, and this program is stored in a floppy disk or the like, or stored in a disk such as a server. In addition, the present invention is realized by installing from them and operating on the memory.
  In the present invention configured as described above, when the immediate mode is set, the prime area in which the overflow area becomes large is detected in synchronization with the access to the business process, and the priority is lower than the business process. While specifying the degree, execute exclusive acquisition of the prime area, relocate the record with the exclusive area and the overflow area that forms a pair, and when a record remains in the overflow area, A configuration is adopted in which a prime area is created and records are arranged there, thereby executing database reorganization.
  In the present invention, when the collective mode is set, when a prime area where the overflow area becomes large due to extension of business process access is detected, the identifier of the prime area is stored in the storage area. When the business process is completed, the prime area to be processed is relocated to the prime area to be processed and the overflow area that forms a pair and the record is rearranged. By creating prime areas and placing records there, data A configuration for performing base reorganization is adopted.
  In this way, according to the present invention, by setting the immediate mode, the local database reorganization process is executed in conjunction with the access of the business process, so that the business can be performed according to simple control. Database reorganization processing can be executed in parallel with the processing.
  At this time, since the database reorganization process is executed in a form in which no overflow area remains, the database reorganization process capable of improving the access performance can be executed.
  According to the present invention, by setting the batch mode, it is possible to identify the prime area that is the target of the reorganization process without accessing the database at the end of the business process, thereby reorganizing the database. The process can be executed.
  At this time, since the database reorganization process is executed in a form in which no overflow area remains, the database reorganization process capable of improving the access performance can be executed.
[0029]
DETAILED DESCRIPTION OF THE INVENTION
  Hereinafter, the present invention will be described in detail according to embodiments.
  Before describing the embodiment of the present invention, the processing of the present invention when the immediate mode is set will be described according to the principle configuration diagram shown in FIG.
  In FIG. 1, 1 is a database system comprising the present invention, and 2 is one or more business programs that execute business processing by accessing the database system 1.
  The database system 1 includes a database 10, a database management mechanism 11, a detection unit 12, an issue unit 13, a save area 14, and a reorganization unit 15.
  The database 10 is provided in association with the prime area 100, the overflow area 101 for storing records overflowing from the prime area 100, the prime area 100, and the overflow area 101 that forms a pair with the prime area 100. And a page entry type index 102 for managing the keys of the stored records.
  The database management mechanism 11 manages the database 10 and, in response to an access request issued by the business program 2, acquires the prime area 100 and the paired overflow area 101 exclusively, and obtains the exclusive prime area 100 and the overflow area 101 that forms a pair are executed.
  The detecting unit 12 detects whether or not the overflow area 101 of the prime area 100 to be accessed is equal to or larger than a predetermined size when accessing the business process.
  Issuing means 13 obtains exclusive acquisition of prime area 100 that is detected as having overflow area 101 of a prescribed size or larger by detection means 12 to database management mechanism 11 while designating a lower priority than business processing. Issue a request.
  The save area 14 is prepared as a work area for processing by the reorganization means 15 and saves the records in the prime area 100 and the overflow area 101.
  When the prime area 100 is exclusively acquired in response to the issuing process of the issuing means 13, the reorganization means 15 executes the reorganization process on the prime area 100 and the overflow area 101 that forms a pair.
  In the database system 1 having the present invention configured as described above, the detecting means 12 determines whether or not the overflow area 101 of the prime area 100 of the access destination is larger than a prescribed size when accessing the business process. When the detection means detects that the overflow area 101 of the prime area 100 is larger than the prescribed size, the issuing means 13 instructs the database management mechanism 11 to perform business processing. The exclusive acquisition request for the prime region 100 is issued while designating a lower priority.
  Upon receiving this issuance, the database management mechanism 11 gives priority to the exclusive acquisition request issued by the business process, and acquires the exclusive area when the prime area 100 issued by the issuing means 13 has not been exclusively acquired by the business process. Then, the reorganization means 15 is notified.
  In response to this notification, the reorganization means 15 deletes the record in the overflow area 101 that forms a pair with the prime area 100 that has been exclusively acquired, after saving it in the save area 14, and then saves it in the save area 14. Re-arrange the recorded records in the prime area 100, and for those records that cannot be entered at that time, newly open one or a plurality of prime areas 100 and store them there. The database 10 is reorganized by reconfiguring the index 102 provided for the prime region 100.
  When this processing configuration is adopted, the issuing unit 13 sets the next prime area on the condition that the processing of the reorganization unit 15 has been completed in order to prevent the processing requests to the reorganization unit 15 from competing. It is preferable to issue 100 exclusive acquisition requests.
  Further, when adopting this processing configuration, in order to eliminate duplicate processing, the detection means 12 defines the prime region 100 according to the detection processing when the reorganization processing for the previously detected prime region 100 is not completed. If you have an overflow area 101 that is larger than Even if it is detected, it is processed so as to be ignored, or the issuing means 13 detects the prime area 100 by the detecting means 12 when the reorganization processing for the previously issued prime area 100 is not completed. Sometimes it is preferable to process it to ignore it.
  As described above, in the present invention, when the immediate mode is set, the prime area 100 in which the overflow area 101 becomes large is detected in synchronization with the business process access, and the priority is lower than the business process. The exclusive acquisition of the prime area 100 is executed while specifying the degree, and the prime area 100 and the overflow area 101 paired with the exclusive acquisition are rearranged, and the record is stored in the overflow area 101. When the data remains, a new prime area 100 is created and records are arranged there, whereby the database 10 is reorganized.
  Next, the present invention will be described in detail.
  FIG. 2 illustrates one embodiment of a data system 1 comprising the present invention.
[0030]
In the figure, 10 is a database, 20 is a DBMS, 21 is a reorganization program, 22 is a save area, 23 is a startup program, and 24 is a save file.
The database 10 is provided in association with a plurality of prime pages 200 for storing records, an overflow page 201 for storing records overflowing from the prime page 200, and the prime page 200, and a pair of overflows. A page entry type index 202 for managing keys of records stored in the page 201. Here, the index 202 may be provided in an index file different from the database 10.
[0031]
In response to the exclusive acquisition request of the business program 2, the DBMS 20 acquires the prime page 200 and the paired overflow page 201 exclusively, and performs an access process to the prime page 200 and the paired overflow page 201 acquired exclusively. Execute.
[0032]
When storing records in the prime page 200, the DBMS 20 stores records in the overflow page 201 when records cannot be stored in the prime page 200. When deleting records, the DBMS 20 records records by dropping the valid bit. Is deleted. Therefore, as shown in FIG. 3, fragmentary empty areas are generated in the prime page 200 and the overflow page 201.
[0033]
The reorganization program 21 executes reorganization processing on the prime page 200 and the overflow page 201 that forms a pair while saving the record in the save area 22. The activation program 23 controls activation of the reorganization program 21, and is activated immediately or after the end of business processing. The save file 24 stacks the page numbers of the prime pages 200 in response to the storage request from the activation program 23.
[0034]
FIG. 4 shows an example of a processing flow executed by the DBMS 20, FIG. 5 shows an example of a processing flow executed by the activation program 23, and FIGS. 6 to 9 show an example of a processing flow executed by the reorganization program 21. An example is illustrated. Next, according to these processing flows, the present invention will be described in detail.
[0035]
First, a process that the DBMS 20 newly executes for realizing the present invention will be described.
In response to the access request from the business program 2, the DBMS 20 executes access to the prime page 200 and the overflow page 201 that forms a pair, and when the access is completed, the DBMS 20 newly executes the processing flow in FIG. During processing, the prime page 200 having a large number of overflow pages 201 is detected.
[0036]
That is, when the access to the business process is completed, the DBMS 20 first detects the number of overflow pages 201 of the prime page 200 to be accessed in step 1 as shown in the process flow of FIG.
[0037]
Subsequently, in step 2, it is determined whether or not the detected number of overflow pages 201 exceeds a preset specified value, and when it is determined that the number does not exceed, the process is terminated and exceeded. Is determined, it is determined whether or not “reorganization required” is recorded in a flag area (not shown) for the prime page 200.
[0038]
If it is determined in this step 3 that “reorganization required” is recorded in the flag area, the process is terminated, and if it is determined that it is not recorded, the process proceeds to step 4 where “ After recording “reorganization required”, in the following step 5, the prime page 200 is notified to the activation program 23, and the process ends.
[0039]
Here, as described later, the record of “reorganization required” recorded in the flag area is deleted when the reorganization program 21 executes the reorganization processing. Therefore, “reorganization required” is recorded in the flag area means that the reorganization processing for the prime page 200 has not been executed yet.
[0040]
In this way, when the prime page 200 accessed by the business process has an overflow page 201 that exceeds the specified value, the DBMS 20 sets the start program 23 on the condition that the reorganization process for the prime page 200 has not ended. On the other hand, the prime page 200 is notified.
[0041]
Next, processing executed by the activation program 23 will be described.
When the startup program 23 receives the notification of the prime page 200 from the DBMS 20, as shown in the processing flow of FIG. 5A, first, in step 1, the operation mode set by the user (immediately in the reorganization process). Determine whether the immediate mode is in the immediate mode (there is an immediate mode instructing to enter and a collective mode instructing to enter the reorganization process after the completion of the business process). Sometimes, the process proceeds to step 2 to check whether or not the reorganization program 21 is vacant, and when it is not vacant, it waits for it to be vacant.
[0042]
Here, the processing of step 2 is executed because the reorganization program 21 is not available, but when the processing proceeds to the following processing, the reorganization processing cannot be executed, but the prime page 200 and the overflow page 201 are exclusive. This is because it is acquired and the execution of business processing is hindered.
[0043]
When it is detected in this step 2 that the reorganization program 21 is free, the reorganization program 21 is started by specifying the prime page 200 notified from the DBMS 20 while notifying the immediate mode in step 3. The process is terminated.
[0044]
On the other hand, when it is determined in step 1 that the mode is not the immediate mode, that is, when it is determined that the operation mode set by the user is the batch mode, the process proceeds to step 4 to save the prime page 200 notified from the DBMS 20. The file 24 is stacked and the process is terminated.
[0045]
Further, when the business process by the business program 2 is completed, the activation program 23 executes a process for starting the reorganization program 21 while notifying the batch mode as shown in the process flow of FIG.
[0046]
In this way, when the activation program 23 receives the notification of the prime page 200 from the DBMS 20, when the immediate mode is set, the activation program 23 designates the prime page 200 and activates the reorganization program 21, thereby reorganizing. Request processing. When the batch mode is set, the prime page 200 is stacked on the storage file 24, and when the business process is completed, the reorganization program 21 is started to request the reorganization process.
[0047]
In addition, while waiting for the reorganization program 21 to become free, the prime page 200 may be notified from the DBMS 20 one after another. At this time, the activation program 23 takes a configuration of queuing them and requests the reorganization program 21 to perform reorganization processing in order while waiting for the reorganization program 21 to be free. .
[0048]
Next, processing executed by the reorganization program 21 will be described.
When the reorganization program 21 is activated from the activation program 23, the reorganization process is performed on the prime page 201 detected by the DBMS 20 by executing the processing flow of FIGS. 6 to 9.
[0049]
That is, when the reorganization program 21 is activated from the activation program 23, as shown in the processing flow of FIGS. 6 to 9, first, in step 1, the operation mode notified from the activation program 23 is the immediate mode. When determining whether the current mode or the batch mode and determining that the current mode is the immediate mode, the process proceeds to step 2 and designates a lower priority than the business process, while the DBMS 20 is instructed from the startup program 23. An exclusive acquisition request for the notified prime page 200 and the paired overflow page 201 is issued, and in step 3, it waits for this exclusion to be acquired.
[0050]
When the exclusive acquisition is detected in step 3, subsequently, in step 4, as shown in FIG. 10, the records of the prime page 200 and overflow page 201 acquired exclusively are saved in the save area 22. As shown in FIG. 11, the records of the prime page 200 and the overflow page 201 are deleted.
[0051]
Subsequently, in step 6, as shown in FIG. 12, the record saved in the save area 22 is rearranged on the prime page 200 acquired exclusively. That is, the records saved in the save area 22 are rearranged in the key order so that no empty area is generated in the prime page 200.
[0052]
Subsequently, when it is determined in step 7 whether or not the overflow page 201 is required in the rearrangement process in step 6 and it is determined that the overflow page 201 is not required, that is, all the prime pages 200 are included. When it is determined that the record can be rearranged, the process proceeds to step 8 where the index 202 provided in association with the prime page 200 is optimized, and in the subsequent step 9, the overflow page 201 that has been used is changed. At the same time, the record of the above “reorganization necessary” recorded in the flag area by the DBMS 20 is deleted, and the process is terminated.
[0053]
On the other hand, when it is determined in step 7 that the overflow page 201 is required in the relocation processing in step 6, that is, it is determined that all the records saved in the save area 22 in the prime page 200 cannot be relocated. To proceed to step 10 (processing flow in FIG. 7), one or a plurality of new prime pages 200 that can be stored are created, and in step 11 the record that could not be stored is added to the new page. Are arranged in the key order on the created prime page 200.
[0054]
Subsequently, in step 12, the index 202 is reconfigured in accordance with the increase of the prime page 200, and in the subsequent step 13, the overflow page 201 used so far is returned, and the DBMS 20 records in the flag area. The “reorganization required” record is deleted, and the process is terminated.
[0055]
In this way, when the user has set the immediate mode, the reorganization program 21 detects a prime page 200 having an overflow page 201 that exceeds the specified value by extension of business process access. The priority page 200 and the overflow page 201 are exclusively acquired while giving priority to the business process, the prime page 200 is created as necessary, and the reorganization process is executed while returning the overflow page 201.
[0056]
In accordance with the reorganization processing of the reorganization program 21, for example, as shown in FIG. 13, the database 10 uses a prime page 200 to manage records such as insured persons for each sales office such as an insurance company. When there are a large number of records at sales office C, a reorganization process is performed during the business process. As a result, the prime pages 200 of sales office C increase, and the records are re-recorded on those prime pages 200. Since the index 202 of the sales office C is reconfigured in accordance with the arrangement, high-speed access performance is realized. Here, P shown in the figure represents a prime page 200, and O represents an overflow page 201.
[0057]
On the other hand, the reorganization program 21 proceeds to step 14 (process flow of FIG. 8) when determining that the operation mode of the collective mode is notified from the activation program 23 in step 1 of the process flow of FIG. The page number of the prime page 200 on which the activation program 23 is stacked is read from the saved file 24. Here, as described in the processing flow of FIG. 5B, this batch mode is notified in synchronization with the end of the business process.
[0058]
Subsequently, in step 15, one page number is selected from the page numbers of the prime page 200 read from the save file 24. In step 16, it is determined whether or not all page numbers have been selected. When it is determined that all the page numbers have been selected, the process ends.
[0059]
On the other hand, when it is determined in step 16 that selection of all page numbers has not been completed, that is, when it is determined that one unprocessed prime page 200 has been selected, the process proceeds to step 17 to select the DBMS 20. The exclusive acquisition request of the prime page page 200 and the overflow page 201 to be paired is issued, and in the subsequent step 18, it waits for this exclusion to be acquired. Here, since the business process has been completed, this exclusive acquisition may be performed by specifying any priority.
[0060]
When the exclusive acquisition is detected in step 18, subsequently, in step 19, as shown in FIG. 10, the records of the prime page 200 and overflow page 201 acquired exclusively are saved in the save area 22. As shown in FIG. 11, the records of the prime page 200 and the overflow page 201 are deleted.
[0061]
Subsequently, in step 21, as shown in FIG. 12, the records saved in the save area 22 are rearranged on the prime page 200 that has been exclusively acquired. That is, the records saved in the save area 22 are rearranged in the key order so that no empty area is generated in the prime page 200.
[0062]
Subsequently, in step 22, when it is determined whether or not the overflow page 201 is required in the rearrangement process in step 20, it is determined that the overflow page 201 is not required, that is, all the prime pages 200 are included. When it is determined that the next record can be rearranged, the process proceeds to step 23 where the index 202 provided in association with the prime page 200 is optimized, and in the subsequent step 24, the overflow page 201 that has been used so far is changed. After returning, the process returns to step 15 to proceed to the next prime page 200 process.
[0063]
On the other hand, when it is determined in step 22 that the overflow page 201 is required in the relocation processing in step 21, that is, it is determined that all records saved in the save area 22 in the prime page 200 cannot be relocated. When proceeding to step 25 (processing flow in FIG. 9), one or more new prime pages 200 that can be stored are created, and in step 26, the record that could not be stored Are arranged in the key order on the created prime page 200.
[0064]
Subsequently, in step 27, the index 202 is reconfigured in accordance with the increase in the number of prime pages 200, and in the subsequent step 28, the overflow page 201 used so far is returned, and then processing of the next prime page 200 is performed. Return to Step 15 to proceed to.
[0065]
In this way, when the user is set to the collective mode, the reorganization program 21 detects the prime page 200 having the overflow page 201 exceeding the specified value by extension of the business process access, and those prime pages 200 are detected. When the business processing is completed, the prime page 200 and the paired overflow page 201 are selected in order, and the prime page 200 is created as necessary. Meanwhile, the reorganization process is executed while returning the overflow page 201.
[0066]
According to this configuration, whether or not there is a prime page 200 to be reorganized even if the database 10 is not accessed at the end of the business process, and which prime page 200 is present when it exists. Therefore, the reorganization processing of the database 10 can be executed efficiently.
[0067]
The DBMS 20 employs a configuration for detecting a prime page 200 having an overflow page 201 that is greater than or equal to a specified value by extension of business process access. From now on, when the business processes accessing the prime page 200 are concentrated, the prime page 200 is detected by the DBMS 20 many times before the reorganization process for the prime page 200 is executed. Become.
[0068]
Therefore, as shown in the processing flow of FIG. 4, the DBMS 20 once again detects the prime page 200 that has been detected as having the overflow page 201 exceeding the specified value until the reorganization processing by the reorganization program 21 is completed. A configuration is adopted to prevent detection. With this function, it is possible to control so that reorganization processing requests for the same prime page 200 do not continue when operating in the immediate mode.
[0069]
This function can be provided not only in the DBMS 20 but also in the startup program 23.
In other words, when the DBMS 20 detects a prime page 200 having an overflow page 201 that exceeds the prescribed number as a result of the extension of business process access, the DBMS 20 displays the prime page 200 regardless of whether or not the reorganization process for the prime page 200 has ended. A configuration in which the activation program 23 is designated and activated is adopted.
[0070]
Then, in accordance with this configuration, the startup program 23 adopts a configuration for recording the prime page 200 that has issued a reorganization processing request to the reorganization program 21, and executes the reorganization processing. While the record is not erased, the same prime page 200 notified from the DBMS 20 is ignored.
[0071]
As a result, it is possible to control so that reorganization processing requests for the same prime page 200 do not continue.
In the above-described embodiment, according to the operation mode (immediate mode and batch mode) set by the user, the reorganization process is executed during the business process or the reorganization process is executed after the business process is completed. Although the configuration is adopted, it is also possible to adopt a configuration in which this is dynamically controlled due to the reason that the overflow pages 201 increase.
[0072]
For example, when the cause of the increase in the overflow page 201 is due to the increase in the number of records, for example, control is performed so that the reorganization process is executed after the end of the business process. For example, the cause is due to the increase in the record length. In such a case, for example, it is possible to adopt a configuration in which control is performed so that reorganization processing is executed during business processing.
[0073]
【The invention's effect】
  As described above, in the present invention,By setting the immediate mode,When the business process is accessed, synchronize with it, detect the prime area where the overflow area becomes large, specify the priority lower than the business process, execute exclusive acquisition of the prime area, and acquire the exclusive area The records are rearranged for the prime area and the overflow area that forms a pair, and when a record remains in the overflow area, a new prime area is created and the record is placed there. The composition which performs organization is taken.
[0074]
  Thus, according to the present invention,By setting the immediate mode,A local database that is linked to business process access.OfBy executing the reorganization process, the database is executed in parallel with the business process according to simple control.OfThe reorganization process can be executed.
[0075]
  According to the present invention, when the database reorganization process is executed in parallel with the business process, the database reorganization process is executed in a form that does not leave an overflow area. Database reorganization processing that can realize improvement can be executed.
  Further, in the present invention, when the prime area where the overflow area becomes large due to the extension of the business process access is detected by setting the collective mode, the prime area identifier is stored in the storage area, and the business process is taken. Is completed, the prime area to be processed and the overflow area paired with the prime area to be processed are rearranged, and when a record remains in the overflow area, a new prime area is set. By creating and placing records there, we adopt a configuration to reorganize the database.
  In this way, according to the present invention, by setting the batch mode, it is possible to identify the prime area that is the target of the reorganization process without accessing the database at the end of the business process. The organization process can be executed.
  According to the present invention, when adopting a configuration in which the database reorganization process is executed at the end of the business process, the database reorganization process is executed in a form that does not leave an overflow area, thereby improving access performance. Database reorganization processing can be executed.
[Brief description of the drawings]
FIG. 1 is a principle configuration diagram of the present invention.
FIG. 2 is an example of the present invention.
FIG. 3 is an explanatory diagram of DBMS processing;
FIG. 4 is an example of a processing flow executed by a DBMS.
FIG. 5 is an example of a processing flow executed by a startup program.
FIG. 6 is an example of a processing flow executed by a reorganization program.
FIG. 7 is an example of a processing flow executed by a reorganization program.
FIG. 8 is an example of a processing flow executed by a reorganization program.
FIG. 9 is an example of a processing flow executed by the reorganization program.
FIG. 10 is an explanatory diagram of processing executed by the reorganization program.
FIG. 11 is an explanatory diagram of processing executed by the reorganization program.
FIG. 12 is an explanatory diagram of processing executed by the reorganization program.
FIG. 13 is an explanatory diagram of a reorganization process.
[Explanation of symbols]
1 Database system
2 business programs
10 Database
11 Database management mechanism
12 Detection means
13 Issuing means
14 Evacuation area
15 Reorganization means

Claims (6)

プライム領域から溢れたレコードをオーバーフロー領域に格納するデータベースで用いられるデータベース再編成装置において、
業務処理のアクセス時に、アクセス先のプライム領域の持つオーバーフロー領域が規定の大きさ以上であるのか否かを検出する検出手段と、
上記検出手段により規定の大きさ以上のオーバーフロー領域を持つと検出されるときに、即時モードか一括モードのどちらが設定されているのかを判断する判断手段と、
即時モードに設定されていることが判断される場合に、上記検出手段により規定の大きさ以上のオーバーフロー領域を持つと検出されたプライム領域を指定して再編成の実行を指示し、一方、一括モードに設定されていることが判断される場合に、該プライム領域の識別子を保存領域に保存する実行手段と、
上記再編成の実行指示に応答して、上記検出手段により規定の大きさ以上のオーバーフロー領域を持つと検出されプライム領域の排他獲得要求を発行する発行手段と、
即時モードに設定されていることが判断される場合にあって、上記発行手段の発行に応答してプライム領域が排他獲得されるときに、該プライム領域及び対をなすオーバーフロー領域のレコードを退避させてから削除し、続いて該退避レコードを該プライム領域に再配置するとともに、そのとき入りきれないレコードについては、新たに1つ又は複数のプライム領域を作成して、そこに格納し、一方、一括モードに設定されていることが判断される場合にあって、業務処理が終了するときに、上記保存領域に識別子の保存されるプライム領域を処理対象として、該プライム領域及び対をなすオーバーフロー領域のレコードを退避させてから削除し、続いて該退避レコードを該プライム領域に再配置するとともに、そのとき入りきれないレコードについては、新たに1つ又は複数のプライム領域を作成して、そこに格納する再編成手段とを備えることを、
特徴とするデータベース再編成装置。
In a database reorganization apparatus used in a database that stores records overflowing from the prime area in the overflow area,
Detecting means for detecting whether or not the overflow area of the prime area of the access destination is equal to or larger than a predetermined size when accessing the business process;
A determination means for determining whether the immediate mode or the batch mode is set when the detection means detects that the overflow area has a predetermined size or more;
When it is determined that the immediate mode is set, the above-mentioned detection means designates a prime area detected as having an overflow area of a prescribed size or more and instructs execution of reorganization. Execution means for storing the identifier of the prime area in the storage area when it is determined that the mode is set;
In response to the reorganization execution instruction, issuing means for issuing an exclusive acquisition request for the prime area detected by the detecting means as having an overflow area of a prescribed size or more,
In the case where it is determined is set in the immediate mode, when the prime region in response to the issuance of the upper Symbol issuing means is exclusion acquisition, saving a record of the overflow area forming the prime region and pairs And then relocating the evacuation record to the prime area, and for records that cannot be entered at that time, newly create one or more prime areas and store them there. In the case where it is determined that the batch mode is set, when the business process ends, the prime area where the identifier is stored in the storage area is set as a processing target, and the prime area and the pair overflow The records in the area are evacuated and then deleted, and then the evacuated records are relocated to the prime area and the records that cannot be filled at that time are recorded. For creates a new one or more prime regions, further comprising a rearrangement unit that stores therein,
Feature database reorganization device.
請求項1記載のデータベース再編成装置において、
上記発行手段は、業務処理よりも低い優先度を指定しつつ、プライム領域の排他獲得要求を発行することを、
特徴とするデータベース再編成装置。
The database reorganization apparatus according to claim 1, wherein
The issuing means issues a prime area exclusive acquisition request while specifying a lower priority than the business process.
Feature database reorganization device.
請求項1又は2記載のデータベース再編成装置において、
上記発行手段は、上記再編成手段の処理が終了していることを条件にして、次のプライム領域の排他獲得要求を発行することを、
特徴とするデータベース再編成装置。
The database reorganization apparatus according to claim 1 or 2,
The issuing means, on condition that the process of the reorganization unit has ended, to issue exclusion acquisition request next prime area,
Feature database reorganization device.
請求項1、2又は3記載のデータベース再編成装置において、
上記検出手段は、先に検出したプライム領域に対する再編成処理が終了していないときには、検出処理に従って該プライム領域が規定の大きさ以上のオーバーフロー領域を持つと検出されても、それを無視するように処理することを、
特徴とするデータベース再編成装置。
In the database reorganization apparatus according to claim 1, 2, or 3,
When the reorganization process for the previously detected prime area is not completed, the detecting means ignores even if it is detected that the prime area has an overflow area of a predetermined size or more according to the detection process. To process
Feature database reorganization device.
請求項1、2又は3記載のデータベース再編成装置において、
上記発行手段は、先に発行したプライム領域に対する再編成処理が終了していないときには、上記検出手段により該プライム領域が検出されるときにも、それを無視するように処理することを、
特徴とするデータベース再編成装置。
In the database reorganization apparatus according to claim 1, 2, or 3,
The issuing means, when the reorganization process for prime areas previously issued has not been completed, to also be treated to ignore it when said prime area is detected by said detection means,
Feature database reorganization device.
プライム領域から溢れたレコードをオーバーフロー領域に格納するデータベースで用いられるデータベース再編成装置の実現に用いられるプログラムが記されるコンピュータ読み取り可能な記録媒体であって、
業務処理のアクセス時に、アクセス先のプライム領域の持つオーバーフロー領域が規定の大きさ以上であるのか否かを検出する検出処理と、
上記検出処理により規定の大きさ以上のオーバーフロー領域を持つと検出されるときに、即時モードか一括モードのどちらが設定されているのかを判断する判断処理と、
即時モードに設定されていることが判断される場合に、上記検出処理により規定の大き さ以上のオーバーフロー領域を持つと検出されたプライム領域を指定して再編成の実行を指示し、一方、一括モードに設定されていることが判断される場合に、該プライム領域の識別子を保存領域に保存する実行処理と、
上記再編成の実行指示に応答して、上記検出処理により規定の大きさ以上のオーバーフロー領域を持つと検出されプライム領域の排他獲得要求を発行する発行処理と、
即時モードに設定されていることが判断される場合にあって、上記発行処理の発行に応答してプライム領域が排他獲得されるときに、該プライム領域及び対をなすオーバーフロー領域のレコードを退避させてから削除し、続いて該退避レコードを該プライム領域に再配置するとともに、そのとき入りきれないレコードについては、新たに1つ又は複数のプライム領域を作成して、そこに格納し、一方、一括モードに設定されていることが判断される場合にあって、業務処理が終了するときに、上記保存領域に識別子の保存されるプライム領域を処理対象として、該プライム領域及び対をなすオーバーフロー領域のレコードを退避させてから削除し、続いて該退避レコードを該プライム領域に再配置するとともに、そのとき入りきれないレコードについては、新たに1つ又は複数のプライム領域を作成して、そこに格納する再編成処理とをコンピュータに実行させるプログラムが記されることを、
特徴とするコンピュータ読み取り可能な記録媒体。
A computer-readable recording medium on which the program is recorded to be used to realize the database reorganization apparatus used in database storing overflow record from the prime region to the overflow area,
A detection process for detecting whether or not the overflow area of the prime area of the access destination is greater than or equal to a prescribed size when accessing the business process;
A determination process for determining whether the immediate mode or the batch mode is set when it is detected by the detection process that the overflow area has a predetermined size or more;
When it is determined that the immediate mode is set, a prime area detected as having an overflow area of a specified size or more by the above detection process is specified and execution of reorganization is instructed. An execution process for storing the identifier of the prime area in a storage area when it is determined that the mode is set;
In response to the reorganization execution instruction, an issuance process for issuing an exclusive acquisition request for a prime area that is detected as having an overflow area of a predetermined size or more by the detection process;
In the case where it is determined is set in the immediate mode, when the prime region in response to the issuance of the upper Symbol issuing process is exclusively acquired, saving a record of the overflow area forming the prime region and pairs And then relocating the evacuation record to the prime area, and for records that cannot be entered at that time, newly create one or more prime areas and store them there. In the case where it is determined that the batch mode is set, when the business process ends, the prime area where the identifier is stored in the storage area is set as a processing target, and the prime area and the pair overflow The records in the area are evacuated and then deleted, and then the evacuated records are relocated to the prime area and the records that cannot be filled at that time are recorded. For, the newly created one or more prime regions, a program for executing a reorganization process in a computer for storing therein are recorded,
A computer-readable recording medium.
JP26116697A 1997-09-26 1997-09-26 Database reorganization apparatus and computer-readable recording medium Expired - Fee Related JP3667953B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP26116697A JP3667953B2 (en) 1997-09-26 1997-09-26 Database reorganization apparatus and computer-readable recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP26116697A JP3667953B2 (en) 1997-09-26 1997-09-26 Database reorganization apparatus and computer-readable recording medium

Publications (2)

Publication Number Publication Date
JPH11102311A JPH11102311A (en) 1999-04-13
JP3667953B2 true JP3667953B2 (en) 2005-07-06

Family

ID=17358045

Family Applications (1)

Application Number Title Priority Date Filing Date
JP26116697A Expired - Fee Related JP3667953B2 (en) 1997-09-26 1997-09-26 Database reorganization apparatus and computer-readable recording medium

Country Status (1)

Country Link
JP (1) JP3667953B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020078300A1 (en) * 1999-08-16 2002-06-20 Chanda Dharap Semantics-based caching policy to minimize latency
JP4390618B2 (en) 2004-04-28 2009-12-24 富士通株式会社 Database reorganization program, database reorganization method, and database reorganization apparatus
JP4854973B2 (en) * 2005-03-09 2012-01-18 富士通株式会社 Storage control program, storage control method, storage control device, and storage control system
JP4843016B2 (en) * 2008-11-27 2011-12-21 京セラコミュニケーションシステム株式会社 Database device
JP6180998B2 (en) * 2014-06-05 2017-08-16 東芝テック株式会社 Information processing system and information processing program

Also Published As

Publication number Publication date
JPH11102311A (en) 1999-04-13

Similar Documents

Publication Publication Date Title
US6477535B1 (en) Method and apparatus for concurrent DBMS table operations
JP4214712B2 (en) Database page allocation processing method
US5239644A (en) Data preloading method and system for using a buffer
JP3667953B2 (en) Database reorganization apparatus and computer-readable recording medium
JP2000036022A5 (en)
JP3378594B2 (en) Processing unit that performs database relocation
US11954328B2 (en) Storage management device, storage management method, and program
JPH09223049A (en) Disk array system
JPS61256442A (en) Method for increasing record retrieving speed
JPH07146809A (en) Information processor
JPH0728836A (en) Data base retrieving method and data base system using this method
CA1311850C (en) Controlling access to network resources
JP2912657B2 (en) File access processor
JPH05151037A (en) Reorganization processing system for database in business processing
CN115221117A (en) Method and system capable of transferring data across disks
JPH04336340A (en) Disk cache access control system
JP2641399B2 (en) File management device
JPH056296A (en) Method for preparing continuous file in disk device
JP2581145B2 (en) Security processing method
JPH04131944A (en) Document filling device containing batch changing function of document title information
JPH05250179A (en) Job control system in multijob system
JP2019160117A (en) Arrangement controller of logical storage area, arrangement control system of logical storage area, arrangement control method of logical storage area, and arrangement control program of logical storage area
JP2002073381A (en) File rearranging and processing method
JPH0764832A (en) Multi-extent file system
JPH02208750A (en) File access system

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040316

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040517

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20050405

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050407

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20080415

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090415

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090415

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100415

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110415

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110415

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120415

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130415

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20140415

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees