JPH07219828A - Journal block restoring system and method thereof - Google Patents

Journal block restoring system and method thereof

Info

Publication number
JPH07219828A
JPH07219828A JP6008067A JP806794A JPH07219828A JP H07219828 A JPH07219828 A JP H07219828A JP 6008067 A JP6008067 A JP 6008067A JP 806794 A JP806794 A JP 806794A JP H07219828 A JPH07219828 A JP H07219828A
Authority
JP
Japan
Prior art keywords
block
journal
master
copy
failure
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.)
Granted
Application number
JP6008067A
Other languages
Japanese (ja)
Other versions
JP2806779B2 (en
Inventor
俊英 ▲高▼野
Shunei Takano
Koyo Okazaki
公洋 岡崎
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.)
TOHOKU NIPPON DENKI SOFTWARE KK
NEC Corp
NEC Solution Innovators Ltd
Original Assignee
TOHOKU NIPPON DENKI SOFTWARE KK
NEC Corp
NEC Software Tohoku 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 TOHOKU NIPPON DENKI SOFTWARE KK, NEC Corp, NEC Software Tohoku Ltd filed Critical TOHOKU NIPPON DENKI SOFTWARE KK
Priority to JP6008067A priority Critical patent/JP2806779B2/en
Publication of JPH07219828A publication Critical patent/JPH07219828A/en
Application granted granted Critical
Publication of JP2806779B2 publication Critical patent/JP2806779B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To improve the restoration processing efficiency of a defective journal block. CONSTITUTION:In a normal state, a data base access means 12 receives an updating request of a data base 13 from a data base updating program 11 and outputs a journal to a journal file 19 via a journal file access means 14 before the base 13 is updated. In this case, the journal is written in two continuous blocks (master and copy blocks). A final journal block positioning means 16 sets a position to the final master block in a journal file 19 when a fault of a journal block is detected. A defective journal block detector means 17 detects the fault of the master block by a prescribed method. A journal block restoring means 15 restores the defective master block based on the contents of a copy block following the master block.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、データベースの更新履
歴を格納するジャーナルファイルへ書き込み中にジャー
ナルブロックに障害が発生した場合の、ジャーナルブロ
ック復旧方式およびジャーナルブロック復旧方法に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a journal block recovery method and a journal block recovery method when a failure occurs in a journal block during writing to a journal file storing a database update history.

【0002】[0002]

【従来の技術】ジャーナルレコードは、データベースの
実更新に先立ちジャーナルファイルに出力されなければ
ならい。そのため、ジャーナルファイルに対するI/O
ブロックが一杯になっていなくともジャーナルファイル
に対し強制的に書き込まれる事がある。この様に、I/
Oブロックが一杯にならずにジャーナルファイルに対し
書き込まれると、ジャーナルブロックに空き領域ができ
てしまい無駄である。この様なジャーナルブロックの無
駄使いを防ぐため、一度書き込んだジャーナルブロック
でも、ブロックが一杯になっていない場合、同一ブロッ
クの空き領域にジャーナルレコードを追加し再度同一ブ
ロックに対し書き込む方式をとっている。しかし、この
方式では、一度書き込んだブロックに対し再度書き込み
を行う為、二度目以降の書き込み中にホストダウン等の
障害が発生した場合、一度書き込んだブロックが消失す
る可能性がある。
2. Description of the Related Art Journal records must be output to a journal file before actual updating of a database. Therefore, I / O for the journal file
The journal file may be forcibly written even if the block is not full. In this way, I /
If the O block is written to the journal file without being full, a free space is created in the journal block, which is wasteful. In order to prevent such waste of journal block, even if the journal block that has been written once is not full, a journal record is added to the empty area of the same block and the journal block is written again. . However, in this method, since the block that has been written once is written again, if a failure such as host down occurs during the second and subsequent writing, the block that has been written once may disappear.

【0003】その為従来技術では、同一イメージのジャ
ーナルレコードを連続した2つのブロック(以下、1つ
目のブロックをマスターブロック、2つ目のブロックを
コピーブロックと呼ぶ)に書き込み、ブロックが一杯に
なった(再書き込みによる障害が起きない)時点で次の
ブロック(コピーブロックとその次のブロック)へ出力
を移す。この方式により、上述した様な障害が発生した
場合でも、他方のブロックにてイメージを保証してい
た。
Therefore, in the prior art, journal records of the same image are written in two consecutive blocks (hereinafter, the first block is referred to as a master block and the second block is referred to as a copy block) to fill the blocks. The output is moved to the next block (the copy block and the next block) at the time when (there is no failure due to rewriting). With this method, the image is guaranteed in the other block even when the above-mentioned failure occurs.

【0004】[0004]

【発明が解決しようとする課題】上述した従来のジャー
ナルブロック復旧方式では、ジャーナルブロックに対す
る障害を認識後、障害の発生したマスターブロックを障
害の発生していないコピーブロックにて復旧する手段を
ユーザが起動し、復旧しなければならず、復旧に時間が
かかるという欠点があった。
In the above-mentioned conventional journal block recovery method, after recognizing a failure in a journal block, a user provides means for recovering a failed master block with a copy block in which no failure has occurred. It had to be started up and restored, which took time to restore.

【0005】本発明の目的はジャーナルファイルのオー
プン時、障害の発生したジャーナルブロックを検出し自
動的に復旧することによって、ユーザがジャーナルファ
イルの障害が発生したことを認識し、復旧プログラムを
起動する事なく、ジャーナルファイルの利用を可能とす
る事にある。
An object of the present invention is to detect a journal block in which a failure has occurred when the journal file is opened and to automatically recover the journal block, so that the user recognizes the failure of the journal file and activates the recovery program. There is no need to enable the use of journal files.

【0006】[0006]

【課題を解決するための手段】第1の発明は、データベ
ースの更新に先立ち、ジャーナルレコードをジャーナル
ファイルに出力する場合に前記同一のジャーナルレコー
ドを連続した2つのジャーナルブロックであって最初の
前記ジャーナルブロックをマスターブロック次の前記ジ
ャーナルブロックをコピーブロックとする前記ジャーナ
ルブロックに出力し前記マスターブロックが一杯になっ
た時点で次の前記コピーブロックを前記マスターブロッ
クとしさらにその次の前記ジャーナルブロックを前記コ
ピーブロックとして前記同一のジャーナルレコードの出
力を行うデータベースシステムにおける前記ジャーナル
ブロックに障害が発生した場合のジャーナルブロック復
旧方式において、前記ジャーナルブロックの障害を検出
するジャーナルファイルアクセス手段と、前記障害が検
出されると前記ジャーナルファイル中の最終の前記マス
ターブロックへ位置付けを行う最終ジャーナルブロック
位置付け手段と、前記マスタブロックの障害を予め定め
られた方法により検出する障害ジャーナルブロック検出
手段と、障害の発生した前記マスタブロックを前記障害
の発生したマスタブロックの次の前記コピーブロックの
内容により復旧を行うジャーナルブロック復旧手段を含
むことを特徴とする。
According to a first aspect of the present invention, prior to updating a database, when outputting a journal record to a journal file, the same journal record is two consecutive journal blocks and is the first journal. The block is a master block. The journal block having the next journal block as a copy block is output to the journal block, and when the master block is full, the next copy block is the master block and the next journal block is the copy. In the journal block recovery method when a failure occurs in the journal block in the database system that outputs the same journal record as a block, a journal block that detects the failure of the journal block File access means, a final journal block positioning means for positioning the final master block in the journal file when the failure is detected, and a failed journal block for detecting a failure of the master block by a predetermined method The present invention is characterized by including a detecting unit and a journal block restoring unit for restoring the failed master block according to the contents of the copy block next to the failed master block.

【0007】また、第2の発明は、データベースの更新
に先立ち、ジャーナルレコードをジャーナルファイルに
出力する場合に前記同一のジャーナルレコードを連続し
た2つのジャーナルブロックであって最初の前記ジャー
ナルブロックをマスターブロック次の前記ジャーナルブ
ロックをコピーブロックとする前記ジャーナルブロック
に出力し前記マスターブロックが一杯になった時点で次
の前記コピーブロックを前記マスターブロックとしさら
にその次の前記ジャーナルブロックを前記コピーブロッ
クとして前記同一のジャーナルレコードの出力を行うデ
ータベースシステムにおける前記ジャーナルブロックに
障害が発生した場合のジャーナルブロック復旧方法にお
いて、前記ジャーナルブロックの障害を検出すると、前
記ジャーナルファイル中の最終の前記マスターブロック
の障害を予め定められた方法により検出し、障害の発生
した前記マスタブロックを前記障害の発生したマスタブ
ロックの次の前記コピーブロックの内容により復旧を行
うことを特徴とする。
In addition, in the second invention, prior to updating the database, when the journal record is output to a journal file, the same journal record is two consecutive journal blocks, and the first journal block is the master block. The next journal block is output as the copy block to the journal block, and when the master block is full, the next copy block is the master block, and the next journal block is the copy block. In the method of recovering a journal block when a failure occurs in the journal block in the database system that outputs the journal record of the The failure of the final master block in the file is detected by a predetermined method, and the failed master block is restored by the contents of the copy block next to the failed master block. And

【0008】[0008]

【実施例】次に、本発明について図面を参照して説明す
る。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be described with reference to the drawings.

【0009】図1は本発明のジャーナルブロック復旧方
式の一実施例を示すブロック図である。
FIG. 1 is a block diagram showing an embodiment of a journal block recovery system of the present invention.

【0010】本実施例は、データベースの入出力を行う
データベースアクセス手段12と、データベースの更新
を行うデータベース更新プログラム11と、データベー
スの更新履歴を格納するジャーナルファイル19と、ジ
ャーナルファイルへの入出力を行うジャーナルファイル
アクセス手段14と、ジャーナルファイルの連続した2
ブロックに対し同一イメージを出力するジャーナルブロ
ック二重書き手段18と、ジャーナルブロックの障害を
検出する障害ジャーナルブロック検出手段17と、ジャ
ーナルファイル中の最終ジャーナルブロックへ位置付け
を行う最終ジャーナルブロック位置付け手段16と、障
害の発生したジャーナルブロックの復旧を行うジャーナ
ルブロック復旧手段15により構成されている。
In this embodiment, a database access means 12 for inputting / outputting a database, a database updating program 11 for updating a database, a journal file 19 for storing the update history of the database, and an input / output for the journal file are provided. The journal file access means 14 to perform and the continuous 2 of journal files
A journal block double-writing unit 18 for outputting the same image to a block, a fault journal block detecting unit 17 for detecting a fault in a journal block, and a final journal block positioning unit 16 for positioning the final journal block in a journal file. The journal block recovery unit 15 recovers the failed journal block.

【0011】本発明の特徴は、図1において、ジャーナ
ルファイルのオープン時の最終ジャーナルブロック(マ
スターブロック…従来技術参照)位置付け処理で、ジャ
ーナルブロックに障害が発生しているかどうかを検査
し、障害が発生していた場合、正常に書き込まれた片方
のジャーナルブロック(コピーブロック…従来技術参
照)より自動的に復旧する事である。この方式により、
利用者はジャーナルブロックの障害を意識せずにジャー
ナルファイルの利用が可能となる。尚、ここでの障害と
は、ハード的な固定障害は除き、主としてホストダウン
等の障害、間欠的なハード障害を想定している。
The feature of the present invention is that, in FIG. 1, in the final journal block (master block ... See the prior art) locating process when a journal file is opened, it is checked whether or not a fault has occurred in the journal block. If it occurs, it means to automatically recover from one normally written journal block (copy block ... See the prior art). With this method,
The user can use the journal file without being aware of the journal block failure. It should be noted that the failures here are mainly assumed to be failures such as host down and intermittent hard failures, excluding fixed failures in hardware.

【0012】正常時は、データベース更新プログラム1
1によるデータベース13の更新要求を受けて、データ
ベースアクセス手段12はデータベース更新に先立ち、
ジャーナルファイルアクセス手段14を介してジャーナ
ルファイル19にジャーナルを出力する。この場合ジャ
ーナル出力方法は、従来技術と同様、同一イメージのジ
ャーナルを連続した2つのブロック(マスターブロック
とコピーブロック)に書き込み、マスターブロックが一
杯になった時点で次のブロック(コピーブロックとその
次のブロック)へ出力を移す。ジャーナルファイル19
へのジャーナルの出力後に、データベースアクセス手段
12はデータベース13を更新する。
During normal operation, the database update program 1
In response to the update request for updating the database 13 by 1, the database access unit 12 precedes the database update.
The journal is output to the journal file 19 via the journal file access means 14. In this case, the journal output method is similar to the conventional technique in that the journal of the same image is written in two consecutive blocks (master block and copy block), and when the master block is full, the next block (copy block and the next block) is written. Block) to the output. Journal file 19
After outputting the journal to the database access means 12, the database access means 12 updates the database 13.

【0013】次に、ジャーナルファイル19へのマスタ
ーブロック出力時に異常が発生した場合の本発明の動作
について、図2を参照して説明する。
Next, the operation of the present invention when an abnormality occurs when outputting the master block to the journal file 19 will be described with reference to FIG.

【0014】まず、異常を検出したジャーナルファイル
アクセス手段14によって起動された最終ジャーナルブ
ロック位置付け手段16が、一番最後に出力されたジャ
ーナルブロックに位置付けを行う(ステップ21)。
First, the final journal block locating means 16 activated by the journal file access means 14 that has detected an abnormality locates the journal block output at the very end (step 21).

【0015】次に、障害ジャーナルブロック検出手段1
7が起動され、位置付けされた最終ブロックに障害が発
生しているかどうかチェックを行う(ステップ22)。
ブロックに障害が発生しているかどうかは、例えばブロ
ックのヘッダとトレーラのバリューの照合などで行う。
Next, the fault journal block detecting means 1
7 is activated, and it is checked whether or not there is a failure in the located final block (step 22).
Whether or not a block has a failure is determined by, for example, matching the block header with the trailer value.

【0016】障害が発生していた場合、ジャーナルブロ
ック復旧手段15が起動され、復旧用の次ブロック即ち
コピーブロックより障害ブロック即ちマスターブロック
を更新することにより復旧する(ステップ23)。
If a failure has occurred, the journal block recovery means 15 is activated and the recovery is performed by updating the failed block or master block from the recovery next block or copy block (step 23).

【0017】障害ブロック復旧後は、データベースファ
イルアクセス手段14により、ジャーナルの後戻り読み
により更新途中のジャーナルレコードが判断され、デー
タベースアクセス手段12を介してデータベースの復旧
が行われる。
After the recovery of the faulty block, the database file access means 14 determines the journal record in the middle of updating by the backward read of the journal, and the database access means 12 restores the database.

【0018】[0018]

【発明の効果】以上説明したように、本発明によればジ
ャーナルによるデータベースの復旧が必要になった場
合、前回のジャーナル出力でジャーナルブロックに対し
障害が発生しているかどうかを意識せず自動的に復旧が
行われるため、障害ジャーナルブロックの復旧処理が効
率化される効果がある。
As described above, according to the present invention, when it becomes necessary to recover a database by using a journal, it is automatically performed without being aware of whether a journal block has failed in the previous journal output. Since the recovery is performed on the first time, there is an effect that the recovery processing of the failed journal block is made efficient.

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

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

【図2】本実施例の処理の流れを示すフローチャート流
れ図である。
FIG. 2 is a flow chart showing the flow of processing of this embodiment.

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

11 データベース更新プログラム 12 データベースアクセス手段 13 データベース 14 ジャーナルファイルアクセス手段 15 ジャーナルブロック復旧手段 16 最終ジャーナルブロック位置付け手段 17 障害ジャーナルブロック検出手段 18 ジャーナルブロック二重書き手段 11 Database Update Program 12 Database Access Means 13 Database 14 Journal File Access Means 15 Journal Block Restoring Means 16 Final Journal Block Positioning Means 17 Fault Journal Block Detecting Means 18 Journal Block Double Writing Means

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 データベースの更新に先立ち、ジャーナ
ルレコードをジャーナルファイルに出力する場合に前記
同一のジャーナルレコードを連続した2つのジャーナル
ブロックであって最初の前記ジャーナルブロックをマス
ターブロック次の前記ジャーナルブロックをコピーブロ
ックとする前記ジャーナルブロックに出力し前記マスタ
ーブロックが一杯になった時点で次の前記コピーブロッ
クを前記マスターブロックとしさらにその次の前記ジャ
ーナルブロックを前記コピーブロックとして前記同一の
ジャーナルレコードの出力を行うデータベースシステム
における前記ジャーナルブロックに障害が発生した場合
のジャーナルブロック復旧方式において、前記ジャーナ
ルブロックの障害を検出するジャーナルファイルアクセ
ス手段と、前記障害が検出されると前記ジャーナルファ
イル中の最終の前記マスターブロックへ位置付けを行う
最終ジャーナルブロック位置付け手段と、前記マスタブ
ロックの障害を予め定められた方法により検出する障害
ジャーナルブロック検出手段と、障害の発生した前記マ
スタブロックを前記障害の発生したマスタブロックの次
の前記コピーブロックの内容により復旧を行うジャーナ
ルブロック復旧手段を含むことを特徴とするジャーナル
ブロック復旧方式。
1. When outputting a journal record to a journal file prior to updating a database, the first journal block is a master block and the next journal block is the first two journal blocks which are consecutive journal records of the same journal record. Output to the journal block to be a copy block, and when the master block is full, the next copy block is the master block, and the next journal block is the copy block, and the output of the same journal record is made. In the journal block recovery method when a failure occurs in the journal block in the database system, a journal file access means for detecting a failure in the journal block, and the failure Is detected, the final journal block positioning means for positioning the final master block in the journal file, the failure journal block detection means for detecting a failure of the master block by a predetermined method, and the occurrence of a failure A journal block restoration method comprising: journal block restoration means for restoring the master block according to the contents of the copy block next to the failed master block.
【請求項2】 データベースの更新に先立ち、ジャーナ
ルレコードをジャーナルファイルに出力する場合に前記
同一のジャーナルレコードを連続した2つのジャーナル
ブロックであって最初の前記ジャーナルブロックをマス
ターブロック次の前記ジャーナルブロックをコピーブロ
ックとする前記ジャーナルブロックに出力し前記マスタ
ーブロックが一杯になった時点で次の前記コピーブロッ
クを前記マスターブロックとしさらにその次の前記ジャ
ーナルブロックを前記コピーブロックとして前記同一の
ジャーナルレコードの出力を行うデータベースシステム
における前記ジャーナルブロックに障害が発生した場合
のジャーナルブロック復旧方法において、前記ジャーナ
ルブロックの障害を検出すると、前記ジャーナルファイ
ル中の最終の前記マスターブロックの障害を予め定めら
れた方法により検出し、障害の発生した前記マスタブロ
ックを前記障害の発生したマスタブロックの次の前記コ
ピーブロックの内容により復旧を行うことを特徴とする
ジャーナルブロック復旧方法。
2. Prior to updating the database, when outputting a journal record to a journal file, the first journal block is a master block and the next journal block is the two consecutive journal blocks of the same journal record. Output to the journal block to be a copy block, and when the master block is full, the next copy block is the master block, and the next journal block is the copy block, and the output of the same journal record is made. In the method of recovering a journal block when a failure occurs in the journal block in the database system, when the failure of the journal block is detected, the last file in the journal file is deleted. A journal block recovery method, wherein a failure of a star block is detected by a predetermined method, and the failed master block is recovered by the content of the copy block next to the failed master block. .
JP6008067A 1994-01-28 1994-01-28 Journal block recovery method and journal block recovery method Expired - Fee Related JP2806779B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6008067A JP2806779B2 (en) 1994-01-28 1994-01-28 Journal block recovery method and journal block recovery method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6008067A JP2806779B2 (en) 1994-01-28 1994-01-28 Journal block recovery method and journal block recovery method

Publications (2)

Publication Number Publication Date
JPH07219828A true JPH07219828A (en) 1995-08-18
JP2806779B2 JP2806779B2 (en) 1998-09-30

Family

ID=11683009

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6008067A Expired - Fee Related JP2806779B2 (en) 1994-01-28 1994-01-28 Journal block recovery method and journal block recovery method

Country Status (1)

Country Link
JP (1) JP2806779B2 (en)

Also Published As

Publication number Publication date
JP2806779B2 (en) 1998-09-30

Similar Documents

Publication Publication Date Title
US6742138B1 (en) Data recovery method and apparatus
US7499954B2 (en) Consistent reintegration of a failed primary instance
US7310743B1 (en) Data recovery method and apparatus
KR20050009696A (en) Method and system for disaster recovery
US5421003A (en) Disk storage system with fault tolerant media maintenance
JPS5913783B2 (en) Duplicate file method
JPH07219828A (en) Journal block restoring system and method thereof
JP2000076110A (en) Recovering process system of decentralized file system
JPH0981464A (en) Memory fault recovering method of computer system and recovering system
JP2972439B2 (en) Portable terminal backup method
JP2946465B2 (en) Failure recovery processing method
JPS63262737A (en) Data base updating and recording processing method
JPH01214947A (en) Data preserving system
JP2639334B2 (en) Remote maintenance recovery method
JP2744247B2 (en) Data integrity processing method
JPH08335206A (en) Automatic transaction restoration system of loosely coupled multicomputer system
US20040078646A1 (en) Recovery processing of a faulty block in a memory unit
JP4878113B2 (en) Link library recovery method and program for DASD failure
JP2806342B2 (en) Database failure recovery method and device
JPH05173864A (en) File recovery system
JPS61193241A (en) Updated career recording
JPH0210457B2 (en)
JPH07219829A (en) Data maintenance method
JP2002244905A (en) File back-up method, file back-up program, and recording medium
JPH04256006A (en) File restoring system

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19980623

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20070724

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20080724

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20090724

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20100724

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20110724

Year of fee payment: 13

LAPS Cancellation because of no payment of annual fees