JPH01277943A - Recovery system for dead lock - Google Patents

Recovery system for dead lock

Info

Publication number
JPH01277943A
JPH01277943A JP63105955A JP10595588A JPH01277943A JP H01277943 A JPH01277943 A JP H01277943A JP 63105955 A JP63105955 A JP 63105955A JP 10595588 A JP10595588 A JP 10595588A JP H01277943 A JPH01277943 A JP H01277943A
Authority
JP
Japan
Prior art keywords
instruction
file
user program
checkpoint
database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP63105955A
Other languages
Japanese (ja)
Inventor
Koji Fukuda
福田 光司
Hiroko Sakuma
佐久間 裕子
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP63105955A priority Critical patent/JPH01277943A/en
Publication of JPH01277943A publication Critical patent/JPH01277943A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To perform the recovery processing even at the time of the occurrence of dead lock by saving contents of the data part of a user program and file currency in a save medium by a check point settling means and discriminating whether dead lock occurs or not at the time of issue of a data operation instruction from the program. CONSTITUTION:When a check point settling instruction 9 is issued from a user program 1, a check point settling means 3 in a data base monitor 2 is operated to reflect update log information stored in an external journal file 6 on a data base file 5. The return address for the occurrence of dead lock (the instruction address next to the settling instruction 9), the size of a data part 7 of the program 1, and file currency of all data bases of the program 1 are stored in the first record of the file 6 as roll back information, and contents of the data part 7 are divided and are used as another roll back information and are stored in the second record of the file, and hereafter, the similar processing is performed.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はチェックポイント方式の間接更新型データベー
スシステムに於いてデッドロックが発生した場合にリカ
バリ処理を行なうデッドロックのリカバリ方式に関する
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a deadlock recovery method for performing recovery processing when a deadlock occurs in a checkpoint-based indirect update type database system.

〔従来の技術〕[Conventional technology]

従来、データベースに対する更新系のデータベース操作
命令の更新履歴情報をジャーナルファイル等の一時記憶
フアイルに格納し、チェックポイント−1立時に一時記
憶フアイルの内容をデータベースファイルに反映させる
チェックポイント方式の間接更新型データベースシステ
ムに於いては、デッドロックに対処するため、チェック
ポイント確立時にユーザプログラムのデータ部の内容及
びユーザプログラムが持つ全てのファイルカレンシ(フ
ァイルのどのレコードを参照しようとしているかを示す
情報)を退避させる処理と、更新系のデータベース操作
命令の実行時にデッドロックが発生したか否かを判断す
る処理と、デッドロック発生時に上記退避させておいた
データ部の内容及びファイルカレンシをユーザプログラ
ムに復ツ1ヤさせ、ユーザプログラムの状態を最新のチ
エツクポイン目育立時の状態にする処理と、最新のチェ
ックポイントから再実行を行なわせるための処理とをユ
ーザプログラムに埋込むようにしている。
Conventionally, the update history information of update-related database operation commands for the database is stored in a temporary storage file such as a journal file, and the contents of the temporary storage file are reflected in the database file at checkpoint-1, an indirect update type using the checkpoint method. In database systems, in order to deal with deadlocks, when establishing a checkpoint, the contents of the data section of the user program and all file currencies held by the user program (information indicating which record in the file the user program is trying to refer to) are checked. The process of saving data, the process of determining whether a deadlock has occurred when executing an update-related database operation command, and the process of saving the contents of the data section and file currency that were saved above when a deadlock occurs to the user program. A process for restoring the state of the user program to the state when the latest checkpoint was established, and a process for causing re-execution from the latest checkpoint are embedded in the user program.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

従来は上述したように、リカバリ処理を行なうための各
種処理をユーザプログラムに埋込む必要があるため、ユ
ーザプログラムのコーディング量が増加し、利用者に負
担がかかると共にバグが発生し易い。
Conventionally, as described above, it is necessary to embed various processes for performing the recovery process into the user program, which increases the amount of coding in the user program, placing a burden on the user and easily causing bugs.

本発明の目的は、利用者に負担をかけることなく、デッ
ドロック発生時にリカバリ処理を行なうことができるデ
ッドロックのリカバリ方式を提供することにある。
An object of the present invention is to provide a deadlock recovery method that can perform recovery processing when a deadlock occurs without imposing a burden on the user.

〔課題を解決するための手段〕 本発明は上記目的を達成するため、 チェックポイント方式の間接更新型データベースシステ
ムに於いて、 ユーザプログラムからのチェックポイント確立命令の発
行に応答して、ユーザプログラムのデータ部の内容、フ
ァイルカレンシ及び前記チェックポイント確立命令のア
ドレスに関する情報を退避媒体に退避させるチエツクポ
イン目電立手段と、ユーザプログラムからのデータベー
ス操作命令の発行に応答して、該命令を実行すると共に
、デッドロックが発生したか否かを判断し、デッドロッ
クが発生したと判断することにより、前記退避媒体に退
避されているデータ部の内容及びファイルカレンシを前
記ユーザプログラムに戻し、前記チェックポイント確立
命令のアドレスに関する情報に基づいて直前に発行され
た前記チェックポイント確立命令の次の命令に制御を移
行させるデータベースアクセス手段とを設けたものであ
る。
[Means for Solving the Problems] In order to achieve the above-mentioned object, the present invention provides a checkpoint-based indirect update type database system, in which the user program updates the user program in response to issuance of a checkpoint establishment command from the user program. A checkpoint indicator means for saving information regarding the contents of the data section, file currency, and the address of the checkpoint establishment instruction to a saving medium, and executing the instruction in response to the issuance of a database operation instruction from the user program. At the same time, it is determined whether or not a deadlock has occurred, and by determining that a deadlock has occurred, the contents of the data section saved in the save medium and the file currency are returned to the user program, and the file currency is returned to the user program. A database access means is provided for transferring control to the next instruction of the checkpoint establishment instruction issued just before based on information regarding the address of the checkpoint establishment instruction.

〔作 用〕[For production]

ユーザプログラムからチェックポイント確立命令が発行
されることにより、チェックポイント確立手段はユーザ
プログラムのデータ部の内容及びファイルカレンシを退
避媒体に退避させると共に、発行されたチェックポイン
ト確立命令のアドレスに関する情報を退避媒体に退避さ
せる。データベースアクセス手段はユーザプログラムか
らデータベース操作命令が発行されると、その処理を行
なうと共に、デッドロックが発生したか否かを判断し、
デッドロックが発生したと判断することにより、退避媒
体に退避されているデータ部の内容及びファイルカレン
シをユーザプログラムに戻してユーザプログラムを直前
のチェックポイント確立命令実行時の状態にし、その後
、退避媒体に退避されているチェックポイント確立命令
のアドレスに関する情報に従って直前のチェックポイン
ト確立命令の次の命令に制御を移行させる。
When a checkpoint establishment command is issued from the user program, the checkpoint establishment means saves the contents of the data section of the user program and the file currency to the save medium, and also saves information regarding the address of the issued checkpoint establishment command. Save to evacuation medium. When a database operation command is issued from a user program, the database access means processes the command and determines whether a deadlock has occurred.
By determining that a deadlock has occurred, the contents of the data section saved on the save medium and the file currency are returned to the user program, returning the user program to the state it was in when the previous checkpoint establishment instruction was executed, and then the save Control is transferred to the next instruction of the immediately preceding checkpoint establishment instruction in accordance with information regarding the address of the checkpoint establishment instruction saved in the medium.

〔実施例〕〔Example〕

次に本発明の実施例について図面を参照して詳細に説明
する。
Next, embodiments of the present invention will be described in detail with reference to the drawings.

第1図は本発明の実施例のブロック図であり、ユーザプ
ログラムlと、データベースモニタ2と、データベース
のデータを実際に格納するデータベースファイル5と、
データベースに対する更新系のデータベース操作命令の
更新履歴情報等を格納するジャーナルファイル6とを含
んでいる。ユーザプログラム1はデータ部7と、命令部
8とから構成され、命令部8にはチェックポイント確立
命令9と、データベース操作命令10とが埋込まれてい
る。データベースモニタ2はオペレーティングシステム
の一部で、データベース全般の動作を管理するものであ
り、チェックポイント確立命令に対する処理を行なうチ
ェックポイント確立手段3と、データベース操作命令に
対する処理を行なうデータベースアクセス手段4とを含
んでいる。
FIG. 1 is a block diagram of an embodiment of the present invention, in which a user program 1, a database monitor 2, a database file 5 that actually stores database data,
It includes a journal file 6 that stores update history information of update-related database operation commands for the database. The user program 1 is composed of a data section 7 and an instruction section 8, and the instruction section 8 has a checkpoint establishment instruction 9 and a database operation instruction 10 embedded therein. The database monitor 2 is a part of the operating system and manages the overall operation of the database, and includes checkpoint establishment means 3 for processing checkpoint establishment commands and database access means 4 for processing database operation commands. Contains.

次に本実施例の動作を説明する。Next, the operation of this embodiment will be explained.

チェックポイント確立手段3はユーザプログラム1から
チエツクポイン)61立命令9が発行されルト、ジャー
ナルファイル6に格納されている更新履歴情報をデータ
ベースファイル5に反映させた後、デッドロック発生時
の戻りアドレス(チェックポイント確立命令9の次の命
令のアドレス)。
The checkpoint establishment means 3 issues a checkpoint command 9 from the user program 1, reflects the update history information stored in the journal file 6 in the database file 5, and then returns the return address when a deadlock occurs. (Address of the next instruction after checkpoint establishment instruction 9).

ユーザプログラムlのデータ部7の大きさ及びユーザプ
ログラム1が持つ全てのデータベースのファイルカレン
シを、ロールバンク情報Aとして、第2図(alに示す
レコード形式でジャーナルファイル6の第ルコード目に
格納し、更に、データ部7の内容を所定の大きさに分割
し、それぞれをロールバック情報Bとして、同図中)に
示すレコード形式でジャーナルファイル6の第2レコー
ド目から順番に格納する。尚、第2図+alに於いて、
レコード識別部21には該レコードがロールバック情報
Aについてのレコードであることを示す情報が格納され
、戻りアドレス部22にはチェックポイント確立命令9
の次の命令のアドレスが、大きさ部23にはデータ部7
の大きさを示す情f1が、ファイルカレンシ部24−1
〜24−nにはそれぞれデータベースファイル5に格納
されている図示を省略したファイルF1〜Fnのファイ
ルカレンシが格納され、また、同図中)に於いてレコー
ド識別部31には該レコードがロールバック情報Bにつ
いてのレコードであることを示す情報が格納され、メモ
リイメージ部32にはデータ部7の内容が格納される。
The size of the data section 7 of the user program 1 and the file currency of all databases held by the user program 1 are stored as roll bank information A in the record format shown in FIG. Furthermore, the contents of the data section 7 are divided into predetermined sizes, and each part is stored as rollback information B in order from the second record of the journal file 6 in the record format shown in FIG. In addition, in Figure 2+al,
The record identification section 21 stores information indicating that the record is for rollback information A, and the return address section 22 stores checkpoint establishment command 9.
The address of the next instruction is stored in the size field 23 in the data field 7.
Information f1 indicating the size of is stored in the file currency section 24-1.
~24-n store file currencies of files F1 to Fn (not shown) stored in the database file 5, respectively, and record identification section 31 stores the file currency of files F1 to Fn (not shown) stored in the database file 5. Information indicating that the record is for back information B is stored, and the contents of the data section 7 are stored in the memory image section 32.

データベースアクセス手段4はユーザプログラムlから
データベース操作命令10が発行されると、第3図のフ
ローチャートに示す以下の処理を行なう。
When the database access means 4 receives the database operation command 10 from the user program 1, it performs the following process shown in the flowchart of FIG.

データベースアクセス手段4はボックスBlに於いて、
先ずデータベース操作命令100本来の処理、つまりデ
ータベースファイル5に対するアクセス処理を行なう、
この時、データベースアクセス手段4は、データベース
操作命令10が更新系の命令である場合には、ボックス
B1に於いて、ジャーナルファイル6に第2図(C1に
示すレコード形式で更新履歴情報を書込む処理も行なう
、この更新履歴情報の書込み処理はデータベース操作命
令が発行される毎に行なわれ、チェックポイント確立命
令9が実行された後に最初に実行された更新系のデータ
ベース操作命令lO対応の更新履歴情報はロールバック
情報Bの次のレコードに書込まれ、以後更新系のデータ
ベース操作命令が発行される毎に更新履歴情報が順番に
書込まれる。尚、第2図(C1に於いてレコード識別部
41には該レコードが更新履歴情報についてのレコード
であることを示す情報が格納され、情報部42には更新
履歴情報が格納される。
The database access means 4, in box Bl,
First, the original processing of the database operation command 100, that is, the processing of accessing the database file 5, is performed.
At this time, if the database operation instruction 10 is an update-related instruction, the database access means 4 writes update history information in the journal file 6 in the record format shown in FIG. 2 (C1) in box B1. This update history information writing process is performed every time a database operation command is issued, and the update history corresponding to the update-based database operation command IO executed first after the checkpoint establishment command 9 is executed. The information is written to the record next to rollback information B, and update history information is written in order every time an update-related database operation command is issued. The section 41 stores information indicating that the record is a record regarding update history information, and the information section 42 stores update history information.

次に、データベースアクセス手段4は次のボックスB2
でデータベースシステムがデッドロック状態であるか否
かをチエツクし、デッドロック状態でないと判断した場
合はデータベースアクセス命令10の次の命令に制御を
戻しくボックスB3)、デッドロック状態であると判断
した場合はボックス84〜B8の処理を行なう、ボック
スB4ではデータベースアクセス手段4は、ジャーナル
ファイル6を第ルコード目に位置づける処理、即ち、ジ
ャーナルファイル6の処理開始レコードを第ルコード目
にする処理を行ない、ボックスB5ではユーザプログラ
ム1中の各ファイルカレンシの内容をジャーナルファイ
ル6の第ルコード目に格納されているファイルカレンシ
部24−1〜24−nの内容で置換え、ボックスB6で
はユーザプログラム1のデータ部7の内容をジャーナル
ファイル6の第2レコード目以降に格納されているメモ
リイメージ部32の内容で置換える。これにより、ユー
ザプログラムlの状態はチェックポイント確立命令9発
行時の状態に戻される。このようにして、ユーザプログ
ラムlの状態をチェックポイント確立命令9発行時の状
態に戻すと、データベースアクセス手段4はボックスB
7に於いてジャーナルファイル6に格納されている更新
履歴情報を削除し、次のボックスB8に於いてジャーナ
ルファイル6の戻りアドレス部22に格納されているア
ドレスの命令に制御を移行させる。これにより、チェッ
クポイント確立命令9の次の命令から処理が再実行され
る。
Next, the database access means 4 selects the next box B2.
Checks whether the database system is in a deadlock state or not, and if it is determined that it is not in a deadlock state, returns control to the instruction following database access instruction 10. Box B3) If so, the processes in boxes 84 to B8 are performed. In box B4, the database access means 4 performs the process of positioning the journal file 6 at the 1st code, that is, the process of setting the processing start record of the journal file 6 at the 1st code, Box B5 replaces the contents of each file currency in user program 1 with the contents of file currency sections 24-1 to 24-n stored in the 1st code of journal file 6, and box B6 replaces the contents of each file currency in user program 1 The contents of the data section 7 are replaced with the contents of the memory image section 32 stored after the second record of the journal file 6. As a result, the state of the user program 1 is returned to the state at the time the checkpoint establishment instruction 9 was issued. In this way, when the state of the user program 1 is returned to the state at the time of issuing the checkpoint establishment instruction 9, the database access means 4 returns to the box B.
In step 7, the update history information stored in the journal file 6 is deleted, and in the next box B8, control is transferred to the command at the address stored in the return address section 22 of the journal file 6. As a result, the process is re-executed from the instruction following the checkpoint establishment instruction 9.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明は、ユーザプログラムから
のチェックポイント確立命令の発行に応答して、ユ、−
ザブログラムのデータ部の内容、ファイルカレンシ、チ
ェックポイント確立命令のアドレスに関する情報を退避
媒体に退避させるチェックポイント確立手段と、データ
ベース操作命令の実行時に、デッドロックが発生したか
否かを判断し、デッドロックが発生したと判断すること
により、退避媒体に格納されている情報をユーザプログ
ラムに戻してユーザプログラムの状態をチェックポイン
ト確立命令発行時の状態にし、その後、退避媒体に格納
されているチェックポイント確立命令のアドレスに関す
る情報に従って制御をチェックポイント確立命令の次の
命令に移行させるデータベースアクセス手段とを設けた
ものであり、従来例のように、ユーザプログラムにデー
タ部の内容、ファイルカレンシを退避させる処理や退避
させた情報を復帰させる処理をコーディングする必要が
なくなるので、利用者に負担をかけることなく、且つ確
実にデフドロックのリカバリ処理を行なうことができる
効果がある。
As described above, the present invention enables a user to -
a checkpoint establishment means for saving information regarding the contents of the data section of the program, the file currency, and the address of the checkpoint establishment instruction to a save medium; and determining whether a deadlock has occurred during execution of the database operation instruction; By determining that a deadlock has occurred, the information stored in the evacuation medium is returned to the user program to return the state of the user program to the state at the time the checkpoint establishment command was issued, and then the checkpoint stored in the evacuation medium is restored. This system is equipped with a database access means that transfers control to the next instruction after the checkpoint establishment instruction according to the information regarding the address of the point establishment instruction. Since there is no need to code the process of saving the information or the process of restoring the saved information, there is an effect that the def-lock recovery process can be performed reliably without putting a burden on the user.

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

第1図は本発明の実施例のブロック図、第2図はジャー
ナルファイル6のレコード形式を示した図及び、 第3図はデータベースアクセス手段4の処理例を示すフ
ローチャートである。 図に於いて、1・・・ユーザプログラム、2・・・デー
タベースモニタ、3・・・チェックポイント確立手段、
4・・・データベースアクセス手段、5・・・データヘ
ースファイル、6・・・ジャーナルファイル、7・・・
データ部、8・・・命令部、9・・・チェックポイント
確立命令、10・・・データベース操作命令。
FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a diagram showing the record format of the journal file 6, and FIG. 3 is a flowchart showing an example of processing by the database access means 4. In the figure, 1...user program, 2...database monitor, 3...checkpoint establishment means,
4...Database access means, 5...Data header file, 6...Journal file, 7...
Data section, 8... Instruction section, 9... Checkpoint establishment instruction, 10... Database operation instruction.

Claims (1)

【特許請求の範囲】 チェックポイント方式の間接更新型データベースシステ
ムに於いて、 ユーザプログラムからのチェックポイント確立命令の発
行に応答して、ユーザプログラムのデータ部の内容、フ
ァイルカレンシ及び前記チェックポイント確立命令のア
ドレスに関する情報を退避媒体に退避させるチェックポ
イント確立手段と、ユーザプログラムからのデータベー
ス操作命令の発行に応答して、該命令を実行すると共に
、デッドロックが発生したか否かを判断し、デッドロッ
クが発生したと判断することにより、前記退避媒体に退
避されているデータ部の内容及びファイルカレンシを前
記ユーザプログラムに戻し、前記チェックポイント確立
命令のアドレスに関する情報に基づいて直前に発行され
た前記チェックポイント確立命令の次の命令に制御を移
行させるデータベースアクセス手段とを含むことを特徴
とするデッドロックのリカバリ方式。
[Claims] In a checkpoint-based indirect update type database system, in response to issuance of a checkpoint establishment command from a user program, the contents of the data section of the user program, the file currency, and the checkpoint establishment a checkpoint establishing means for saving information regarding the address of the instruction to a saving medium; responsive to the issuance of a database operation instruction from a user program, executing the instruction and determining whether a deadlock has occurred; By determining that a deadlock has occurred, the contents of the data section saved in the save medium and the file currency are returned to the user program, and the checkpoint establishment command issued just before is returned to the user program based on the information regarding the address of the checkpoint establishment instruction. and database access means for transferring control to an instruction following the checkpoint establishment instruction.
JP63105955A 1988-04-29 1988-04-29 Recovery system for dead lock Pending JPH01277943A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63105955A JPH01277943A (en) 1988-04-29 1988-04-29 Recovery system for dead lock

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63105955A JPH01277943A (en) 1988-04-29 1988-04-29 Recovery system for dead lock

Publications (1)

Publication Number Publication Date
JPH01277943A true JPH01277943A (en) 1989-11-08

Family

ID=14421247

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63105955A Pending JPH01277943A (en) 1988-04-29 1988-04-29 Recovery system for dead lock

Country Status (1)

Country Link
JP (1) JPH01277943A (en)

Similar Documents

Publication Publication Date Title
JPH0423144A (en) Journal system
JPH08504528A (en) Optimization method of memory space in database
CN115145697A (en) Database transaction processing method and device and electronic equipment
JPH02148235A (en) Data drawback system
JPH06149485A (en) Data completion guarantee processing method
JPH01277943A (en) Recovery system for dead lock
JPS62245348A (en) Method and device for updating data base
KR100365891B1 (en) Backup/recovery Apparatus and method for non-log processing of real-time main memory database system
JPS63132351A (en) Memory data base processor
JP2743860B2 (en) User program debug processing system
JP3022011B2 (en) Data backup system
JPH02257228A (en) File control system for data base system
JPS63262737A (en) Data base updating and recording processing method
JP2631185B2 (en) Database backup method
JPH05143422A (en) Updated journal managing system
JPS63196958A (en) Fault recovery processing method
JPH01180651A (en) Commit synchronization control system for report file output
JPS62233860A (en) Roll-back system for data base
JP4217177B2 (en) Database subsystem
JP2528882B2 (en) Fallback operation method in case of memory failure
JPH0287241A (en) History information processor and trouble recovering method to use history information processor
JPS6037503B2 (en) File storage device content update method
JPS6360414B2 (en)
JPH10143412A (en) Data base managing system
JPH02138646A (en) Processing system for addition of record